sUrl 和 fUrl 应该是什么 - PayU Money iOS 集成

What should be the sUrl and fUrl - PayU Money iOS integration

我已经成功集成了PayU money sdk。我想要的是一旦交易完成我想通知我的服务器交易状态。

这可以通过 txnParam.surltxnParam.furl 完成。当我这样设置时...

txnParam.surl = "http://staging.myserver.com/payu-success.php"
txnParam.furl = "http://staging.myserver.com/payu-fail.php"

我从 PayU money 移动 sdk 收到无效的 sUrl 响应,无法进行交易。

但是当我这样设置的时候...

txnParam.surl = "https://www.payumoney.com/mobileapp/payumoney/success.php"
txnParam.furl = "https://www.payumoney.com/mobileapp/payumoney/failure.php"

我可以进行交易,而且我正在从 PayU money 收到成功响应。 但是我怎样才能通知我的服务器呢?

我的代码

    let txnParam = PUMTxnParam()
    PlugNPlay.setDisableCompletionScreen(true)

    txnParam.phone = "1111111111"
    txnParam.email = "test@test.com"
    txnParam.amount = "2550.0"
    txnParam.environment = PUMEnvironment.test
    txnParam.firstname = "test test"
    txnParam.key = kMerchentKey

    txnParam.merchantid = "5675943"
    txnParam.txnID = "1234567890"
//        txnParam.surl = "https://www.payumoney.com/mobileapp/payumoney/success.php"
//        txnParam.furl = "https://www.payumoney.com/mobileapp/payumoney/failure.php"
    txnParam.surl = "http://staging.myserver.com/payu-success.php"
    txnParam.furl = "http://staging.myserver.com/payu-fail.php"

    txnParam.productInfo = "Test Product"
    txnParam.udf1 = "ud1"
    txnParam.udf2 = "ud2"
    txnParam.udf3 = "ud3"
    txnParam.udf4 = "ud4"
    txnParam.udf5 = "ud5"
    txnParam.udf6 = ""
    txnParam.udf7 = ""
    txnParam.udf8 = ""
    txnParam.udf9 = ""
    txnParam.udf10 = ""

设置从服务器获取的哈希值

txnParam.hashValue = serverHashValue

呈现 PlugNPlay 视图控制器

PlugNPlay.presentPaymentViewController(withTxnParams: txnParam, on: self) { (response, error, extraParam) in
        print(response as Any)
        print(error as Any)
    }

后端:PHP(Laravel框架)

得到sUrl is invalid的原因是破折号(-)在url.

http://staging.myserver.com/payu-success.php.

一旦我像这样设置 url...

http://staging.myserver.com/payu_success.php

它工作得很好。

但令人惊讶的是 http://staging.myserver.com/payu-success.php url(带破折号)在 ANDROID 平台上运行良好。 :-O

但在 iOS 中它给了我错误 sUrl

PayU money没有记录这个东西

所以最终有趣的是,经过数小时的反复试验终于知道

不要在 URL 中使用 DASH,而在 IOS:D

中集成 PAYU MONEY

希望对其他人有所帮助