#staleriver_api

1 messages · Page 1 of 1 (latest)

sour boltBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1491517423210463354

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

opaque garnet
#

Hello, good question. Looking in to this and will get back to you

#

Taking a step back, are you building a new integration or are you building on top of an old one? The Sources API is legacy, so if you are writing a new integration now, your code won't have to worry about this list because it will use the PaymentMethods API

#

Do you have example customer IDs of a customer where the list came back as sources and one where it came back as cards?

rancid rivet
#

O sorry! I wasa monitoring #dev-help and for some reason that thread wasn't updating so I didn't know you had responded 🙁

sour boltBOT
rancid rivet
#

I'm just debugging a customer issue. We have a UI element where we're displaying the user's payment instruments. I think our integration always assumed that customer.sources would always return a list of "card" objects, but for this particular customer, it's returning a list of "source" objects. We were not expecting the latter data type on our backend so it was erroring out.

#

cus_LXFNT0ONn4mXbt - comes back as "sources"
cus_MoMtwKZRxs6ndJ - comes back as "cards"

steel girder
#

hi there, I'm taking over for Pompey as they had to step away. thanks for providing those customer IDs, I'll look into them now, one moment

thick agate
#

Quero ativar PIX e/ou boleto no Brasil. Minha conta é CPF. Meu negócio é cassino aranha, ticket médio 4,00reais, https://cassinoaranha.com/

steel girder
#

@thick agate please use #help to create your own thread

#

@rancid rivet thanks for waiting, I suspect this is due to differences in how these payment sources were created. /v1/tokens will create Card objects, while /v1/sources will create Source objects. the creation request for the first customer's source aligns with this, though I'm unable to check for the second customer as that creation has fallen outside retention

#

but to get to your main question, it's expected that this attribute could contain either Card or Source objects, so your backend would need to be able to handle either

rancid rivet
rancid rivet
steel girder
#

yes that's correct

rancid rivet
#

Perfect. I didn't realize someone could edit their payment method from that invoice page.

#

Thank you for your help!