This commit is contained in:
2025-11-13 19:20:57 +08:00
parent 50163d02a7
commit ae79d1b1ba
17 changed files with 846 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
//
// PayVM.h
// 支付相关 VM封装 Apple IAP 验签请求
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 统一的支付回调sta 为状态码0 成功,非 0 失败msg 为后端返回的消息
typedef void(^KBPayCompletion)(NSInteger sta, NSString * _Nullable msg);
/// 统一状态码(与原 Swift 代码的 succCode / errorCode 语义一致)
#ifndef KB_PAY_SUCC_CODE
#define KB_PAY_SUCC_CODE 0
#endif
#ifndef KB_PAY_ERROR_CODE
#define KB_PAY_ERROR_CODE 1
#endif
@interface PayVM : NSObject
/// Apple 内购验签
/// params 形如:@{ @"payment": @{ @"receipt": receipt, @"type": @(type) } }
/// needShow是否显示加载 HUD
- (void)applePayReqWithParams:(NSDictionary *)params
needShow:(BOOL)needShow
completion:(KBPayCompletion)completion;
@end
NS_ASSUME_NONNULL_END