问题
I am trying to integrate PayUMoney payment gateway in my android app, I am not sure what is happening with it. Even If I have generated hash from server and followed exactly the same procedure provided on PayUMoney website
I am getting TOAST message some error occured. Event landing page is not loaded, as soon as I move from checkout page to payU spinner rotates a while and after that I get TOAST message and I land back to my checkout page.
PayUMoney Code
String serverCalculatedHash = getHashFromServer();
PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();
builder.setAmount(Double.parseDouble(paymentAmount))
.setTxnId(transactionId)
.setPhone(phoneNumber)
.setProductName(productName)
.setFirstName(firstName)
.setEmail(emailId)
.setsUrl("https://www.payumoney.com/mobileapp/payumoney/success.php")
.setfUrl("https://www.payumoney.com/mobileapp/payumoney/failure.php")
.setUdf1(udf1)
.setUdf2(udf2)
.setUdf3(udf3)
.setUdf4(udf4)
.setUdf5(udf5)
.setUdf6("")
.setUdf7("")
.setUdf8("")
.setUdf9("")
.setUdf10("")
.setIsDebug(true)
.setKey(merchentKey)
.setMerchantId(merchentId);
PayUmoneySdkInitializer.PaymentParam paymentParam = builder.build();
paymentParam.setMerchantHash(serverCalculatedHash);
PayUmoneyFlowManager.startPayUMoneyFlow(paymentParam, CheckoutActivity.this, R.style.AppTheme_default, true);
Console Log
09-16 21:07:21.488 20712-20712/in.co.sd.app D/hash: cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: key - mJ5aor0Z 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: merchantId - 5710201 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: txnid - 1505576241249 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: amount - 10.0 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: SURL - https://www.payumoney.com/mobileapp/payumoney/success.php 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: FURL - https://www.payumoney.com/mobileapp/payumoney/failure.php 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: productInfo - product name 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: email - xyz@gmail.com 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: firstName - MyName 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: phone - 9999014250 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf1 - udf1 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf2 - udf2 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf3 - udf3 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf4 - udf4 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf5 - udf5 09-16 21:07:21.489 20712-20712/in.co.sd.app D/param :: udf6 - 09-16 21:07:21.490 20712-20712/in.co.sd.app D/param :: udf7 - 09-16 21:07:21.490 20712-20712/in.co.sd.app D/param :: udf8 - 09-16 21:07:21.490 20712-20712/in.co.sd.app D/param :: udf9 - 09-16 21:07:21.490 20712-20712/in.co.sd.app D/param :: udf10 - 09-16 21:07:21.526 20712-20712/in.co.sd.app I/WebViewFactory: Loading com.google.android.webview version 60.0.3112.116 (code 311211650) 09-16 21:07:21.569 20712-20712/in.co.sd.app I/art: Rejecting re-init on previously-failed class java.lang.Class 09-16 21:07:21.569 20712-20712/in.co.sd.app I/art: Rejecting re-init on previously-failed class java.lang.Class 09-16 21:07:21.572 20712-20712/in.co.sd.app I/art: Rejecting re-init on previously-failed class java.lang.Class 09-16 21:07:21.572 20712-20712/in.co.sd.app I/art: Rejecting re-init on previously-failed class java.lang.Class 09-16 21:07:21.579 20712-20712/in.co.sd.app I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 6391-6392) 09-16 21:07:21.596 20712-20712/in.co.sd.app I/chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0 09-16 21:07:21.596 20712-20712/in.co.sd.app I/cr_LibraryLoader: Expected native library version number "60.0.3112.116", actual native library version number "60.0.3112.116" 09-16 21:07:21.622 20712-20712/in.co.sd.app I/cr_BrowserStartup: Initializing chromium process, singleProcess=true 09-16 21:07:21.858 20712-20712/in.co.sd.app D/EgretLoader: EgretLoader(Context context) 09-16 21:07:21.858 20712-20712/in.co.sd.app D/EgretLoader: The context is not activity 09-16 21:07:21.921 20712-20712/in.co.sd.app D/payumoneySDK - login: {"event_id":"1","device_id":"739bbf12ec1be70e","uuid":"0b500414-dff6-4f21-bfdf-aed66a78d150","d_ua":"Mozilla/5.0 (Linux; Android 6.0.1; Redmi Note 3 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3102.110 Mobile Safari/537.36","u_lat":"","u_lon":"","u_acu":"","app_id":"in.co.sd.app","package_name":"in.co.sd.app","app_version_name":"1.0","app_version_code":"1","d_locale":"en","d_ccid":"in","d_lang":"English","d_name":"Xiaomi","d_model":"Redmi Note 3","d_os":"Android","d_osv":"6.0.1","sdk_version":"7","sdk_build":"7.0.0","d_mfg":"Xiaomi","d_nw_type":"WIFI","d_ss":"4","d_scrn_sz":"5.7437176737064215","d_scrn_res":"1080 * 1920","m_id":"5773251","m_key":"mJ5aor0Z","ip":"10.107.124.9","app_name":"Service Service","d_ts":"1505576241915","env":"DEBUG"} 09-16 21:07:22.076 20712-20712/in.co.sd.app I/Timeline: Timeline: Activity_launch_request time:58596890 09-16 21:07:22.183 20712-20712/in.co.sd.app V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@f0846b7 09-16 21:07:22.183 20712-20712/in.co.sd.app V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@49c0e24 09-16 21:07:22.216 20712-20712/in.co.sd.app D/ActivityThreadInjector: clearCachedDrawables. 09-16 21:07:22.255 20712-11058/in.co.sd.app W/System: Ignoring header UserSessionCookiePageUrl because its value was null. 09-16 21:07:23.193 20712-20718/in.co.sd.app W/art: Suspending all threads took: 5.983ms 09-16 21:07:23.195 20712-20712/in.co.sd.app I/Difference: [ main: SdkSession.java: 365: onResponse() ] --> URL=/payment/app/v1/addPaymentTime=978 09-16 21:07:23.325 20712-20784/in.co.sd.app V/RenderScript: 0x557e7de550 Launching thread(s), CPUs 6
回答1:
I think I am late to answer, but still, I faced similar issue, Key and Salt are not correct. you need to contact payUMoney support, they will provide you new Key,, Salt and MID. Also they will provide you php code to generate serverHash,
If you want to test your Key and salt, download this sample app(https://github.com/payu-intrepos/payumoney-new-sample-app) from payumoney and configure AppEnvironment class with your parameters, hope this helps!
来源:https://stackoverflow.com/questions/46255763/android-payumoney-integration-error-some-error-occured