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

Change Payment - Error when changing subscription payment method to a new 3DS CC with UPE disabled #2822

Open
veljkho opened this issue Aug 31, 2021 · 13 comments · May be fixed by #10453
Open
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. component: saved cards and subscriptions Issues related to Saved Cards and Subscriptions component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: subscriptions Deprecated in Feb 2025. Please don't use priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@veljkho
Copy link
Contributor

veljkho commented Aug 31, 2021

Describe the bug

In My Account > My Subscriptions > Change Payment page, when trying to add a new payment method which is a credit card with 3ds security, getting error: Error: No such payment_intent: 'seti_ab'.

This occurs when the store has UPE disabled.

To Reproduce

[pre-requisite: customer logged in and has 1 subscription bought (1 month subscription)]

  1. Ensure store doesn't have UPE enabled (using WCPay dev tools)
  2. Go to My Account > My Subscription
  3. Click on Change Payment button
  4. Scroll down and check the checkbox to use a new payment method
  5. Enter this card: 4000002760003184 12/25 123
  6. Click Change Payment button to save the changes
  7. Observe issue

Actual behavior

Throws warning and CC not added

Screenshots

image

Page reloads and shows Payment method updated and spinner before the 3DS modal is rendered/validated!

Screen Shot 2022-07-28 at 3 10 23 PM

Screen Shot 2022-07-28 at 3 10 25 PM

After the 3DS modal is verified (click Complete Auth), then you get the error. It looks like our payment processing is firing too early.

Screen Shot 2022-07-28 at 3 10 04 PM

Expected behavior

No warning, credit card added successfully and present at the bottom.

Desktop (please complete the following information):

  • OS: MacOS Big Sur
  • Browser Opera
  • Version 78.0.4093.147

Additional context

@veljkho veljkho added the type: bug The issue is a confirmed bug. label Aug 31, 2021
@james-allan
Copy link
Contributor

duplicate of #1294

@htdat htdat added category: core WC Payments core related issues, where it’s obvious. component: saved cards and subscriptions Issues related to Saved Cards and Subscriptions needs prioritisation Triage finished and issues are ready for the following processing. labels Dec 1, 2021
@htdat
Copy link
Member

htdat commented Dec 1, 2021

duplicate of #1294

Thanks James! I am going to close #1294 as the current issue is more well-defined.

@haszari
Copy link
Contributor

haszari commented Apr 27, 2022

I think this is worth prioritising. If shoppers / subscribers can't add 3DS (aka SCA) credit cards as payment methods, we should either fix that or improve the error handling (if these cards are not supported for subscriptions).

@haszari haszari added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. and removed needs prioritisation Triage finished and issues are ready for the following processing. labels May 25, 2022
@haszari
Copy link
Contributor

haszari commented May 25, 2022

I'm assuming this affects both WCPay Subscriptions and the integration with WooCommerce Subscriptions.

@haszari haszari added the component: wcpay subscriptions Issues related to Stripe Billing Subscriptions label May 25, 2022
@Jinksi Jinksi self-assigned this May 26, 2022
@Jinksi
Copy link
Member

Jinksi commented May 26, 2022

I'm assuming this affects both WCPay Subscriptions and the integration with WooCommerce Subscriptions.

@haszari yes, following the above steps with WC Subscriptions produces the same results.

@Jinksi

This comment was marked as outdated.

@Jinksi Jinksi changed the title Change Payment - Getting error while trying to add a new payment method CC 3DS type Change Payment - Error when changing subscription payment method to 3DS CC with UPE disabled Jun 1, 2022
@Jinksi Jinksi changed the title Change Payment - Error when changing subscription payment method to 3DS CC with UPE disabled Change Payment - Error when changing subscription payment method to a new 3DS CC with UPE disabled Jun 1, 2022
@Jinksi
Copy link
Member

Jinksi commented Jun 1, 2022

I've moved my comments related to the bug with UPE to a new issue (#4308) since this issue is specific to non-UPE.

@Jinksi Jinksi removed their assignment Jun 5, 2022
@haszari
Copy link
Contributor

haszari commented Jul 29, 2022

Tested this and I notice the form gets submitted, and Woo thinks a payment method has been added, before the 3DS modal is displayed. Eg.

  • Shopper adds card details, submits form
  • Page reloads, shows success message and error message (screenshots in description)
  • 3DS modal is rendered here
  • This is unlikely to work …

I compared with the regular (shortcode) checkout for WCPay, and pay-for-order for WC Stripe extension. In both cases, the 3DS modal is displayed before any page reloads. So maybe we need to rework the logic to ensure the 3DS modal is displayed before the form submission.

The JS code handling this UI is in checkout/classic/index.js: https://github.com/Automattic/woocommerce-payments/blob/develop/client/checkout/classic/index.js#L373

@haszari haszari self-assigned this Jul 29, 2022
@haszari
Copy link
Contributor

haszari commented Jul 29, 2022

This could be the culprit:

if ( paymentMethodGenerated ) {
paymentMethodGenerated = null;
return;
}

  • If we return false from the submit handler, it stops Woo from proceeding (i.e. the early page reload before 3DS modal).
  • handlePaymentMethodCreation is the core of our submit handling.
  • The first time it's called, it fires off an AJAX request to generate a payment method, and returns false to prevent submit.
  • In the AJAX success callback, it sets paymentMethodGenerated = true.
    • In the 3DS case this might not be the whole story.
  • Then handlePaymentMethodCreation is called a second time, and this time it exits early (above code snippet) and allows checkout to proceed.
    • My hunch is that this needs to check something else and wait for the 3DS modal to proceed - either in the success callback, or in the subsequent call to handlePaymentMethodCreation.

@haszari haszari removed their assignment Dec 4, 2022
@haszari haszari added the focus: subscriptions Deprecated in Feb 2025. Please don't use label Mar 11, 2024
@solstudioim
Copy link

solstudioim commented Dec 24, 2024

Any update on this @haszari a merchant is affected by this, I think on 8894172-zd-a8c
The user is on WooPayments version 8.6.1

@haszari
Copy link
Contributor

haszari commented Jan 7, 2025

@solstudioim No updates from me or Helix team (if there were we would have commented!). I suggest reaching out to product or engineering folks currently focused on subscriptions, we switched focus a while ago.

@mattallan
Copy link
Contributor

This issue might be similar to a bug we fixed in Stripe related to changing to a 3DS card after we implemented deferred intents: woocommerce/woocommerce-gateway-stripe#3539

Deferred intents changed when payment/setup intents were created and confirmed. Previously on Stripe, the intent was created on page load and then confirmed at the time of form submission. With deferred intents, the intent is now created on form submission and later validated/confirmed during the process_payment() function which broke out compatibility with this feature (not sure if WooPayments does things the same).

In order to fix this issue, we had to return false on the woocommerce_subscriptions_update_payment_via_pay_shortcode filter. which prevents WooCommerce Subscriptions from updating the payment method before the customer had authed the payment and the intent was confirmed.

@timur27 timur27 self-assigned this Feb 7, 2025
@timur27
Copy link
Contributor

timur27 commented Feb 17, 2025

This issue existed for a long time now, as it was there with the good old UPE too. The PR mentioned by Matt above is pretty helpful. On top of that, we still need to handle a couple of WooPayments-specific areas:

  1. Allow order meta to be updated for the change payment method use-case to ensure intent IDs alignment
  2. Enhance 3DS intent confirmation AJAX to get the correct type of intent (our flow currently is not able to recognize it's a "change pm for subscription" use-case and attempts to fetch payment intents instead
  3. Add the correct redirect as currently, assuming the above two points are addressed, I'm redirected to order received page

There might be more things in it but the above ones are the bigger ones for now.

@timur27 timur27 linked a pull request Feb 28, 2025 that will close this issue
6 tasks
@FangedParakeet FangedParakeet added this to the WooPayments 9.1.0 milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. component: saved cards and subscriptions Issues related to Saved Cards and Subscriptions component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: subscriptions Deprecated in Feb 2025. Please don't use priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants