#celsian
1 messages ยท Page 1 of 1 (latest)
Hi ๐ no, you cannot cast or convert a Source to a Payment Method, but I'm pretty sure Sources are compatible with most or all of the Payment Method endpoints. What are you trying to accomplish?
I have a standardized front end where I want to populate values like Billing Name, Billing Address, Last 4 (if available) etc.
Right now I have to determine if the billing method is a PaymentMethod or a Source and change how I retrieve the values based on the type. I was hoping to refactor this without having to write a translation for all the different types of sources there are.
Hm, I believe you should be able to retrieve Sources via Payment Method APIs, so you can have a consistent approach for retrieving them. Are you seeing something different? Or is this specifically about the structure of the objects when they're retrieved?
I'll give that a try, I have not attempted to retrieve a source using the Payment Method api, I'd like to see the structure that returns, it might solve my issue. Thank you.
๐ sounds good, let me know if it doesn't and I'll be happy to take another look.