2
This commit is contained in:
@@ -32,9 +32,30 @@
|
||||
|
||||
- (void)fetchInAppProductsNeedShow:(BOOL)needShow
|
||||
completion:(KBPayProductsCompletion)completion {
|
||||
if (needShow) { [KBHUD show]; }
|
||||
NSDictionary *params = @{ @"type": @"in-app-purchase" };
|
||||
[[KBNetworkManager shared] GET:API_INAPP_PRODUCT_LIST
|
||||
[self fetchProductListWithPath:API_INAPP_PRODUCT_LIST
|
||||
params:params
|
||||
needShow:needShow
|
||||
completion:completion];
|
||||
}
|
||||
|
||||
- (void)fetchSubscriptionProductsNeedShow:(BOOL)needShow
|
||||
completion:(KBPayProductsCompletion)completion {
|
||||
NSDictionary *params = @{ @"type": @"subscription" };
|
||||
[self fetchProductListWithPath:API_SUBSCRIPTION_PRODUCT_LIST
|
||||
params:params
|
||||
needShow:needShow
|
||||
completion:completion];
|
||||
}
|
||||
|
||||
#pragma mark - Helpers
|
||||
|
||||
- (void)fetchProductListWithPath:(NSString *)path
|
||||
params:(NSDictionary *)params
|
||||
needShow:(BOOL)needShow
|
||||
completion:(KBPayProductsCompletion)completion {
|
||||
if (needShow) { [KBHUD show]; }
|
||||
[[KBNetworkManager shared] GET:path
|
||||
parameters:params
|
||||
headers:nil
|
||||
autoShowBusinessError:NO
|
||||
@@ -64,8 +85,6 @@
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Helpers
|
||||
|
||||
//+ (NSInteger)extractStatusFromResponseObject:(id)obj response:(NSURLResponse *)resp {
|
||||
// // 优先从 JSON 提取 code/status/success
|
||||
// if ([obj isKindOfClass:NSDictionary.class]) {
|
||||
|
||||
Reference in New Issue
Block a user