I am having a strange issue with switching payment methods between a customer's bank account and a card on subscriptions.
Here is the situation of my use case just for context: I have a bank account and a card saved as sources for the customer, and was testing switching between those on subscriptions, specifically. The bank account succeeds when using it to initially purchase the subscription, then switching the payment method to the card and upgrading the subscription also succeeds. When I try to upgrade again, this time switching back to the original bank account that worked, I get the "no such PaymentMethod" error:
InvalidRequestError(message="No such PaymentMethod: 'ba_1KdKM6BGLd1HVBci6xPs2Os7'", param='default_payment_method', code='resource_missing', http_status=400, request_id='req_KOIP13Q3xrlXO7')
Here are the steps I am taking to get to this point:
- Add a bank account as a source to an existing customer (using the 6789 test account)
- Add a credit card to the same customer (using the 4242 test card)
- Make sure the bank account is the default source, and use that to create a new subscription (succeeds)
- Update the subscription's payment method (
default_payment_method) to the card (succeeds)
- Update the subscription's payment method back to the original bank account (fails)
I have confirmed that the bank account's payment method ID above exists on the customer object (can provide that object if useful), and it is quite strange to me that it only fails after going from the bank account, to the card, then back to the bank account. Any thoughts, or does anything immediately stand out that I may be doing incorrectly?