#cristian_best-practices

1 messages ¡ Page 1 of 1 (latest)

shut warrenBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253407726223098009

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

shy kraken
#

Hello! Can you provide more context? I'm not sure I understand what you're trying to do.

#

Payment Intents are state machines that track the lifecycle of a specific payment. Setup Intents do the same thing for setting up a Payment Method for future use without taking an immediate payment. Payment Methods themselves aren't state machines, and don't really have a current state or status.

novel rose
#

Sure, lets say im importing payment methods into our platform, but I need to tell the customer which payment method is valid to use or not. If im importing payment methods that require action like us_bank_account with manual ACH, how can I know the status of that payment method?

#

technically the status of that payment method is being held on the payment intent or setup intent, but I cant get that from a payment method id either

shy kraken
novel rose
#

yes but there could be payment methods that are us_bank_account that are valid and others that are still pending microdeposits verification

#

so until it is verified, the payment method is not valid (its not attached to the customer) and should not be used

#

I suppose a hack for this scenario is to check for the customer ID in the payment method, but it smells

shy kraken
#

There's nothing that points you to the Intent though, that's something you'd have to track on your end.

novel rose
#

we are tracking it, the issue was raised in the import feature, in case payment methods are created off platform

#

the metadata can be added to a payment method after it has been created, right? not while creating it

#

and it doesnt solve this particular scenario

shy kraken
#

You can add metadata when creating or updating a Payment Method.

novel rose
#

what does financial_connections_account represent?

shy kraken
novel rose
#

oh that doesnt apply to microdeposits

#

we need to support manual ACH

shy kraken
#

That's when you would need to look at the Intent, yeah.

novel rose
#

:/

shy kraken
#

You can put the Intent's ID in the Payment Method's metadata so you can get back to it easily.

novel rose
#

It would be nice to be able to get the intent from the payment method

#

true... that would help for new data, not existing data

shy kraken
#

Yep, you would need to backfill the existing data by going through every Intent.

novel rose
#

:S

#

Since I already have you ear and I will be tackling this next, what is the best way to track a payment method failure?

Lets say a card is expired, you dont have credit card limit or a bank account does not have enough balance, which API should I be monitoring for those errors to be able to display them to the user?

This would all be off-session charges

shy kraken
#

Who is "the user" in this scenario if these are off-session charges?

novel rose
#

the user is the customer, they register payment methods with setup intents allowing us to do off-session charges. If anything wrong happens with a payment, we must show them that in our platform

shy kraken
novel rose
#

Cool! thank you!