This commit is contained in:
2025-12-12 14:54:45 +08:00
parent 1eeeef266b
commit 2b08dd44ee
4 changed files with 141 additions and 24 deletions

View File

@@ -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]) {