This is a weird Checkout + Payment UX problem. After adding their payment method information, the payment method gets tokenized and the user is on the review page. If the user goes back to edit this information, they cannot. They have to re-enter it completely.

We have SupportsUpdatingStoredPaymentMethodsInterface, but I don't recall if this allows editing in Checkout.

Comments

mglaman created an issue. See original summary.

scottsawyer’s picture

StatusFileSize
new28.65 KB
new41.72 KB

If a customer ( anonymous ) enters a credit card and continues to the review screen, notices a mistake on the billing address, there is no way to go back and change just the address. Their only option is to add a new credit card. This could be confusing because the credit card number would be the same, just with a new billing address.
billing re-edit payment method
billing, add new card

I also noticed that when I add a new card with a different address, the original card & address are no longer available.

I only tested with a Stripe test card number, not sure if that has any affect.

agiraud’s picture

+1 for this

I noticed the same issue today, we should have a way to edit the billing information for existing payment method :(

quotientix’s picture

+1

Rafael Cansinos’s picture

ShenHua’s picture

I believe I'm experiencing the same bug:

- I am using 2 payment methods. PayPal (the first one), Klarna Checkout (the second choice).

Everything is fine with Klarna Checkout, so I believe this to be Commerce Paypal bug.

Order Information Step
1. Choose a saved address OR add a new one. It doesn't matter.
2. PayPal selected as Payment Method. (If I select Klarna, the bug does not happen.)
3. I click "Continue to review".

Review Step
4. At this stage, I click either "edit" where the address is or I click the "go back" button. Both bring same result.
5. Takes me back to Order Information...

Order Information Again, Step
6. PayPal Payment Method Selected.
7. The whole billing form is not rendered at all. There's nothing I can edit. I only see Payment Methods and then immediately Continue to Review button below.

...Of course, if I switch to Klarna Checkout at this (or any other for that matter) time, then the address there works fine.

If I switch back to PayPal. The billing address form is missing.

Now, this is worth noting.

This persists regardless if I remove something from the shopping cart, or try to go back and forth between Review and Order Information page. I just can't edit billing address of PayPal after it's first entered.

Now, if I then choose Klarna Checkout -> Continue to Review -> Edit -> Change Payment Method to PayPal instead of Klarna. Then all of a sudden, the billing address re-appears for PayPal too. Now I can edit it again.

rszrama’s picture

We'll try using the remote_id field on payment methods to determine whether or not the profile is still editable. If it hasn't been tokenized yet (i.e. there is no remote_id), then it should still be editable.

jsacksick’s picture

The underlying problem might be that a payment method is created too early. For example, when using PayPal Checkout that technically supports creating payment methods, selecting paypal in checkout before actually initiating the payment will create the payment method when the payment information pane is submitted.

tommychris’s picture

Priority: Normal » Major

I think this is a major problem (or maybe Critical...).

jsacksick’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.87 KB

Ok, I gave this issue a closer look today. I have a fix that seems to work for PayPal. But not 100% sure if this is what's affecting other gateways as well.

We can't allow updating the billing profile for payment methods that have been tokenized.

The fix needs tests (Was thinking we could update PaymentCheckoutTest::testCheckoutWithOffsiteRedirectPost() but for some reason, after the offsite redirect option is selected in checkout, when returning to the order information page, the newly created payment method isn't present in the options (that's a weird thing to investigate).

Also, this fix wouldn't actually work for the "example_offsite_redirect" test gateway plugin because it actually sets a remote ID.

Granted we could either not set the remote ID, or wipe it prior to returning on the order info page.

Status: Needs review » Needs work

The last submitted patch, 10: 3118985-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

tommychris’s picture

I tested your patch, and my results are (I have only one payment gateway installed, the PayPal (Sandbox)):

  • Patch applied without any errors, succesfully,
  • When click the Edit button, the screen goes back to order information, and I'm allowed to change my billing informations,
  • After modifing the billing address and clicking Continue to review button, the review screen successfully appears,
  • but unfortunately, the billing addres won't change, it is the same as before.

Thanks your existent work, I hope you can fix this without too much time & effort.

jsacksick’s picture

@TommyChris: I kept trying to reproduce the behavior described and couldn't. My billing address is always updated. Tried with profile copying, without profile copying...

tommychris’s picture

@jsacksick: I have no luck :(

I've just created a brand new empty D9 website, and I got the same as my live website. If you have a little time, you can look after it.

!!!removed account details!!!

It is a new D9.2.6 website + installed some of the commerce modules + field ui + admin toolbar. I made some default configuration for Commerce (created store, product type, ...).

Here is a demo product: https://d9.mcdev.hu/product/1

  • Put it in cart
  • Click checkout
  • Fill payment information
  • Click Continue to review
  • Click Edit after the Payment information text in the legend
  • Click Edit
  • Modify anything on the profile
  • Click Continue to review

After that steps, you can that nothing changed. None of the profiles updated. If you try to add a new profile instead the edit, the results are the same.

In this demo website, no custom module or custom theme were installed. My composer.patches.json is:

{
  "patches": {
    "drupal/commerce": {
      "Customers cannot modify billing information after adding payment method details": "https://www.drupal.org/files/issues/2021-09-06/3118985-10.patch"
    }
  }
}

If you need more informations, or you would like to get ftp access, or a dump of the demo site, feel free to contact me.

dwkitchen’s picture

Status: Needs work » Reviewed & tested by the community

For me, this works as expected and I cannot reproduce @TommyChris's issue

jsacksick’s picture

Status: Reviewed & tested by the community » Needs work

Tests aren't passing for some reason, so this needs additional work apparently.

jsacksick’s picture

Status: Needs work » Needs review
StatusFileSize
new2.91 KB

Attached patch should address the test failures.

  • jsacksick committed 1773bef on 8.x-2.x
    Issue #3118985 by jsacksick, scottsawyer, mglaman, dwkitchen, rszrama:...

  • jsacksick committed 2dc6a22 on 3.0.x
    Issue #3118985 by jsacksick, scottsawyer, mglaman, dwkitchen, rszrama:...
jsacksick’s picture

Status: Needs review » Fixed

Committed the patch from #17! Thanks everyone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rhovland’s picture

Testing this out and it doesn't work for authorize.net. Have to enter a new payment method to change anything about the payment. Not sure if this is because of what you mentioned earlier, payment is being created too soon, or if this is caused by something else.

sunnykshah’s picture

I am having the same issue as TommyChris. Do anyone else face the same issue? Is there any solution to this?

kimberleycgm’s picture

As this issue is now closed I've raised a separate one for that issue as I ran into it too and think (hope!) I have a solution: https://www.drupal.org/project/commerce/issues/3281185

nojj’s picture

@ TommyChris i have the same problem. Could your solve it?

jsacksick’s picture

@TommyChris (and everyone else), could you test the patch from #3281185: Payment method profile overwrites order billing profile? It should fix the issue reported in comment #14.

tommychris’s picture

Thanks @jsacksick, it looks like everything is ok now.

I upgraded the module to 8.30, and used only patch from #3281185-20.

lighttree’s picture

StatusFileSize
new1.03 KB
new1.43 KB

Hi, I was dealing with the same issue as @rhovland mentioned with commerce_authnet. I've attached a couple small patches, one for commerce and one for commerce_authnet, that solve this problem. Essentially you just need to run updatePaymentMethod() when the payment is submitted and it will update the info on authorize.net. I hope this helps someone.

huijse’s picture

I do not see an edit button. Not sure why.. Do I need to configure something take in effect? I am using the latest version of commerce core 2.33

So besides the ability to add a new cards which is possible I do not see an edit next to the: Visa ending 4242
image credit card edit example

jsacksick’s picture

@huijse: I think you misunderstood what this issue is fixing.

There's no support in checkout for updating existing payment methods.

This was about updating billing information attached to a payment method right after a payment method is added.

trickfun’s picture

Same issue here https://www.drupal.org/project/commerce/issues/3373306#comment-15866731
I think that editing should be directly in checkout because a large number simply close the browser window and never return if there isn't an edit button.

Thank you