craftcms / commerce-stripe

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

Secure Card Authentication failing with subscriptions #217

Closed cliveportman closed 1 year ago

cliveportman commented 2 years ago

Description

Using Stripe's SCA test card numbers, product purchases work fine (front and back), while subscriptions don't. There is no redirect but I can see the web-hooks are being sent by Stripe. Also, there's no SCA being carried out on when cards are added to stored cards, which will be needed for subscriptions so should probably be completed at the time of adding the stored card.

Steps to reproduce

  1. Install Commerce and Commerce Stripe, set up Payment Intents with test api keys
  2. Purchase a subscription using the example templates.

Additional info

johnwbaxter commented 2 years ago

Bump on this one, we are seeing this issue. Pretty urgent!!

lukeholder commented 2 years ago

Sorry for the delay in response.

Looking at the subscriptions that have "failed to start", they all seem to be due to SCA being enforced for that payment method. The subscriptions are showing up in that section of the subscription page and show be showing this message "To start the subscription, please complete 3DS authentication."

Can you confirm:

You are have a Billing details update URL configured in your commerce general settings.

You have the billing details update page in place at that URL. There is an example of such a page in our example templates here:

https://github.com/craftcms/commerce/blob/v3/example-templates/dist/shop/plans/update-billing-details.twig

I have just tried a SCA enforced card with the example templates and was successful in being redirected to this billing details page and completing the SCA workflow over Stripe.

Let me know if you have that all set up.

For those customers that did not get redirected to this page, you could send customers an email to this billing page to go through SCA and complete this process to start their subscriptions, or show a link to this page from their membership area with a link to resolve the issue.

Let me know how that goes.

johnwbaxter commented 2 years ago

@lukeholder Can you point me to the commerce docs where it talks about this please?

johnwbaxter commented 2 years ago

@lukeholder Ignore that, sorry, misunderstood :)

ruralaccent commented 1 year ago

We have been experiencing a similar issue. All European card payments are now failing and sitting as 'incomplete', because 3D Secure 2 is not being completed for any transaction. Test transactions are showing users aren't being shown any 3D Secure steps to complete.

Our site was built using the Stripe Charge gateway api. Does the gateway have to be Stripe Payments Intents for 3D Secure 2 to work? Or can it work with Stripe Charge as well?

The was never an issue until a few months ago when the UK and most of Europe began enforcing 3D Secure 2 for most transactions. We've only see failed payment after failed payment for the last month or two. North American transactions don't seem to be affected yet, but American banks tend to lag on 3D Secure anyway.

At present, all European transactions are now failing and we have to authorise them manually in Stripe. It's becoming a big problem for us.

Thank you :)

cliveportman commented 1 year ago

Updating the update-billung-details field in Commerce settings fixed this for me with both cart checkouts and new subscriptions, as in Luke's comment. If you aren't using the example templates, you can can just copy the one from there. I haven't fully tested the renewal payments though. I can add cards that need authentication as payment cards, but no authentication happens at that point, so am working on the sending of an email.

ruralaccent commented 1 year ago

Updating the update-billung-details field in Commerce settings fixed this for me with both cart checkouts and new subscriptions, as in Luke's comment. If you aren't using the example templates, you can can just copy the one from there. I haven't fully tested the renewal payments though. I can add cards that need authentication as payment cards, but no authentication happens at that point, so am working on the sending of an email.

Yes, this fixed it for our site's new subscription transactions too. We had to switch to Stripe Payment Intents and added tweaked versions of elements of the update-billing-details.twig code, but it got things moving again.

Like you, I've still to fully bottom out what will happen on renewal for cards that were added prior to our switch to Payment Intents or that haven't gone through 3D Secure auth. I'll be testing it this week.

Given that this code is essentially mandatory for any site that may or does process cards from users in Europe (and will be for the rest of the world eventually) it's really not an optional element. @lukeholder If possible, as it's likely to affect more users in the future, I do think it'd be useful for this to be highlighted clearly in setup/configuration instructions.