payu-intrepos / payu-non-seamless-react

Non-Seamless SDK for React Native
5 stars 9 forks source link

OnCheckoutScreen method Payment Android App crashing #63

Open codeweight opened 5 months ago

codeweight commented 5 months ago

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 commented 5 months ago

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

shahfaizalc commented 5 months ago

@codeweight we are checking on it

codeweight commented 5 months ago

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