Worldline ePayments India 的 iOS Checkout SDK。
这是集成 Worldline ePayments India Checkout 的官方原生 SDK。
支持的平台
- iOS
注意:
- 我们支持 Xcode 12+ 版本。
安装
weipl_checkout 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile:
pod 'weipl_checkout'
集成代码
以下是一个检查初始化代码示例
let reqJson : [String:Any] = [
"features" : [
"enableAbortResponse": true,
"enableExpressPay": true,
"enableInstrumentDeRegistration": true,
"enableMerTxnDetails": true
],
"consumerData": [
"deviceId": "iOSSH2", //possible values "iOSSH1" or "iOSSH2"
"token": "0b125f92d967e06135a7179d2d0a3a12e246dc0ae2b00ff018ebabbe747a4b5e47b5eb7583ec29ca0bb668348e1e2cd065d60f323943b9130138efba0cf109a9",
"paymentMode": "all",
"merchantLogoUrl": "https://www.paynimo.com/CompanyDocs/company-logo-vertical.png", //provided merchant logo will be displayed
"merchantId": "L3348",
"currency": "INR",
"consumerId": "c964634",
"consumerMobileNo": "9876543210",
"consumerEmailId": "[email protected]",
"txnId": "1665386045734", //Unique merchant transaction ID
"items": [[
"itemId": "first",
"amount": "10",
"comAmt": "0"
]],
"customStyle": [
"PRIMARY_COLOR_CODE": "#45beaa", // RGB and Hex and RGB supported parameter
"SECONDARY_COLOR_CODE": "#ffffff",
"BUTTON_COLOR_CODE_1": "#2d8c8c",
"BUTTON_COLOR_CODE_2": "#ffffff",
]
]
]
do {
let jSONObject = String(data: try JSONSerialization.data(withJSONObject: reqJson, options: .prettyPrinted), encoding: String.Encoding(rawValue: NSUTF8StringEncoding))
WLCheckout!.open(requestObj: jSONObject!)
DispatchQueue.main.async{
self.present(self.WLCheckout!, animated: true, completion: nil)
}
} catch _ as NSError {
}
@objc func wlCheckoutPaymentResponse(result: Notification) {
print("\(result.object!)")
}
@objc func wlCheckoutPaymentError(result: Notification) {
print("\(result.object!)")
}
完整的集成指南
请参阅我们的集成指南了解我们的iOS本地SDK。
贡献
感谢,贡献者!
许可
weipl_checkout在MIT许可下可用。有关更多信息,请参阅LICENSE文件。