【问题标题】:How to get Google Pay response after returning back to app in iOS返回 iOS 应用后如何获得 Google Pay 响应
【发布时间】: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


    【解决方案1】:

    据我所知,Google Pay API 仅适用于 Android 和 Web。从current docs 来看,仅显示这些选项。

    如果您正在寻找一个简单的支付 API,Stripe 我知道它很容易实现。你也可以试试Apple Pay SDK

    【讨论】:

    • 我们有什么方法可以在 Web 视图中实现这一点并同时产生一些响应?
    • @Suhail 你有没有找到任何解决方案?如何在 iOS 中集成 GooglePay?
    • @Muzammil 我没有!但是最近有一个类似问题的答案。看看它是否有帮助:- stackoverflow.com/a/64496910/8485197
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-02
    • 2019-05-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多