"Register after Checkout" Pane causes payment method reuse to fail

Created on 24 February 2022, almost 3 years ago
Updated 22 July 2024, 5 months ago

Problem/Motivation

When a user registers after anonymous checkout, the payment method they used is then attached to their new account. However, guest checkout through Stripe does not allow payment methods to be attached (they must be associated with a Customer). Attempting to reuse this payment method will fail.

Steps to reproduce

  1. Place an order anonymously. Use an email that is not associated with an existing user so that the Registration after checkout pane appears
  2. Register a new user AFTER checkout using the checkout pane that is shown on the Complete page
  3. That order should now be in your history. The payment method you used should now also be saved under your new account.
  4. Start another cart. Attempt to checkout.
  5. Upon selecting your existing payment method and attempting to go to the Review page, you will see a WSOD. The error in watchdog says "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first."

Proposed resolution

Mark the payment method as un-reusable if registering after checkout. I'm not sure if there is a way to retroactively associate the payment method with a customer after the transaction has taken place but this could be ideal so that the payment method is able to be reused without having to input it again.

Remaining tasks

tbd

User interface changes

tbd

API changes

tbd

Data model changes

tbd

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024