mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-06-09 07:43:57 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
36 lines
1.1 KiB
Objective-C
Executable File
36 lines
1.1 KiB
Objective-C
Executable File
//
|
|
// PKPayment+Stripe.m
|
|
// Stripe
|
|
//
|
|
// Created by Ben Guo on 7/2/15.
|
|
//
|
|
|
|
#import "PKPayment+Stripe.h"
|
|
|
|
@implementation PKPayment (Stripe)
|
|
|
|
- (BOOL)stp_isSimulated {
|
|
return [self.token.transactionIdentifier isEqualToString:@"Simulated Identifier"];
|
|
}
|
|
|
|
+ (NSString *)stp_testTransactionIdentifier {
|
|
NSString *uuid = [[NSUUID UUID] UUIDString];
|
|
uuid = [uuid stringByReplacingOccurrencesOfString:@"~" withString:@""
|
|
options:0
|
|
range:NSMakeRange(0, uuid.length)];
|
|
|
|
// Simulated cards don't have enough info yet. For now, use a fake Visa number
|
|
NSString *number = @"4242424242424242";
|
|
|
|
// Without the original PKPaymentRequest, we'll need to use fake data here.
|
|
NSDecimalNumber *amount = [NSDecimalNumber decimalNumberWithString:@"0"];
|
|
NSString *cents = [@([[amount decimalNumberByMultiplyingByPowerOf10:2] integerValue]) stringValue];
|
|
NSString *currency = @"USD";
|
|
NSString *identifier = [@[@"ApplePayStubs", number, cents, currency, uuid] componentsJoinedByString:@"~"];
|
|
return identifier;
|
|
}
|
|
|
|
@end
|
|
|
|
void linkPKPaymentCategory(void){}
|