Payu支付错误"Some error occurred, Try again!"
Payu payement error "Some error occurred, Try again!"
我已经通过官方文档将 payu 集成到我的 android 应用程序中
https://www.payumoney.com/dev-guide/mobilecheckout/android.html#prereq .
我面临的问题是我的代码与测试凭据完美配合,但当我使用我想要集成到应用程序中的真实账户的凭据时失败。
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 支持团队来激活帐户,之后代码就可以正常工作了。我的雇主说他已经激活了真实账户,所以我不知道这里有什么问题。
这里没有其他类似我的问题,最接近的问题在这里 PayuMoney Integration in Android : Some error occured! Try again 并且没有得到答复。
setIsDebug(boolean)
使用直播支付需要在该方法中传入false参数,在直播模式下测试时传入true。
我已将其设置为 false 并使用了 Real Merchant id、salt 和 key,它起作用了,没有错误。
希望这对某人有所帮助。
我觉得你的问题在行
'PayUmoneySdkInitilizer.startPaymentActivityForResult(MyActivity.this, paymentParam);'.
官方文档说你必须使用
开始交易
'PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam,this, R.style.AppTheme_default, false);'
调试 PayUmoneyActivity
ErrorResponse 包含实际错误。
可能是哈希不匹配或错误的密钥。
@override
public void onFailureResponse(ErrorResponse response, String tag) {
mProgressDialog.dismiss();
Toast.makeText(context, "Some error occured",
Toast.LENGTH_SHORT).show();
finish();
}
PayUmoneyActivity 中的此方法不显示来自 errorresponse 的错误。只是一般错误。这很难调试。
我已经通过官方文档将 payu 集成到我的 android 应用程序中 https://www.payumoney.com/dev-guide/mobilecheckout/android.html#prereq .
我面临的问题是我的代码与测试凭据完美配合,但当我使用我想要集成到应用程序中的真实账户的凭据时失败。
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 支持团队来激活帐户,之后代码就可以正常工作了。我的雇主说他已经激活了真实账户,所以我不知道这里有什么问题。
这里没有其他类似我的问题,最接近的问题在这里 PayuMoney Integration in Android : Some error occured! Try again 并且没有得到答复。
setIsDebug(boolean)
使用直播支付需要在该方法中传入false参数,在直播模式下测试时传入true。
我已将其设置为 false 并使用了 Real Merchant id、salt 和 key,它起作用了,没有错误。
希望这对某人有所帮助。
我觉得你的问题在行
'PayUmoneySdkInitilizer.startPaymentActivityForResult(MyActivity.this, paymentParam);'.
官方文档说你必须使用
开始交易'PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam,this, R.style.AppTheme_default, false);'
调试 PayUmoneyActivity ErrorResponse 包含实际错误。 可能是哈希不匹配或错误的密钥。
@override
public void onFailureResponse(ErrorResponse response, String tag) {
mProgressDialog.dismiss();
Toast.makeText(context, "Some error occured",
Toast.LENGTH_SHORT).show();
finish();
}
PayUmoneyActivity 中的此方法不显示来自 errorresponse 的错误。只是一般错误。这很难调试。