#apex_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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.
Hi there,
what do you mean by BE?
Hi, thank you! Sorry, I just mean our "backend" servers.
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)
Thanks! The "if provided" caveat has me a little concerned though. Why wouldn't there be a card brand?
Good question, not immediatley sure. Looking in to that and will get back with what I can find.
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_?
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.
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!
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