iOS SDK_支付功能
可使用应用内购买所需的支付功能。支付结果值以Delegate形式实现。
AppDelegate设置
为使用支付功能设置AppDelegate时,请使用下列代码。
#import <GamePot/GamePot.h>
@interface ViewController () <GamePotPurchaseDelegate>
@end
@implementation ViewController
- (void)viewDidLoad
{
...
[[GamePot getInstance] setPurchaseDelegate:self];
...
}
- (void)GamePotPurchaseSuccess:(GamePotPurchaseInfo *)_info
{
// 付款成功
}
- (void)GamePotPurchaseFail:(NSError *)_error
{
// 支付错误。请在游戏弹窗显示失败原因相关消息。
// 消息语句请使用[error localizedDescription]。
}
- (void)GamePotPurchaseCancel
{
// 启动付款过程中取消
// 在游戏弹窗显示“已取消支付。”消息。
}
@end支付尝试功能
如要使用支付尝试功能,请使用下列代码。
尝试一般支付
单独管理支付尝试及发票号
单独管理支付尝试、发票号,将角色信息传递到Webhook
获取付费道具列表功能
如要使用获取由商店传递的应用内付费道具列表功能,请使用下列代码。
发放付费道具的功能
可设置为与支付商店的发票明细进行对照并完成所有验证后向开发商服务器传递发放请求。
详细说明请参考道具发放请求。
Last updated