#apex_best-practices

1 messages ¡ Page 1 of 1 (latest)

tranquil sparrowBOT
#

👋 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/1491143352014471320

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

gleaming ruin
#

Hi there,
what do you mean by BE?

rare obsidian
#

Hi, thank you! Sorry, I just mean our "backend" servers.

gleaming ruin
#

Oh yeah sorry of course. Well, you already shared a doc that points into that direction. It's a frontend feature though. You can use Confirmation tokens for that like mentioned here. With the confirmation token you can inspect the payment_method_preview and check the card brand (if provided)

tranquil sparrowBOT
rare obsidian
#

Thanks! The "if provided" caveat has me a little concerned though. Why wouldn't there be a card brand?

formal night
#

Good question, not immediatley sure. Looking in to that and will get back with what I can find.

rare obsidian
#

Thank you!
Claude advised having the frontend create a Payment Method, and sending that pm_ ID to the backend.
Is creating and sending the ctoken_ preferred or recommended over using the pm_?

formal night
#

Yep confirmation tokens are recommended over payment methods. ConfirmationTokens were actually created to address usecases that couldn't be addressed through PM creation alone. Basically they wrap PM info along with other related info.
The classic example is a bank debit payment method where you are also creating a Mandate (a record of the customer authorizing you to charge them later), the confirmation token can bundle the PM + mandate date but a payment method object by itself cannot.

rare obsidian
#

Very, cool - thank you!

Any additional info that you find that may be relevant for me would be appreciated, but my primary question here can be considered answered, and no further reply is expected.
Thanks again!

formal night
#

Sounds good! Still looking into when brand can be blank. Haven't found much yet so I am assuming it is pretty rare but will update if I find anything interesting