简体   繁体   English

在android中集成payU Money时成功网址和失败网址是什么?

[英]What is success url & failure url while integrating payU Money in android?

Here is my some activity code, what will be the surl & furl?这是我的一些活动代码,surl 和 furl 是什么? could anyone please help me?有人可以帮我吗?

Thanks in advance :)提前致谢:)

 Map<String, String> mapParams = new HashMap<>();

            mapParams.put("key", mMerchantKey);
            mapParams.put("txnid", mTXNId);
            mapParams.put("amount", String.valueOf(mAmount));
            mapParams.put("productinfo", mProductInfo);
            mapParams.put("firstname", mFirstName);
            mapParams.put("email", mEmailId);
            mapParams.put("phone", mPhone);
            mapParams.put("surl", mSuccessUrl);
            mapParams.put("furl", mFailedUrl);
            mapParams.put("hash", mHash);
            mapParams.put("service_provider", mServiceProvider);

             System.out.println("mapParams=="+mapParams);

            webViewClientPost(webView, mAction, mapParams.entrySet());

The following diagram explains how the customer makes the payment and how the process flows:下图解释了客户如何付款以及流程如何:

在此处输入图片说明

Step 1: The consumer selects the product on your website and clicks on “Pay Now” button.第 1 步:消费者在您的网站上选择产品并点击“立即付款”按钮。

Step 2: The consumer is then taken from your website to the transaction page of www.payumoney.com where in all the payment related details are entered by the consumer.第 2 步:然后将消费者从您的网站带到 www.payumoney.com 的交易页面,在该页面中,消费者输入所有与支付相关的详细信息。

Step 3: Payumoney.com.com redirects the consumer to Visa, MasterCard or the relevant bank for the next level of authorization.第 3 步: Payumoney.com.com 将消费者重定向到 Visa、MasterCard 或相关银行进行下一级授权。

Step 4: The Bank/Visa/MasterCard authorizes and confirms the transaction.第四步:银行/Visa/万事达卡授权并确认交易。

Step 5: The consumer is sent back to PayUMoney.步骤 5:消费者被送回 PayUMoney。

Step 6: PayUMoney sends the consumer back to your website along with the transaction status.第 6 步: PayUMoney 将消费者连同交易状态一起发送回您的网站。

The surl and furl comes into picture in the last step of the above flow. surlfurl在上述流程的最后一步出现。 It is just the Success and Failure page URL, where you wish to take your user on success and failure cases.它只是成功和失败页面 URL,您希望在其中引导用户了解成功和失败案例。

For example if you have a Thank You page where you want the user to go after successful transaction then you pass the URL of that page as surl .例如,如果您有一个感谢页面,您希望用户在成功交易后访问该页面,那么您可以将该页面的 URL 作为surl

Similarly, if you have any error page where you want to take user on failure then pass that URL as furl .同样,如果您有任何错误页面,您希望用户失败,则将该 URL 作为furl传递。

Source: PayUMoney Integration in android.来源: Android 中的 PayUMoney 集成。

payumoney post user and transaction data to these urls . payumoney 将用户和交易数据发布到这些urls all success transaction goes to surl and all failed transaction data go to furl as a post request.所有成功的交易都转到 surl,所有失败的交易数据都作为 post 请求转到 furl。

you can save these information for your application logic.您可以为您的应用程序逻辑保存这些信息。

here is the link which shows POST request. 是显示 POST 请求的链接。

Success & Failure URI are a redirection link.成功与失败 URI 是一个重定向链接。 Basically, when the transaction is successful, then it will redirect to success URI else it will redirect to failure URI.基本上,当事务成功时,它将重定向到成功 URI,否则它将重定向到失败 URI。

In PayuMoney builder variable you need to set these parameters where success an failure URL also mention.在 PayuMoney 构建器变量中,您需要设置这些参数,其中还提到成功和失败 URL。

  builder.setAmount(amount)                          // Payment amount
                .setTxnId(txnid)                     // Transaction ID
                .setPhone(phone)                   // User Phone number
                .setProductName(prodname)                   // Product Name or description
                .setFirstName(firstname)                              // User First name
                .setEmail(email)              // User Email ID
                .setsUrl("https://www.payumoney.com/mobileapp/payumoney/success.php")     // Success URL (surl)
                .setfUrl("https://www.payumoney.com/mobileapp/payumoney/failure.php")     //Failure URL (furl)
                .setUdf1("")
                .setUdf2("")
                .setUdf3("")
                .setUdf4("")
                .setUdf5("")
                .setUdf6("")
                .setUdf7("")
                .setUdf8("")
                .setUdf9("")
                .setUdf10("")
                .setIsDebug(true)                              // Integration environment - true (Debug)/ false(Production)
                .setKey(merchantkey)                        // Merchant key
                .setMerchantId(merchantId);

You can find complete Downloadable tutorial with working app in this link .您可以在此链接中找到带有工作应用程序的完整可下载教程 PayUmoney has very simple integration process. PayUmoney 的集成过程非常简单。 Steps are as below-步骤如下-

Step 1 get merchant key and salt第 1 步获取商户密钥和盐

Step 2 upload server side PHP files for checksum HASH Step 2上传服务器端PHP文件进行校验和HASH

Step 3 add dependency Step 3添加依赖

Step 4 get checksum hash第 4 步获取校验和哈希

Step 5 start transactions步骤 5开始交易

When making a payment using the PayUmoney Android SDK gives two types of payment response:使用 PayUmoney Android SDK 进行付款时,会提供两种类型的付款响应:

1. A client-side response in the callback function 1.回调函数中的客户端响应

2. A server to server callback on the Webhook, if set from the PayUmoney dashboard. 2. Webhook 上的服务器到服务器回调(如果从 PayUmoney 仪表板设置)。

  1. Client side response handling : To know when the payment has completed, override the onActivityResult in your activity as exemplified in the sample code below客户端响应处理:要了解付款何时完成,请覆盖您活动中的 onActivityResult,如下面的示例代码所示
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    // Result Code is -1 send from Payumoney activity
    Log.d("MainActivity", "request code " + requestCode + " resultcode " + resultCode);
    if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data != null) {
        TransactionResponse transactionResponse = data.getParcelableExtra( PayUmoneyFlowManager.INTENT_EXTRA_TRANSACTION_RESPONSE );

        if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {

            if(transactionResponse.getTransactionStatus().equals( TransactionResponse.TransactionStatus.SUCCESSFUL )){
                //Success Transaction
            } else{
                //Failure Transaction
            }

            // Response from Payumoney
            String payuResponse = transactionResponse.getPayuResponse();

            // Response from SURl and FURL
            String merchantResponse = transactionResponse.getTransactionDetails();
        }  else if (resultModel != null && resultModel.getError() != null) {
            Log.d(TAG, "Error response : " + resultModel.getError().getTransactionResponse());
        } else {
            Log.d(TAG, "Both objects are null!");
        }
    }
}
  1. Server side response handling:服务器端响应处理:

At your service to handle the payu success and failure responses.随时为您服务,处理支付成功和失败的响应。

For Example (REST):例如(REST):

SURL: https://hostname/REST/service/payusucess网址: https://hostname/REST/service/payusucess

FURL: https://hostname/REST/service/payufailure FURL: https://hostname/REST/service/payufailure

When a payment was done, it will POST a response to your server side corresponding(success/failure).付款完成后,它将向您的服务器端相应地发布响应(成功/失败)。 Your have to get the response and handle it in your REST service and display the response page.您必须获得响应并在您的 REST 服务中处理它并显示响应页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM