razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
107 stars 147 forks source link

Not getting any callback #167

Open akshayarhata opened 3 years ago

akshayarhata commented 3 years ago

Amount gets deducted from customers account but app is not getting any callback on live environment. It happens 2 out of 10 times.

Flutter Version :

razorpay_flutter: ^1.2.2

below code is use while making the payment.

_razorpay = Razorpay(); _razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess); _razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError); _razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);

var options = { 'key': key, 'amount': amount * 100, 'name': name, 'order_id': orderId, 'prefill': {'contact': phoneNumber, 'email': emailId}, 'readOnly': {'contact': true, 'email': true}, };

try {
  _razorpay.open(options);
} catch (e) {
  print(e);
}
vivekshindhe commented 3 years ago

@akshayarhata Thanks for reaching out to us. Could you help us a bit more here? What platform is this happening on? Android or iOS? What payment flow does this happen on? UPI, Netbanking, Cards etc, and have you updated to the latest version of flutter?

akshayarhata commented 3 years ago

@vivekshindhe Hi, Thanks for your quick response. This is happening on android as of now our app supports only android platform. Mostly when customer tries on UPI and Cards.

This issue is occurs on version 1.2.5 as well

sumedht commented 3 years ago

@akshayarhata Okay, We will check at our side & get back to u. We are releasing our new SDK soon. If we are able to reproduce this issue, we will provide fix in that.

akshayarhata commented 3 years ago

@sumedht Thanks, Hope you able to reproduce it.

anas-aji-muhammed commented 3 years ago

The callback issue exists at some time only. It's hard to reproduce. Dev team please check into this. Try to test with lower network speed environments.

AnandASanthosh commented 3 years ago

Our development is stuck on this issue. app opens upi app->payment succeeds-> comes back's to app, but no call back for success

sumedht commented 3 years ago

@akshayarhata @AnAnD4T1 Not reproducible on multiple iterations. Will look into this but as a P1 issue & take it up in our next sprint. Will update here once it is fixed.

eastern-codemonk commented 3 years ago

Just to add some more perspective, this happened 12 out of 250 payments that happened today. This is the highest occurrence till date. Usually it happens 3-5 per 250 successful payments.

We have never seen in test mode, it only happens with real payment.

We have seen this happening flutter 1.20, 1.22, 2.0.

We have the highest occurrence with gpay payment, but it happens for all payment types. Occurring on Android and iOS almost at same rate.

This is very annoying for the customer as the app will take money and say nothing. We are thinking of abandoning this SKD and go via web view because of this issue.

sumedht commented 3 years ago

@eastern-codemonk can u share payment id's for which this issue happened? U can share it on sumedh.tambat@razorpay.com

eastern-codemonk commented 3 years ago

Few examples sent by email.

techtrix008 commented 2 years ago

@eastern-codemonk

I am stuck with the same issue. Any resolution achieved?

achmadrizkin commented 2 years ago

same error. any update?

AnandASanthosh commented 2 years ago

no problems now, working fine

eastern-codemonk commented 2 years ago

I ended up removing the SDK.

harshmsomani commented 2 years ago

Any update?

bhavik-multipl commented 2 years ago

We are facing the same issue, I do not see any update on this. Let me know if you need anything I can sent it through official email (if any critical information)

kailashyogeshwar85 commented 2 years ago

Is there a resolution @sumedht we are facing this issue intermittently as well.

tailoristic commented 2 years ago

Yes facing the same issue. With UPI payments.

rijazrasheed commented 1 year ago

My multiple projects are dependent on this issue. Please find a solution. This happens when customer chooses UPI option for payment. I think you need to enable support for UPI intent for this plugin.

Soorya-S commented 1 year ago

+1

techtrix008 commented 1 year ago

Switched to webhooks implementation from Razorpay in addition to the callback API of the package and there had been no issues since last 2 years.

Logic is to implement webhooks and on receiving of webhooks response check if Callback API was triggered and the transaction was captured from app or On the background once url webhook api is triggered again by Razorpay you will capture the transaction from there if it was not capture by callback api. So it's a asynchronous double check method if callback fails capture from webhook response as webhook never failed.

Thanks

On Fri, 21 Oct, 2022, 10:42 pm Soorya, @.***> wrote:

+1

— Reply to this email directly, view it on GitHub https://github.com/razorpay/razorpay-flutter/issues/167#issuecomment-1287232431, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJY7UINP4QNIJIXCTTSHPDWELFJXANCNFSM44QLED2Q . You are receiving this because you commented.Message ID: @.***>

Soorya-S commented 1 year ago

Switched to webhooks implementation from Razorpay in addition to the callback API of the package and there had been no issues since last 2 years. Logic is to implement webhooks and on receiving of webhooks response check if Callback API was triggered and the transaction was captured from app or On the background once url webhook api is triggered again by Razorpay you will capture the transaction from there if it was not capture by callback api. So it's a asynchronous double check method if callback fails capture from webhook response as webhook never failed. Thanks On Fri, 21 Oct, 2022, 10:42 pm Soorya, @.> wrote: +1 — Reply to this email directly, view it on GitHub <#167 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJY7UINP4QNIJIXCTTSHPDWELFJXANCNFSM44QLED2Q . You are receiving this because you commented.Message ID: @.>

Seems like a promising solution.

gupta-shrinath commented 1 year ago

@sumedht I have been facing a similar issue. The payments were working but from the last 2 days my client has reported that payments are successful and money deducted but no products are added to the users account. I tested the app in test mode they are working but in live mode no callback is called not even error. The app is for android and I have been using latest razorpay package.

Soorya-S commented 1 year ago

@gupta-shrinath I used the webhook to get rid of this issue. https://razorpay.com/docs/webhooks/

gupta-shrinath commented 1 year ago

Thanks @Soorya-S. It would be great if anyone from the razorpay team could look into this.

gupta-shrinath commented 1 year ago

@akshayarhata I managed to resolve this by instantiating the razorpay when calling the open method.

var options = {
'key': key,
'amount': amount * 100,
'name': name,
'order_id': orderId,
'prefill': {'contact': phoneNumber, 'email': emailId},
'readOnly': {'contact': true, 'email': true},
};

try {
_razorpay = Razorpay();
_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
_razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
_razorpay.open(options);
} catch (e) {
  print(e);
}
tryout3 commented 1 year ago

@sumedht We are facing the same issue. Is there any documentation for the implementation of webhooks?

tryout3 commented 1 year ago

@akshayarhata I managed to resolve this by instantiating the razorpay when calling the open method.

var options = {
'key': key,
'amount': amount * 100,
'name': name,
'order_id': orderId,
'prefill': {'contact': phoneNumber, 'email': emailId},
'readOnly': {'contact': true, 'email': true},
};

try {
_razorpay = Razorpay();
_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
_razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
_razorpay.open(options);
} catch (e) {
  print(e);
}

Is this method reliable compared to Webhooks?

techtrix008 commented 1 year ago

No it is not, we have intermittently faced this issue even after this approach, it is sporadic and depends upon device and os.

Only after implementing webhooks we have never faced this issue in last 2 years ever.

Thanks, Sourav

On Fri, Feb 3, 2023 at 11:12 AM Abhi Watpade @.***> wrote:

@akshayarhata https://github.com/akshayarhata I managed to resolve this by instantiating the razorpay when calling the open method.

var options = { 'key': key, 'amount': amount * 100, 'name': name, 'order_id': orderId, 'prefill': {'contact': phoneNumber, 'email': emailId}, 'readOnly': {'contact': true, 'email': true}, };

try { _razorpay = Razorpay(); _razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess); _razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError); _razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet); _razorpay.open(options); } catch (e) { print(e); }

Is this method reliable compared to Webhooks?

— Reply to this email directly, view it on GitHub https://github.com/razorpay/razorpay-flutter/issues/167#issuecomment-1415724296, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJY7UI6QFZIICEWX6WB3YTWVTRYNANCNFSM44QLED2Q . You are receiving this because you commented.Message ID: @.***>

tryout3 commented 1 year ago

@techtrix008 Do you have any documentation that I can follow for Webhook implementation?

I have just started with this implementation. I have created a Webhook on Razorpay for a simple cloud function and I am getting ' Invalid request, unable to process. ' error on my cloud function log after I attempt a payment.

Rahuldipu commented 11 months ago

@techtrix008 @Soorya-S Can you send me any reference for webhook implementation?