Payu付款错误“发生了一些错误,请重试!" [英] Payu payement error "Some error occurred, Try again!"

查看:303
本文介绍了Payu付款错误“发生了一些错误,请重试!"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已通过位于以下位置的官方文档将payu集成到了我的android应用中 https://www.payumoney.com/dev-guide/mobilecheckout/android.html#prereq .

I have integrated payu into my android app through official docs at https://www.payumoney.com/dev-guide/mobilecheckout/android.html#prereq .

我面临的问题是我的代码可以与测试凭据完美配合,而当我使用要集成到应用程序中的真实账户的凭据时失败.

The problem i'm facing is that my code works perfectly with test credentials, and fails when i use credentials of my live account that i want to integrate in the app.

   public void makePayment(View view) {
    String phone = "8882434664";
    String productName = "product_name";
    String firstName = "piyush";
    String txnId = "0nf7" + System.currentTimeMillis();
    String email = "piyush.jain@payu.in";
    String sUrl = "https://test.payumoney.com/mobileapp/payumoney/success.php";
    String fUrl = "https://test.payumoney.com/mobileapp/payumoney/failure.php";
    String udf1 = "";
    String udf2 = "";
    String udf3 = "";
    String udf4 = "";
    String udf5 = "";
    boolean isDebug = true;

    String key = "2fcU3pmI";
    String merchantId = "4947182";// These credentials are from https://test.payumoney.com/ 
    String salt = "BxA24L2F7Z";   //  THIS WORKS

  /*  String key = "yX8OvWy1";     //These credentials are from https://www.payumoney.com/ 
    String merchantId = "5826688"; //THIS DOESN'T WORK
    String salt = "0vciMJBbaa";    //ERROR: "some error occurred, Try again"
  */

    PayUmoneySdkInitilizer.PaymentParam.Builder builder = new PayUmoneySdkInitilizer.PaymentParam.Builder();


    builder.setAmount(getAmount())
            .setTnxId(txnId)
            .setPhone(phone)
            .setProductName(productName)
            .setFirstName(firstName)
            .setEmail(email)
            .setsUrl(sUrl)
            .setfUrl(fUrl)
            .setUdf1(udf1)
            .setUdf2(udf2)
            .setUdf3(udf3)
            .setUdf4(udf4)
            .setUdf5(udf5)
            .setIsDebug(isDebug) //Also can someone clarify if this should be true/false for live mode
            .setKey(key)
            .setMerchantId(merchantId);

    PayUmoneySdkInitilizer.PaymentParam paymentParam = builder.build();


    String hash = hashCal(key + "|" + txnId + "|" + getAmount() + "|" + productName + "|"
            + firstName + "|" + email + "|" + udf1 + "|" + udf2 + "|" + udf3 + "|" + udf4 + "|" + udf5 + "|" + salt);
    Log.d("app_activity123", hash);
    paymentParam.setMerchantHash(hash);

    PayUmoneySdkInitilizer.startPaymentActivityForResult(MyActivity.this, paymentParam);

}

其他信息:测试凭据最初不起作用.我必须联系payu支持团队来激活该帐户,然后该代码才能正常运行.我的雇主说他已经激活了真实账户,所以我不知道这是什么问题.

Extra Info: Test credentials weren't working initially. I had to contact the payu support team to activate the account after which the code was working fine. My employer said he has activated the live account so i don't know what is the issue here.

这里没有其他问题,最接近的问题是

There are no other issues like mine here, the closest one is here PayuMoney Integration in Android : Some error occured! Try again and it is unanswered.

推荐答案

setIsDebug(boolean),您需要在此方法中传递false作为参数以使用实时付款,而在实时模式下进行测试时则为true. 我将其设置为false并使用了Real Merchant id,salt和key,它可以正常工作,没有错误. 希望这对某人有帮助.

setIsDebug(boolean) you need to pass false as parameter in this method to use live payment and true when testing in live mode. I've set it to false and used Real Merchant id,salt and key and it worked, no errors. Hope this helps someone.

这篇关于Payu付款错误“发生了一些错误,请重试!"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆