- First commit to issue fork.
- Merge request !65Issue #3266382: Create customers for anonymous checkout and handle reassignment. β (Open) created by gcb
- last update
about 1 year ago 19 pass, 4 fail - last update
about 1 year ago 19 pass, 4 fail - πΊπΈUnited States gcb
I've submitted an MR with a solution to this issue, which makes sure customer ID's are associated with payment methods that we are saving, then retains them and assigns them to the User that gets created by Commerce.
I'm attaching a patch of the current MR for convenience.
The last submitted patch, 11: 3266382-anonymous-checkout-customer-11.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
about 1 year ago 38 pass 17:42 15:15 Running- Status changed to Needs work
12 months ago 9:38pm 12 January 2024 - πΊπΈUnited States gcb
Discovered an issue with the latest solution, which is that a payment intent can't use a payment with a different customer ID. You can see this issue emerge if you select saved payment method associated with a different customer ID (one using the field added in this patch), then go back to change payment to a different or new payment method.
This is feeling like a generally bad approach to solving this problem. Instead, we should probably be smart about associating the new user with the customer record in Stripe.
However, here's a workaround which refreshes the payment intent.
- πΊπΈUnited States gcb
Updated patch & PR to prevent overwriting of a user's existing customer ID. This commit seems relevant beyond this issue's specific problems, as it's certainly possible for a user to have a customer ID, then make an anonymous purchase using their email address, which will then break their existing saved cards without a fix like this.
- π¨πΎCyprus alex.bukach
Alex Bukach β changed the visibility of the branch 3266382-register-after-checkout to hidden.
- π¨πΎCyprus alex.bukach
Alex Bukach β changed the visibility of the branch 3266382-register-after-checkout to active.
- Merge request !101Marked anonymous payment methods as non-reusable β (Open) created by alex.bukach
- π¨πΎCyprus alex.bukach
Re-rolled patch #7 against the head of 8.x.1-x and created MR!101.
- Status changed to Needs review
6 months ago 5:15pm 30 June 2024 - First commit to issue fork.
- Merge request !106Issue #3266382 by gcb, Alex Bukach, cchoe1, TomTech, John Pitcairn: "Register... β (Merged) created by TomTech
-
TomTech β
committed 2f7bf090 on 8.x-1.x
Issue #3266382 by gcb, Alex Bukach, cchoe1, TomTech, John Pitcairn: "...
-
TomTech β
committed 2f7bf090 on 8.x-1.x
- πΊπΈUnited States TomTech
An enhancement has been added to assign the payment method when the customer has orders assigned to them. (Note: this also handles other scenarios, besides the "Register after Checkout" pane, such as checkout flow with create account for guest user or checkout flow with sign to existing user options enabled.)
This allows the payment method to properly be reusable.
Some notes:
1. This works for the Stripe Payment Element. If needed for Card Element, please create a separate issue to port similar logic, as it would require some refactoring in the Stripe.php class.
2. If backfill is needed, the database update in this thread might work on smaller sites, but not for larger sites with 100k/millions of records. A more targeted and performant query would be needed, along with the ability to defer/skip this revision, to be performed offline. A drush command might be a better option. That should also be a separate issue.
- Assigned to TomTech
- Status changed to Fixed
6 months ago 4:41pm 8 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.