1
This commit is contained in:
@@ -458,7 +458,7 @@ autoShowBusinessError:YES
|
||||
NSLocalizedDescriptionKey : msg,
|
||||
@"code" : @(bizCode)
|
||||
}];
|
||||
// if (completion) completion(dict, response, bizErr);
|
||||
if (completion) completion(dict, response, bizErr);
|
||||
return;
|
||||
}
|
||||
// code 缺失或为成功,按正常成功回调
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#else
|
||||
type = 1;
|
||||
#endif
|
||||
|
||||
// , @"type": @(type)
|
||||
NSDictionary *params = @{ @"receipt": receipt ?: @""};
|
||||
__weak typeof(self) weakSelf = self;
|
||||
@@ -47,7 +46,9 @@
|
||||
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
|
||||
[KBHUD showSuccess:@"Success"];
|
||||
if (handler) handler(KBLocalized(@"Success"), nil);
|
||||
} else {
|
||||
}else if(sta == KBBizCodeReceiptError){
|
||||
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
|
||||
}else {
|
||||
[KBHUD showError:@"Failed"];
|
||||
if (handler) handler(KBLocalized(@"Failed"), nil);
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
completion:(KBPayCompletion)completion {
|
||||
if (needShow) { [KBHUD show]; }
|
||||
|
||||
[[KBNetworkManager shared] POST:API_VALIDATE_RECEIPT jsonBody:params headers:nil completion:^(NSDictionary * _Nullable json, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
[[KBNetworkManager shared] POST:API_VALIDATE_RECEIPT jsonBody:params headers:nil autoShowBusinessError:false completion:^(NSDictionary * _Nullable json, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
if (needShow) { [KBHUD dismiss]; }
|
||||
|
||||
if (error) {
|
||||
// if (completion) completion(ERROR_CODE, error.localizedDescription ?: KBLocalized(@"Network error"));
|
||||
if (completion) completion(ERROR_CODE, error.localizedDescription ?: KBLocalized(@"Network error"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
#if DEBUG
|
||||
#define KBLOG(fmt, ...) do { \
|
||||
NSString *kb_msg__ = [NSString stringWithFormat:(fmt), ##__VA_ARGS__]; \
|
||||
NSLog(@"\n==============================[KB DEBUG]==============================\n[Function] %s\n[Line] %d\n%@\n=====================================================================\n", __PRETTY_FUNCTION__, __LINE__, kb_msg__); \
|
||||
NSString *kb_full_msg__ = [NSString stringWithFormat:@"\n==============================[KB DEBUG]==============================\n[Function] %s\n[Line] %d\n%@\n=====================================================================\n", __PRETTY_FUNCTION__, __LINE__, kb_msg__]; \
|
||||
fprintf(stderr, "%s", kb_full_msg__.UTF8String); \
|
||||
} while(0)
|
||||
#else
|
||||
#define KBLOG(...)
|
||||
|
||||
Reference in New Issue
Block a user