2
This commit is contained in:
@@ -30,6 +30,10 @@ typedef void(^KBPayProductsCompletion)(NSInteger sta,
|
||||
- (void)fetchInAppProductsNeedShow:(BOOL)needShow
|
||||
completion:(KBPayProductsCompletion)completion;
|
||||
|
||||
/// 查询订阅商品列表
|
||||
- (void)fetchSubscriptionProductsNeedShow:(BOOL)needShow
|
||||
completion:(KBPayProductsCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -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