#monove - save paymentmethod

1 messages · Page 1 of 1 (latest)

errant tartan
#

Hello. One moment

#

When you say storing a card to a customer, do you mean making that card the customer's default payment method? Curious what flow you're using because the card should be created under a customer

proper mortar
#

this is what we use to store cards. there are times when a customer wants to do 2 things in one API call: make a payment and store the card for later

#

the token we get comes from stripe elements

errant tartan
#

Any particular reason you are using the cards API and not the newer PaymentMethods API? Cards is our legacy flow

proper mortar
#

we've been with you for > 5 years

errant tartan
#

Ah ok makes sense

#

Was thinking you are building a new integration

proper mortar
#

i see how it combines both but we have a huge API using the older flow

errant tartan
#

Ok so just so I understand, you are storing a card to a customer before payment currently and want to switch to doing it after payment?

proper mortar
#

yes because it will almost guarantee to us that the card is valid. otherwise, we'd have have to delete the card if the payment fails. we only want the card stored if it can be charged

errant tartan
proper mortar
#

from that doc "Provide the ID of a payment source already attached to this customer to make it this customer’s default payment source."
I'm asking if theres a way to attach a token/id after the successful hold/payment

errant tartan
#

Unfortunately it's not exactly possible. However, the options are to charge the token tok_xxx directly , in which case you can’t attach it to a customer after the payment succeeds, or you could attach the token to a customer and then charge the customer. If the payment fails you would have to clean up manually by detaching the card.

#

However, with PaymentIntents, using customer and setup_future_usage do exactly what you want by only attaching the successful card to a customer after a few attempts.

proper mortar
#

ok

errant tartan
#

Are you using the legacy Charges API as well?

#

Or already migrated to PaymentIntents?

proper mortar
#

for our terminal charges we use payment intents

midnight cedar
#

Hello 👋
Taking over for codename_duchess here
Give me a moment to catch up