#monove - save paymentmethod
1 messages · Page 1 of 1 (latest)
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
Any particular reason you are using the cards API and not the newer PaymentMethods API? Cards is our legacy flow
we've been with you for > 5 years
i see how it combines both but we have a huge API using the older flow
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?
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
Gotcha. You could consider, after a successful payment, setting that card as the customer's default: https://stripe.com/docs/api/customers/update#update_customer-default_source
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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.
ok
Are you using the legacy Charges API as well?
Or already migrated to PaymentIntents?
for our terminal charges we use payment intents
Hello 👋
Taking over for codename_duchess here
Give me a moment to catch up