razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
107 stars 145 forks source link

Payments made with Paytm are getting failed #231

Open IAmSarthakVerma opened 2 years ago

IAmSarthakVerma commented 2 years ago

Description

The payments made with the Wallets>Paytm option are getting failed on the app. Other payment methods are working fine. The payments are being shown as AUTHORIZED in the RAZORPAY DASHBOARD and are available for capturing.

The screenshot of the error at frontend: order-error-paytm

Testing Device

OS: Android 12 Model: Samsung S21 5G

Plugin Version

razorpay_flutter: ^1.2.7

Logs:


D/com.razorpay.checkout(32447): Sending data to lumberjack
E/com.razorpay.checkout(32447): Webview JS Error: Uncaught SyntaxError: Invalid or unexpected token
I/chromium(32447): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Invalid or unexpected token", source: https://api.razorpay.com/v1/payments/....
I/ViewRootImpl@b3549d7[CheckoutActivity](32447): MSG_WINDOW_FOCUS_CHANGED 0 1
I/ViewRootImpl@b3549d7[CheckoutActivity](32447): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(32447): startInputInner - Id : 0
I/InputMethodManager(32447): startInputInner - mService.startInputOrWindowGainedFocus
E/com.razorpay.checkout(32447): Webview JS Error: Uncaught TypeError: window.getDeviceDetails is not a function
I/chromium(32447): [INFO:CONSOLE(1)] "Uncaught TypeError: window.getDeviceDetails is not a function", source: https://api.razorpay.com/v1/payments/....
I/Dialog  (32447): mIsDeviceDefault = false, mIsSamsungBasicInteraction = false, isMetaDataInActivity = false
I/DecorView(32447): [INFO] isPopOver=false, config=false
I/DecorView(32447): updateCaptionType >> DecorView@b43aa95[], isFloating=true, isApplication=true, hasWindowControllerCallback=false, hasWindowDecorCaption=false
D/DecorView(32447): setCaptionType = 0, this = DecorView@b43aa95[]
I/ViewRootImpl@f2706e4[CheckoutActivity](32447): setView = com.android.internal.policy.DecorView@b43aa95 TM=true
D/com.razorpay.checkout(32447): RzpAssist onPageStarted: https://api.razorpay.com/v1/checkout/public?version=1.6.10&library=checkoutjs&platform=android&error={%22code%22:%22BAD_REQUEST_ERROR%22,%22description%22:%22Your%20payment%20didn%27t%20go%20through%20due%20to%20a%20temporary%20issue.%20Any%20debited%20amount%20will%20be%20refunded%20in%204-5%20business%20days.%22,%22source%22:%22issuer%22,%22step%22:%22payment_authorization%22,%22reason%22:%22payment_failed%22,%22metadata%22:{%22payment_id%22:%22IjytZtAzDrpK2t%22}}

Flutter Version :

Flutter 2.6.0-12.0.pre.322 • channel master • https://github.com/flutter/flutter.git
Framework • revision 5fd1d36ecc (3 months ago) • 2021-10-13 10:44:55 +0100
Engine • revision da5bd05854
Tools • Dart 2.15.0 (build 2.15.0-208.0.dev)

Flutter Doctor:

[√] Flutter (Channel master, 2.6.0-12.0.pre.322, on Microsoft Windows [Version 10.0.19042.1466], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)

Steps To Reproduce

  1. Open Razorpay checkout.
  2. Click on wallets and then select Paytm.
  3. Authorize your Paytm account through OTP.
  4. Continue paying through Paytm wallet.
  5. Error occurs

Expected Results

The payment should go through without the error.

sumedht commented 2 years ago

@IAmSarthakVerma Issue is with only Paytm or all other payment gateways? @razorpay/techpgintegrations can u check with this?

IAmSarthakVerma commented 2 years ago

I raised a ticket with Razorpay regarding the same, they told me to change "Industry Type" to "Retail109" instead of just "Retail" inside the Paytm configuration, the issue was solved then but now a similar issue is appearing again.

What is happening currently: The customer pays through Paytm, the money gets deducted and the plugin fires a "Razorpay.EVENT_PAYMENT_ERROR".

Inside Razorpay's dashboard that particular transaction shows as "Authorized" and not "Captured" (even though we have auto-capture set while creating the order).

If the customer pays through some other method, everything works fine and as expected.

The current configuration is:

[√] Flutter (Channel stable, 2.10.2, on Microsoft Windows [Version 10.0.19042.1586], locale en-IN)

Plugin Version is 1.2.9

I have been writing to Razorpay's support for over a month now and no satisfactory resolution has been given yet. I raised call back request 5-6 times now. Every time I am promised to get a call back in 24 hours and nothing happens.

@sumedht Please look into this, This is the last hope for me before I ask my team to switch all accounts from Razorpay.

dishank-betaflux commented 1 year ago

@IAmSarthakVerma did you found any resolution for this? can you update the status of this ticket?

IAmSarthakVerma commented 1 year ago

So apparently, this issue was because of the Razorpay's commission on transactions. Since Paytm is considered as a 3rd Party Wallet integration, the amount equal to the commission on the transaction should be present in your Razorpay Balance beforehand, otherwise the transaction will fail in the SDK but the customer's wallet will be deducted. According to customer support this is the "intentional" flow. And since Razorpay transfers money to the bank account daily, and your Razorpay balance comes to zero, then if the first transaction after the daily settlement happens through any of the third party wallet like paytm, then it will fail in the sdk. If this is the case then atleast Razorpay should have a functionality to have a constant minimum deposit as the Razorpay balance (that does not gets settled daily). As a hotfix I asked them to make my settlement as T+2 instead of T+1 so that extra one day allowed the buffer period. Above all, I went through all the integration docs and this was mentioned nowhere and it took months for even the customer support to properly understand and communicate this. In the starting they asked to change the "Industry Type" field value with some random numbers, then something or the other until they told about this commission thing.

I had much better expectations from Razorpay. Anyways, this ticket can be closed for now.