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

OnCheckoutScreen method Payment Android App crashing #63

Open
codeweight opened this issue Mar 16, 2024 · 3 comments
Open

OnCheckoutScreen method Payment Android App crashing #63

codeweight opened this issue Mar 16, 2024 · 3 comments

Comments

@codeweight
Copy link

codeweight commented Mar 16, 2024

App is crashing after successfully generating hashes PayUBizSdk.onCheckoutScreen method. The payment screen is open after sometime its get crashed.

Below using the dependent packages:
payu-non-seam-less-react": "^3.0.7.

And using expo react native bare workflow to run on Android platform.
expo": "^49.0.0
react-native": "0.72.10

Please suggest I have handled this using NativeEventEmitter also used with PayUBizSdk import in useEffect hook.

Demonstrations:
`
import { NativeEventEmitter } from 'react-native';
// import PayUBizSdk from 'payu-non-seam-less-react';
// const { PayUBizSdk } = NativeModules;
React.useEffect(() => {
let paymentSuccess,paymentFailure,paymentCancel,error,generateHash;
if (Platform.OS === 'android') {
const eventEmitter = new NativeEventEmitter(PayUBizSdk);
paymentSuccess = eventEmitter.addListener('onPaymentSuccess', onPaymentSuccess);
paymentFailure = eventEmitter.addListener('onPaymentFailure', onPaymentFailure);
paymentCancel = eventEmitter.addListener('onPaymentCancel', onPaymentCancel);
error = eventEmitter.addListener('onError', onError);
generateHash = eventEmitter.addListener('generateHash', ongenerateHash);
}
return (() => {
if (Platform.OS === 'android') {
return () => {
paymentSuccess.remove();
paymentFailure.remove();
paymentCancel.remove();
error.remove();
generateHash.remove();
}
}
});
}, [])

async function payment(payUPaymentParams,payUCheckoutProConfig) {
var paymentObject = {
payUPaymentParams: payUPaymentParams,
payUCheckoutProConfig: payUCheckoutProConfig
}
PayUBizSdk.openCheckoutScreen(paymentObject); // in this line its failed and app crashes after opening payment screen
}
`

In the Android Studio Logcat it shows the error:
java.io.FileNotFoundException: can't read keyset; the pref value androidx_security_crypto_encrypted_prefs_value_keyset does not exist

@codeweight
Copy link
Author

@ShubhGar @shahfaizalc Can you please suggest any reference on the given issue.

@shahfaizalc
Copy link
Contributor

@codeweight we are checking on it

@codeweight
Copy link
Author

Hi @shahfaizalc, any solutions or fixes on the given problem.

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