Files
keyboard/keyBoard/Class/Pay/VM/PayVM.h
2025-11-13 19:20:57 +08:00

34 lines
870 B
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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