Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to under solve this? {"errorCode": "5019", "errorMsg": "Invalid Hash."} #44

Open
jogi-gaurang opened this issue Sep 3, 2022 · 1 comment

Comments

@jogi-gaurang
Copy link

jogi-gaurang commented Sep 3, 2022

var txnid = this.transactionId();
		var payUPaymentParams = {
			key: this.state.key,
			transactionId: txnid,
			amount: Data[0].price,
			productInfo: Data[0].title,
			firstName: this.User.data.first_name + this.User.data.last_name,
			email: this.User.data.email,
			phone: this.User.data.mobile_no,
			ios_surl: 'https://payu.herokuapp.com/success',
			ios_furl: 'https://payu.herokuapp.com/failure',
			android_surl: 'https://payu.herokuapp.com/success',
			android_furl: 'https://payu.herokuapp.com/failure',
			environment: '1',
			userCredential: this.state.key + ':' + this.User.data.id,
			additionalParam: {}
		}
		
		var payUCheckoutProConfig = {
			primaryColor: colors.primary,
			secondaryColor: '',
			merchantName: "sdk",
			merchantLogo: 'logo.png',
			showExitConfirmationOnCheckoutScreen: true,
			showExitConfirmationOnPaymentScreen: true,
			cartDetails: [],
			paymentModesOrder: [],
			surePayCount: 1,
			merchantResponseTimeout: 1000,
			autoSelectOtp: false,
			autoApprove: false,
			merchantSMSPermission: false,
			showCbToolbar: false,
		}
		
		return {
			payUPaymentParams: payUPaymentParams,
			payUCheckoutProConfig: payUCheckoutProConfig
		};
		
	generateHash(e) {
		var hashValue = e.hashString;
		var result = { [e.hashName]: hashValue };
		console.log(result)
		PayUBizSdk.hashGenerated(result);
	}

can any one help me how to understand this error what hash need

i try somthing like this also

generateHash(e) {
		var hashValue = sha512(e.hashString);
		var result = { [e.hashName]: hashValue };
		console.log(result)
		PayUBizSdk.hashGenerated(result);
}

generateHash(e) {
		var hashValue = sha512(e.hashString + this.state.merchantSalt);
		var result = { [e.hashName]: hashValue };
		console.log(result)
		PayUBizSdk.hashGenerated(result);
}

@KarthiDreamr
Copy link

KarthiDreamr commented Feb 11, 2024

Salt and merchant key value in documentation and example is wrong

Here's my blog of the problem being resolved:

https://dev.to/karthidreamer/payu-integration-in-react-native-with-checkoutpro-sdk-l13

PayU Officials please do needful to update payu-non-seamless-react package and salt in docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants