When buying a subscription type product as a guest while ACDC Vaulting is active, the payment method is not saved for the newly created WordPress user.
Steps To Reproduce
As admin enable WC Subscriptions plugin and create a new subscription product
Enable Vaulting for ACDC
Navigate to shop as guest
Add subscription product to cart and navigate to block checkout
Select ACDC gateway, enter credit card data and pay
Navigate to MyAccount → Payment methods
Observe no saved payment methods in list
Expected behaviour
Payment method is saved a guest user creates an account during the checkout, eg. when buying a subscription type product.
Possible cause
Current localStorage implementation for save payment method check does not work correctly for guest users, it send save_payment_method as false.
Suggested solution
EnsurelocalStorage sets true on page load when there is a WC subscription product in the cart. It also removes localStorage key on page load to avoid previous value being used.
When buying a subscription type product as a guest while ACDC Vaulting is active, the payment method is not saved for the newly created WordPress user.
Steps To Reproduce
Navigate to MyAccount → Payment methods Observe no saved payment methods in list
Expected behaviour
Payment method is saved a guest user creates an account during the checkout, eg. when buying a subscription type product.
Possible cause
Current
localStorage
implementation for save payment method check does not work correctly for guest users, it send save_payment_method asfalse
.Suggested solution
Ensure
localStorage
sets true on page load when there is a WC subscription product in the cart. It also removeslocalStorage
key on page load to avoid previous value being used.