adyen-salesforce-commerce-cloud icon indicating copy to clipboard operation
adyen-salesforce-commerce-cloud copied to clipboard

Deleted payment methods come back after call to Adyen function

Open kyleruscigno opened this issue 2 years ago • 3 comments

Describe the bug After successfully deleting a previously saved payment method (Credit Card) from the user interface in SFCC, Adyen will repopulate the deleted payment methods

To Reproduce Steps to reproduce the behavior:

  1. Delete one or more saved payment methods (Credit Card) from a logged-in user account
  2. Click 'Back to My Account' or visit any other route which adyen hooks into with the updateSavedCards() method (PaymentInstruments-SavePayment, Account-Show)
  3. Inspecting the customer object at the beginning of the updateSavedCards() method should show the customers wallet reflects the deleted payment instruments. After getOneClickPaymentMethods() is called and new payment instruments are created in updateSavedCards() you should see that any deleted credit cards have returned to the customers wallet

Expected behavior Deleted payment methods should not be recreated after their deletion

Screenshots

  1. Starting from a state of 3 saved payment methods, delete all payments Screenshot 2022-06-01 155802

  2. After Deleting all payments, clicking “Back to My Account” shows no saved payment methods *the issue would also occur at this point if we weren't replacing the “Account-Show” route entirely in our controller, as adyen also updates all saved cards on the account-show route Screenshot 2022-06-01 155903

  3. Click Add New Payment Method and re-add the card ending in ‘1111’ Screenshot 2022-06-01 155725

  4. Adyen’s savePayment method will prepend to the PaymentInstruments-SavePayment route and call the “updateSavedCards” function. If you capture the customer object at this moment, you’ll see that their wallet only contains the one pending payment method being added Screenshot 2022-06-01 161356

  5. The ‘updateSavedCards’ function deletes all existing saved cards and gets the ones to add via the ‘getOneClickPaymentMethods’ function. When you capture the state of it’s return value, you’ll see it contains all the cards previously removed. Screenshot 2022-06-01 163138

  6. Back in ‘updateSavedCards’ you’ll see the credit cards being added contain the ones that were previously removed in this case the one ending in 0007 Screenshot 2022-06-01 155641

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: chrome
  • Version: SFRA 6.0.0, Adyen 21.2.0, SFCC 22.5

kyleruscigno avatar Jun 07 '22 21:06 kyleruscigno

Hi @kyleruscigno,

Thanks for raising this issue and for elaborating on it to this extent. This behavior should be fixed and we'll be looking into this as soon as possible.

Kind Regards, Wouter Adyen

wboereboom avatar Jul 11 '22 06:07 wboereboom

@wboereboom Any progress on this? We are having this issue as well

codyluth avatar Oct 04 '22 16:10 codyluth

Hi @codyluth,

Unfortunately we have not had the opportunity to start developing a fix. I will update this ticket as soon as we get the capacity to start working on this.

Kind Regards, Wouter Adyen

wboereboom avatar Oct 05 '22 06:10 wboereboom