synclovisdevs / react-native-payu

PayUMoney Library for react-native by using native SDK
MIT License
2 stars 2 forks source link

Key is not valid #3

Open swaroopaillinda opened 3 years ago

swaroopaillinda commented 3 years ago

hii I am using this module in my react native application here is my code:

` const payData = { amount: '1.0',//data.amount.toString(), txnId: data.txnid, productName: data.productinfo, firstName: data.firstname ? data.firstName : "Sample", email: data.email, phone: data.phone, merchantId: 'mykey', key: data.key, successUrl: data.surl,//'https://www.payumoney.com/mobileapp/payumoney/success.php', failedUrl: data.furl,//'https://www.payumoney.com/mobileapp/payumoney/failure.php', //isDsebug: false, // isSandbox: false, hash:data.hash,

     };
     console.log("dnfldk",typeof data.key)
    Payumoney(payData).then((data) => {

        console.log("Success, code",data)
     }).catch((e) => {

         console.log("Failed, code",e)
     })`

this is my code In this i am getting the key is invalid error in iOS and some error occurred in android the same key is used for web also its working over there how to solve this issue?

sanmish16 commented 3 years ago

Hi @swaroopaillinda , please uncomment isSandbox & if it's in testing mode pass value true & if it's in production, please pass value false.

swaroopaillinda commented 3 years ago

hi @sanmish16 i have done that but getting the same issue key is invalid it is going to catch function

sanmish16 commented 3 years ago

From PayU, you will get three things, Merchant ID(You will get it in Profile), Merchant Key(You will get in Settings) & Merchant Salt(You will get in Settings), please make sure you are using right key at right place.

Also, please confirm if you are trying for testing or production.

swaroopaillinda commented 3 years ago

@sanmish16 in test mode its working fine the hash is generated in server side only and here is code from server side var pd = req.body; pd.txnid=PAYU${Date.now()}` var hashString = process.env.PAYU_KEY // Merchant Key

in prodution only its not working