razorpay / razorpay-cordova

Cordova wrapper around Razorpay's Android and iOS SDKs
https://www.npmjs.com/package/com.razorpay.cordova
51 stars 32 forks source link

App crash when Razorpay.open() is called. #173

Open abhijeet21sankalp opened 1 month ago

abhijeet21sankalp commented 1 month ago

com.razorpay.cordova plugin is not compatible for SDK version 34

I have implemented the plugin and update the android-targetSdkVersion- 33 to 34, android-compileSdkVersion 33 to 34
android-buildToolsVersion33 to 34 in config.xml file , when razorpay.open() method is called. razor pay application's Screen is invoked, but App is going to crash on Android 13+.

it is working for android-targetSdkVersion- 33

I've installed "com.razorpay.cordova": "github:razorpay/razorpay-cordova" this plugin

I've following code implemented in ionic V6 & installed Cordova Android Platform Version 12.0.1 =>

initializeRazorPayPayment(resData) { let razorPayReqData = res.PaymentRequestModel; var options = { description: razorPayReqData.Description, image: razorPayReqData.Image, order_id: razorPayReqData.OrderId, currency: razorPayReqData.Currency, key: razorPayReqData.Key, prefill: { contact: razorPayReqData.PhoneNumber, email: razorPayReqData.Email == null ? '' : razorPayReqData.Email }, handler: function (response) { }, amount: razorPayReqData.Amount, name: razorPayReqData.CompayName, theme: { color: '#065bef' }, retry: { enabled: true, max_count: 4 }, animation: true, send_sms_hash: true, remember_customer: true, subscription_card_change: true, modal: { confirm_close: true, handleback: true, ondismiss: function () { } } } let successCallback = (success) => { } let cancelCallback = (error) => { this.isConfirmReqSent = false; this.confirmOrderReq = false; let obj = { razorpay_order_id: options.order_id, payment_id: null, description: error.description, code: error.code, reason: null, source: null, step: null, }'; } let failureCallback = (error) => { let data = error.response.error; let obj = { razorpay_order_id: data.metadata.order_id, payment_id: data.metadata.payment_id, description: data.description, code: data.code, reason: data.reason, source: data.source, step: data.step, }; } RazorpayCheckout.on('payment.success', successCallback); RazorpayCheckout.on('payment.cancel', cancelCallback); RazorpayCheckout.on('payment.failed', failureCallback); RazorpayCheckout.open(options); }

vivekshindhe commented 1 month ago

@abhijeet21sankalp Unable to reproduce the issue. Can you share the crash error logs? You should be able to find those in Android Studio logcat.

abhijeet21sankalp commented 1 month ago

thank you for respond

when razorpay landing page is invoked then hide after 2 second & its stuck on white screen. note-I've uploaded Screenshot Screenshot_20240807_151833_Gainmore Screenshot_20240807_151933_Gainmore (1) Screenshot_20240807_151933_Gainmore

@abhijeet21sankalp Unable to reproduce the issue. Can you share the crash error logs? You should be able to find those in Android Studio logcat.

vivekshindhe commented 1 month ago

@abhijeet21sankalp , we can't find much with just the screenshots. Logs would be much more helpful.

abhijeet21sankalp commented 1 month ago

@abhijeet21sankalp , we can't find much with just the screenshots. Logs would be much more helpful.

Our application is Hybrid application in IONIC Cordova. we are not Building our application in android studio.

vivekshindhe commented 1 month ago

That's fine. Even if it's not being bulit in Android Studio, when connected to the device, during development builds you can see the logs in Android Studio logcat for this application.

vivekshindhe commented 1 month ago

@abhijeet21sankalp To reduce the TAT would request you to create a ticket in Razorpay Dashboard. You can put this Github Issue link in the ticket. This would help fast track the issue and resolution.