【发布时间】:2020-10-09 12:43:59
【问题描述】:
我正在尝试通过 Google Pay 应用进行交易。到目前为止我已经实现了这个:
let paValue = "Client_upi_key" //payee address upi id
let pnValue = "Merchant Name" // payee name
let trValue = "1234ABCD" //tansaction Id
let urlValue = "http://url/of/the/order/in/your/website" //url for refernec
let mcValue = "1234" // retailer category code :- user id
let tnValue = "Purchase in Merchant" //transction Note
let amValue = "1" //amount to pay
let cuValue = "INR" //currency
let str = "gpay://upi/pay?pa=\(paValue)&pn=\(pnValue)&tr=\(trValue)&mc=\(mcValue)&tn=\(tnValue)&am=\(amValue)&cu=\(cuValue)"
guard let urlString = str.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
else {
return
}
guard let url = URL(string: urlString) else {
return
}
UIApplication.shared.open(url)
现在我正在返回我的应用程序并希望从 Google Pay 获得一些响应,例如 transactionID、userID 等。在这种情况下,有没有像 Android 一样使用 Intent 的方法?
【问题讨论】:
标签: ios swift iphone android-intent google-pay