内购的逻辑

This commit is contained in:
fengshuo
2021-09-26 20:42:33 +08:00
parent d3e26de656
commit c9dd6001b4
32 changed files with 879 additions and 38 deletions

View File

@@ -0,0 +1,36 @@
//
// XPIAPHelper.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/26.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger ,PaymentStatus) {
PaymentStatus_Purchasing = 1,//付款中
PaymentStatus_Purchased, //付款操作已经完成
PaymentStatus_Failed, //付款操作失败
PaymentStatus_Deferred, //未知状态
};
@protocol XPIAPHelperDelegate <NSObject>
///当前充值的状态
- (void)rechargeProcessStatus:(PaymentStatus)status;
///充值成功回调id
- (void)rechargeSuccess:(NSString *)transactionIdentifier;
@end
@interface XPIAPHelper : NSObject
+ (instancetype)shareHelper;
///代理
@property (nonatomic,weak) id<XPIAPHelperDelegate> delegate;
///购买商品
- (void)buyAppProductWithAppProductId:(NSString *)appProductId;
@end
NS_ASSUME_NONNULL_END