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

Delayed payment successful response from Razorpay despite successfully capturing payments #571

Open
shrenikr235 opened this issue Sep 7, 2024 · 4 comments

Comments

@shrenikr235
Copy link

shrenikr235 commented Sep 7, 2024

  • Razorpay for WooCommerce plugin version: 4.5.6
  • WooCommerce version: 9.0.2
  • Wordpress version: 6.6.1
  • Payment action in the plugin settings is set to Authorize and Capture
  • The webhook for my website https://www.go2andaman.com/wp-admin/admin-post.php?action=rzp_wc_webhook is set with 2 active events payment.authorized and refund.created
  • Not using Razorpay subscriptions.
  • An alert has been set in case of deliverability issues but we've received no emails so I'm guessing there have been no deliverability issues from Razorpay's end.

This is the flow a customer takes on our website:

  1. Customer clicks on a "Proceed to pay" button and is shown the Razorpay payment screen - At this point, a WooCommerce order gets created and a subsequent Razorpay order order_someString gets created.
  2. Customer makes the payment and is redirected to the success version of the thankyou page if successful and the failure version of the thankyou page if he cancels the payment.
  3. In case of successful payment, these are what the order notes on WooCommerce look like:
    image
  4. In case of a failed payment, these are what the order notes on WooCommerce look like:
    image
  5. In case of a successful payment but failed order, these are what the order notes on WooCommece look like:
    image
  • The rzp_webhook_notified_at field is also set to 1725630166 which is 7:12PM i.e about 2 mins post creation of the Razorpay order when we successfully received the payment on Razorpay.
    image

The issue:

  1. We however, received the payment confirmation from Razorpay only about 5 hrs later at ~12:14AM. This has multiple effects because the WooCommerce order status doesn't change to Completed when it should and triggers based on that order status are affected consequently.
  2. Not sure if this is relevant but I found a few fatal errors in my WooCommerce logs related to Razorpay. Can you please help me make sense of this error?
    2024-08-14T13:36:55+00:00 CRITICAL Uncaught Razorpay\Api\Errors\BadRequestError: Too many requests in /var/www/awesome-enterprise-new/vendor/razorpay/razorpay/src/Request.php:142 CONTEXT: {"error":{"type":1,"file":"\/var\/www\/awesome-enterprise-new\/vendor\/razorpay\/razorpay\/src\/Request.php","line":142},"backtrace":["","#0 \/var\/www\/awesome-enterprise-new\/vendor\/razorpay\/razorpay\/src\/Request.php(109): Razorpay\\Api\\Request->processError()","#1 \/var\/www\/awesome-enterprise-new\/vendor\/razorpay\/razorpay\/src\/Request.php(58): Razorpay\\Api\\Request->checkErrors()","#2 \/var\/www\/go2andaman.com\/htdocs\/wp-content\/plugins\/woo-razorpay\/woo-razorpay.php(1420): Razorpay\\Api\\Request->request()","#3 \/var\/www\/go2andaman.com\/htdocs\/wp-content\/plugins\/woo-razorpay\/woo-razorpay.php(1054): WC_Razorpay->generateOrderForm()","#4 \/var\/www\/go2andaman.com\/htdocs\/wp-content\/plugins\/woo-razorpay\/woo-razorpay.php(857): WC_Razorpay->generate_razorpay_form()","#5 \/var\/www\/go2andaman.com\/htdocs\/wp-includes\/class-wp-hook.php(324): WC_Razorpay->receipt_page()","#6 \/var\/www\/go2andaman.com\/htdocs\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#7 \/var\/www\/go2andaman.com\/htdocs\/wp-includes\/plugin.php(517): WP_"]}
@abdulwahidsharief
Copy link
Contributor

@shrenikr235 please share site logs

@shrenikr235
Copy link
Author

@abdulwahidsharief are you referring to Wordpress logs / WooCommerce logs?

@shrenikr235
Copy link
Author

Additionally, Razorpay has informed me that for the payment ID we had a delayed response for:
The webhook payload was sent immediately after the payment was authorised but the same was not consumed at my website's end and we received a non 2xx response from the server hence the same was retried till success response was received.

image

Can you help me make sense of what could cause this? Razorpay support seems to think it could be due to non-whitelisted Razorpay webhook IPs but if that were the case this would be the case for all orders, right? But I see this issue only with specific orders.

@abdulwahidsharief
Copy link
Contributor

abdulwahidsharief commented Sep 11, 2024

@shrenikr235 please send woocommerce logs (woocommerce->status->logs->razorpay-log). share all logs with respect to delayed orders
from logs we can find how many webhook requests received for an order and can find if anything is breaking at your site

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