Newer payment method objects have pm_ prefixes for their IDs rather than card_ or bank_, meaning we can no longer rely on the prefix to determine the payment method type (to determine the endpoint needed for funding and deleting a payment method).
This now falls back to the object key ("CreditCard" or "BankAccount") to determine the payment method type.
Testing
Unit tests for funding and deleting payment methods are mocked, so we can't test this E2E.
Add unit test to confirm switch-case working for type determination when prefix is pm_
Pull Request Type
Please select the option(s) that are relevant to this PR.
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
Description
Newer payment method objects have
pm_
prefixes for their IDs rather thancard_
orbank_
, meaning we can no longer rely on the prefix to determine the payment method type (to determine the endpoint needed for funding and deleting a payment method).This now falls back to the
object
key ("CreditCard" or "BankAccount") to determine the payment method type.Testing
pm_
Pull Request Type
Please select the option(s) that are relevant to this PR.