1
This commit is contained in:
@@ -46,6 +46,29 @@ NSNotificationName const KBIAPDidCompletePurchaseNotification = @"KBIAPDidComple
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)verifySignedPayload:(NSString *)payload
|
||||
completion:(void (^)(BOOL success, NSString * _Nullable message, NSInteger statusCode))completion {
|
||||
if (![payload isKindOfClass:NSString.class] || payload.length == 0) {
|
||||
if (completion) {
|
||||
completion(NO, KBLocalized(@"Payload missing"), KBBizCodeReceiptError);
|
||||
}
|
||||
return;
|
||||
}
|
||||
NSDictionary *params = @{ @"signedPayload": payload ?: @"" };
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[self.payVM applePayReqWithParams:params needShow:NO completion:^(NSInteger sta, NSString * _Nullable msg) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong typeof(weakSelf) self = weakSelf;
|
||||
(void)self;
|
||||
BOOL success = (sta == KBBizCodeSuccess);
|
||||
NSString *tip = msg ?: (success ? KBLocalized(@"Success") : KBLocalized(@"Payment failed"));
|
||||
if (completion) {
|
||||
completion(success, tip, sta);
|
||||
}
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - FGIAPVerifyTransaction
|
||||
|
||||
- (void)pushSuccessTradeReultToServer:(NSString *)receipt
|
||||
|
||||
Reference in New Issue
Block a user