Closed Sneha1231 closed 3 years ago
Hi @Sneha1231,
Please try PayU.getHash function and try to match that hash code with your server hash code. If it's not matching then check how you are generating hashcode in your server end.
@sanmish16 I checked that and it is same as the server one
@Sneha1231 please share the data you are passing with PayU.startPayment except key and salt
@sanmish16 {"amount": "200", "email": "", "failedUrl": "", "firstName": "", "hash": "", "isSandbox": true, "key": "", "merchantId": "", "phone": "", "productName": "*", "successUrl": "*", "txnId": ""} , These are the parameters we passing to startPayment. I couldn't share the values since it is confidential.
@Sneha1231 to generate hash in server u have to pass all the data in the same order including udf1 to udf10 (is not available pass it as the empty string). You can use the below function
function payUHash(payUData){
const hashString = ${payUData.key}|${payUData.txnId}|${payUData.amount}|${payUData.productName}|${payUData.firstName}|${payUData.email}|${payUData.udf1}|${payUData.udf2}|${payUData.udf3}|${payUData.udf4}|${payUData.udf5}|${payUData.udf6}|${payUData.udf7}|${payUData.udf8}|${payUData.udf9}|${payUData.udf10}|${payUData.salt}
;
//In case you are not passing udf values then set it as empty string return sha512(hashString); }
@sanmish16 We are using the same format and it is working fine for android. Only facing the issue in iOS. Is there any additional set up we need to do apart from "pod install" command. My react-native version is 0.62.2 and iOS 14.2
Add the following line in your Podfile and run pod install
pod 'react-native-payu', :path => '../node_modules/react-native-payu'` pod 'PayUmoney_PnP'
I guess pod 'PayUmoney_PnP' is missing
Add the following line in your Podfile and run pod install
pod 'react-native-payu', :path => '../node_modules/react-native-payu'` pod 'PayUmoney_PnP'
I guess pod 'PayUmoney_PnP' is missing
@sanmish16 Are there steps for version <= 0.59 ?. Mine is .62. I tried adding the same and ran pod install. still getting the issue.
pod 'PayUmoney_PnP' you have to add manually in your podfile
pod 'PayUmoney_PnP' you have to add manually in your podfile
@sanmish16 Should I be mentioning any path for this
no need to mention any path just add it like
pod 'PayUmoney_PnP'
no need to mention any path just add it like
pod 'PayUmoney_PnP'
Added and executed pod install. Still getting the issue
After doing pod install, clean & build your project. If it still not working then please try with sample data provided with library and let me know if it works.
@sanmish16 Looks like issue is with the email id we are using. For testing purpose we are reusing the existing mail id by appending "+" followed by random numbers(eg: "sneha1231+1@gmail.com"). Issue is happening with these accounts. The mail id without these alternations are working fine. But in android this is not making any issue and we are allowed to do payment. Could you please provide some insight on this.
@Sneha1231 I guess if the email id is not valid then it should not work in both android & iOS. But like you said it's working in android then I guess it's because of some extra validation happening in iOS from payU end.
I guess your issue is resolved. SO, I am closing it.
Hi, While stating payment in iOS getting hash value mismatch alert. It is working fine in android. I am creating hash values at server side and passing the same to the startPayment.