iOS 示例应用程序
此存储库包含 Swift 和 Objective-C 的示例应用程序,以展示如何在您的应用中集成 AuroPay 支付 SDK。
先决条件
- 您应该在 AuroPay 商户门户网站上注册。
- 您可以从 AuroPay 商户门户网站获取您的子域名 ID、accessKey 和 secretKey。
示例项目设置
-
根据您的使用情况,通过 Xcode 或 Git Bash 克隆此存储库。
-
在 pod 文件中添加 `pod 'auropay-payments-sandbox'` 并从 Auropay Swift 示例应用或 Auropay ObjC 示例目录中运行 `pod install`。
-
在 Xcode 中打开示例项目的偏好语言 Swift/Objective-C 的 xcworkspace。
-
如果发现任何错误,请清理并重新构建项目。
-
在 AuroPayBuilder 构造函数中将子域名 ID、accessKey 和 secretKey 的占位符值替换为您自己的详细信息。
-
Swift
AuroPayBuilder()
.merchantID("Your Subdomain ID")
.accessKey("Your Access Key")
.secretKey("Your Secret Key")
.customerProfile(self.getCustomerProfile())
.addEventListener({(eventID, eventDesc) in
debugPrint("EventID: \(eventID), EventDescription: \(eventDesc)")
})
.theme(theme)
.showReceipt(true)
.allowCardScan(true)
.build()
[[[[[[[[[[AuroPayBuilder alloc]
merchantID:@"Your Subdomain ID"]
accessKey:@"Your Access Key"]
secretKey:@"Your Secret Key"]
customerProfile:[self getCustomerProfile]]
addEventListener:^(NSString* eventID, NSString* eventDesc) {
NSLog(@"%@", [NSString stringWithFormat:@"eventID: %@, eventDesc: %@", eventID, eventDesc]);
}]
theme:theme]
showReceipt:YES]
allowCardScan:YES]
build];
- 运行示例应用程序。
AuroPay Payments SDK 简介
AuroPay Payments iOS SDK 允许您通过提供构建块来创建结账体验,从而接受应用内支付。