craftcms / commerce-stripe

Stripe payment gateway for Craft Commerce
https://plugins.craftcms.com/commerce-stripe
MIT License
30 stars 49 forks source link

[4.0] Failed 3D secure payment doesn't respect `cancelUrl` #248

Open jonleverrier opened 9 months ago

jonleverrier commented 9 months ago

Description

I've updated to Commerce Stripe v4. I'm using it with my own payment form and JS from Commerce Stripe v3. All works fine, apart from when 3D secure payments fail.

Before updating, if a 3D secure payment failed, you would be redirected back to the url defined in cancelUrlwhich is defined in the commerce/payments/pay form. This is no longer the case.

Steps to reproduce

  1. Put through a 3D secure payment using card 4000002760003184 and fail the transaction on the stripe test page
  2. Browser goes into a redirect loop

It's trying to load a URL which looks like the below (I've removed some parts)

https://test.local.ddev.site/index.php?commerceTransactionHash=da58b25c7260c3e4418d50e1f8683db2&p=actions%2Fcommerce%2Fpayments%2Fcomplete-payment&payment_intent=pi_<removed>&payment_intent_client_secret=pi_<removed>_secret_<removed>&source_redirect_slug=test_<removed>&source_type=card

Do I need web hooks configured for this to work?

Additional info

jonleverrier commented 8 months ago

Just to add, if a 3D secure payment fails, the payment in Stripe turns up as "Incomplete". Previously, this would be "Failed"

Screenshot 2023-10-10 at 19 46 52
jonleverrier commented 6 months ago

This seems related https://github.com/craftcms/commerce-stripe/issues/266

Basically the same issue, but with failing a test 3D secure payment versus Paypal.

lukeholder commented 3 months ago

Can you please upgrade to the latest Stripe plugin version and let us know if this persists. I can't replicate.