BKM EXPRESS FLOW SDK
它的用途是什么?
通过为您的服务提供的 BKM Express Flow iOS SDK 包,即使最终用户设备上未安装 BKMExpress 应用,也能从您的应用中实现“支付”功能,无需退出应用。
要求
- iOS 9.0 或更高版本
- CocoaPods
如何工作?
完成工作场所的 BKM Express 集成,并通过业务服务应用在 BKM 服务器上登录后,可以通过选择他们想要工作的环境(例如,测试环境或生产环境),使用从 BKM 服务器收到的 TICKET_TOKEN , TICKET_ID 和 TICKET_PATH 参数启动 BKMExpress Flow SDK 流程。有关 BKM 服务器上的登录详细信息的更多信息,请参阅此处。
与 CocoaPods 集成
pod 'BKMExpressFlowSDK', '1.0.14'
### 示例用法
// instantiate view controller with custom constructor
BKMExpressPaymentViewController *expressPaymsentViewController= [[BKMExpressPaymentViewController alloc] initWithBexTicketToken:PAYMENT_TICKET_TOKEN bexTicketPath:PAYMENT_TICKET_PATH bexTicketId:PAYMENT_TICKET_ID delegate:self];
// if debug mode is enabled, this sdk connect to preprod otherwise connect to prod.
[expressPaymentViewController setEnableDebugMode:YES];
// Present view controller
expressPaymentViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:expressPaymentViewController animated:YES completion:nil];
}
通过启用 DebugMode 可向测试服务器发送请求,通过禁用 DebugMode 可向生产服务器发送请求。
### BKMOTPDelegate
- (void)bkmExpressPaymentDidComplete{
NSLog(@"Successful payment");
}
- (void)bkmExpressPaymentDidCancel{
NSLog(@"Payment is canceled by user");
}
- (void)bkmExpressPaymentDidFail:(NSError *)error{
NSLog(@"An error has occurred on payment = %@", error.localizedDescription);
}