paypal-woocommerce
paypal-woocommerce copied to clipboard
Change subscription payment method to ACH
A customer signs up for a subscription via Woocommerce Subscriptions and pays with their bank account(ACH). They later decide to use another bank account for this subscription. They go to the payment method update page, enter in the new account info and submit. The notice on the page says that payment info has been updated.
However, the next time the subscription is charged, the payment does not appear on the updated account. It appears on the old account.
Once the customer submits the update, there appear to be two places where credit card is assumed as the method of payment. Both are in classes/wc-gateway-braintree-angelleye.php
:
-
add_payment_method
function: when creating the payment method in braintree, thebraintree_create_payment_method
function does not perform a network check on the bank account. So even if the correct token was saved, the next transaction would fail b/c the bank account is not verified. -
braintree_save_payment_method
function: it attempts to find the token in the WP database. If that fails, it then tries to create a credit card token. When it attempts to validate that token, the process errors out b/c there is no credit card data(since the payment method is ACH).