woocommerce-gateway-stripe icon indicating copy to clipboard operation
woocommerce-gateway-stripe copied to clipboard

Woocommerce Checkout Doesn't Progress to Thank You Page after Successful Charge

Open tinsilver opened this issue 8 months ago • 5 comments

Describe the bug Yesterday (2025-03-25) we had 4 customers who experienced a problem with the checkout. (For reference we received 50-ish orders successfully that day). They click the 'Pay Now' button on the checkout but the page just stays as it is. However, Stripe processes the charge and returns a charge successful message to the webhook (confirmed in the plugin api log: 2025-03-25T12:47:28+00:00 Debug Webhook received: charge.succeeded).

To Reproduce Steps to reproduce the behavior:

  1. Enter payment details on checkout and click 'Pay Now'
  2. The checkout does not progress
  3. User re-attempts checkout payment
  4. User is charged double

Expected behavior When payment is confirmed via the API the order status should progress and the checkout page should progress to the Thank You / Order Confirmed page.

Screenshots Image

Environment (please complete the following information):

  • WordPress Version: 6.7.2
  • WooCommerce Version: 9.7.1
  • Stripe Plugin Version: 9.3.1
  • Browser [e.g. chrome, safari] and Version: iPhone Safari, Mac Safari, PC / Desktop
  • Any other plugins installed: WC Order Status Manager (although the orders only go through default statuses i.e. 'pending-payment' and 'processing')
  • PHP: 8.3

Additional context As I mentioned, this affected 4 customers, in slightly different ways. One customer paid twice but it generated two shipments (i.e. the process progressed on the server) but the customer didn't see the Order Confirmation screen the first time. Two customers experienced the same, but the shipment wasn't created (the server didn't process the order). The final customer attempted to pay 3 times but didn't see any Order Confirmation screen.

The orders vary in payment method: Apple Pay, Google Pay, credit cards, debit cards.

In all these cases the Order Notes show a successful 'payment intent created', but only the ones that progressed also show a 'charge complete' note, however the API log on the server shows the webhook message was received (and there are no delivery errors in the webhook console in Stripe).

tinsilver avatar Mar 26 '25 09:03 tinsilver

The API log for the order shows the charge.succeeded message for the payment intent, and a note that the order couldn't be found via charge ID:

2025-03-25T12:47:28+00:00 Debug Webhook received: charge.succeeded
2025-03-25T12:47:28+00:00 Debug Webhook body: {
  "id": "evt_3R6Wt72nOnUyqlgp0pisRL40",
  "object": "event",
  "api_version": "2024-06-20",
  "created": 1742906847,
  "data": {
    "object": {
      "id": "ch_3R6Wt72nOnUyqlgp0ehyhjVH",
      "object": "charge",
      "amount": 12775,
      "amount_captured": 12775,
      "amount_refunded": 0,
      "application": "****",
      "application_fee": null,
      "application_fee_amount": null,
      "balance_transaction": "txn_3R6Wt72nOnUyqlgp0O1yXjO2",
      "billing_details": {
        "address": {
          "city": "****",
          "country": "GB",
          "line1": "****",
          "line2": "****",
          "postal_code": "****",
          "state": "****"
        },
        "email": "****",
        "name": "****",
        "phone": "****"
      },
      "calculated_statement_descriptor": "COCOARUNRS* O #602826",
      "captured": true,
      "created": 1742906845,
      "currency": "gbp",
      "customer": "cus_OqOJgAHJ3734VE",
      "description": "Cocoa Runners - Order 602826",
      "destination": null,
      "dispute": null,
      "disputed": false,
      "failure_balance_transaction": null,
      "failure_code": null,
      "failure_message": null,
      "fraud_details": {
      },
      "invoice": null,
      "livemode": true,
      "metadata": {
        "order_key": "wc_order_pm2wck93jYoUo",
        "tax_amount": "0",
        "site_url": "https://cocoarunners.com",
        "customer_email": "****",
        "signature": "****",
        "customer_name": "****",
        "order_id": "602826",
        "payment_type": "single"
      },
      "on_behalf_of": null,
      "order": null,
      "outcome": {
        "advice_code": null,
        "network_advice_code": null,
        "network_decline_code": null,
        "network_status": "approved_by_network",
        "reason": null,
        "risk_level": "normal",
        "risk_score": 0,
        "seller_message": "Payment complete.",
        "type": "authorized"
      },
      "paid": true,
      "payment_intent": "pi_3R6Wt72nOnUyqlgp08ZcAgOu",
      "payment_method": "pm_1R6Wt42nOnUyqlgpxS7RIoqh",
      "payment_method_details": {
        "card": {
          "amount_authorized": ****,
          "authorization_code": "****",
          "brand": "amex",
          "checks": {
            "address_line1_check": "pass",
            "address_postal_code_check": "pass",
            "cvc_check": "pass"
          },
          "country": "GB",
          "exp_month": 10,
          "exp_year": 2029,
          "extended_authorization": {
            "status": "disabled"
          },
          "fingerprint": "****",
          "funding": "credit",
          "incremental_authorization": {
            "status": "unavailable"
          },
          "installments": null,
          "last4": "****",
          "mandate": null,
          "multicapture": {
            "status": "unavailable"
          },
          "network": "amex",
          "network_token": {
            "used": false
          },
          "network_transaction_id": "****",
          "overcapture": {
            "maximum_amount_capturable": 12775,
            "status": "unavailable"
          },
          "regulated_status": "unregulated",
          "three_d_secure": null,
          "wallet": null
        },
        "type": "card"
      },
      "radar_options": {
      },
      "receipt_email": null,
      "receipt_number": null,
      "receipt_url": "https://pay.stripe.com/receipts/payment/****",
      "refunded": false,
      "review": null,
      "shipping": {
        "address": {
          "city": "****",
          "country": "GB",
          "line1": "****",
          "line2": "****",
          "postal_code": "****",
          "state": "****"
        },
        "carrier": null,
        "name": "****",
        "phone": null,
        "tracking_number": null
      },
      "source": null,
      "source_transfer": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": "O #602826",
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    }
  },
  "livemode": true,
  "pending_webhooks": 2,
  "request": {
    "id": "req_qxNVcQdTeai7fR",
    "idempotency_key": "c5ae0e7e-8cd0-4dfd-94a8-175f6f0e9038"
  },
  "type": "charge.succeeded"
}
2025-03-25T12:47:29+00:00 Debug 
====Stripe Version: 9.3.1====
====Stripe Plugin API Version: 2024-06-20====
====Start Log====
Could not find order via charge ID: ch_3R6Wt72nOnUyqlgp0ehyhjVH
====End Log====

2025-03-25T12:47:29+00:00 Debug 
====Stripe Version: 9.3.1====
====Stripe Plugin API Version: 2024-06-20====
====Start Log====
balance/history/txn_3R6Wt72nOnUyqlgp0O1yXjO2
====End Log====

tinsilver avatar Mar 26 '25 09:03 tinsilver

Hi @tinsilver Could you please confirm whether you are using the legacy checkout experience or the new checkout experience? You can check it in WooCommerce > Settings > Payments > Stripe > Settings tab.

Image

Mayisha avatar Mar 26 '25 13:03 Mayisha

Hi Mayisha, thanks for responding. I can confirm that we are not using the legacy checkout (the settings are just as in your screenshot, with the checkbox unticked).

tinsilver avatar Mar 26 '25 14:03 tinsilver

+1, a customer was charged twice in a matter of seconds, and I had to refund one

BusinessBloomer avatar Apr 05 '25 08:04 BusinessBloomer

Looks like I have the same issue as above. 2x customers charged 3 times in the same second. Multiple payment intents were created at the same time. Log shows:

====Stripe Plugin API Version: 2024-06-20====
====Start Log====
Could not find order via charge ID: ch_3RU4BdJENJNNAaco01xb029d
====End Log====

Stripe version: 9.5.1 Woocommerce version: 9.8.5

Using new checkout experience (not the legacy).

tex0gen avatar May 29 '25 13:05 tex0gen

Could not find order via charge ID:

@tinsilver Just noting that this error in the logs might not be related to the original issue. We've had a separate issue where we tried to process webhooks for synchronous payment methods like cards, which resulted in the above log. It's fixed with https://github.com/woocommerce/woocommerce-gateway-stripe/pull/4084

Could not find order via charge ID: ch_3RU4BdJENJNNAaco01xb029d

@tex0gen I see that you are on 9.5.1. which includes the above fix, but still see the above error. Could you please share the payment method used in the above order?

malithsen avatar Jun 05 '25 19:06 malithsen

Could not find order via charge ID:

@tinsilver Just noting that this error in the logs might not be related to the original issue. We've had a separate issue where we tried to process webhooks for synchronous payment methods like cards, which resulted in the above log. It's fixed with https://github.com/woocommerce/woocommerce-gateway-stripe/pull/4084

Could not find order via charge ID: ch_3RU4BdJENJNNAaco01xb029d

@tex0gen I see that you are on 9.5.1. which includes the above fix, but still see the above error. Could you please share the payment method used in the above order?

It would have been a card payment. All other methods are off (Google pay, apple pay, etc). Card payments are the only method allowed on this store.

tex0gen avatar Jun 05 '25 19:06 tex0gen

@tex0gen Could you please share the system status report for this site, as well as a screenshot of the order notes from the order edit page for the order that has duplicated charges?

malithsen avatar Jun 05 '25 23:06 malithsen

Although we could not consistently reproduce the issue, I built a system to avoid double charges specific to this flow here. It is a lock that is active for 1 minute, contains the customer and product information, and blocks repeated requests within that time frame.

I hope this at least avoids the main issue for you folks. Also, we'd appreciate it if you could send us the related system status report @tex0gen.

wjrosa avatar Jun 24 '25 20:06 wjrosa

Since we didn't hear back from the merchant, I will be closing this issue. Feel free to re-open it when you have more information to share.

wjrosa avatar Jul 09 '25 11:07 wjrosa