Closed cybermaskssoftware closed 4 years ago
java.lang.NoSuchMethodError: No virtual method setAmount(D)Lcom/payumoney/core/PayUmoneySdkInitializer$PaymentParam$Builder; in class Lcom/payumoney/core/PayUmoneySdkInitializer$PaymentParam$Builder; or its super classes (declaration of 'com.payumoney.core.PayUmoneySdkInitializer$PaymentParam$Builder' appears in /data/app/com.paymenttest-2/base.apk:classes2.dex) at superinfotech.suraj.reactnativepayumoney.PayActivity.makePayment(PayActivity.java:73)
when i push options into PayuMoney.pay go this error , please tell me how do i resolve this , i am stuck here, last two weeks , i try many of ways 1) convert amount into string 2) convert amount into amount.toFixed(2) nothing happen if i try as a string it shows "java.lang.String cannot be cast to java.lang.Double" if i use amount as amount.toFixed(2) "java.lang.Doubecannot be cast to java.lang.String" What i used here fro react native
let amount = 99.9; let txid = new Date().getTime()+""; let productId = "product101"; let name = "asdf"; let email = "hello@world.com"; let phone = "1231231231"; let surl = "https://www.example.com/payu-validate.php"; //can be diffrennt for Succes let furl = "https://www.example.com/payu-validate.php"; //can be diffrennt for Failed let id = this.state.PayU_MID; //Your Merchant ID here let key = this.state.PayU_Key; //Your Key Here let sandbox = true; //Make sure to set false on production or you will get error fetch('http://192.168.1.102/coreapi/payu-hash.php', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ key: key, txnid: txid, amount: amount.toString(), productinfo: productId, firstname: name, email: email, phone: this.state.phone }), }) .then((response) => response.text()) .then((hash) => { let options = ''; let hashs = JSON.parse(hash); try { options = { amount: amount.toString(), txid: txid, productId: productId, name: name, email: email, phone: phone, id: id.toString(), key: key, surl: surl, furl: furl, sandbox: sandbox, hash: hashs.hash };
please check above code , hope your replay as soon as possible