#learner-savedcards
1 messages · Page 1 of 1 (latest)
@leaden plank you'd use https://stripe.com/docs/api/payment_methods/list to get the customer's saved cards, the returned objects have details like the brand/last4 that you can display in your UIs.
Is it possible to get last four digits of the credit card from confirmCardSetup so that we can save that in our DB against the customer?
or you could mirror the information in your database after the customer saved the card and query that instead
sure, but you'd do it on the backend server, not really with the result of confirmCardSetup
what I would do is POST the SetupIntent ID to my backend server when the Promise resolves. Or POST the result.setupIntent.paymentMethod (https://stripe.com/docs/js/setup_intents/confirm_card_setup), that works too.
then have it retrieve the PaymentMethod (https://stripe.com/docs/api/setup_intents/object?lang=php#setup_intent_object-payment_method) and you can get all the details of it.
Thanks @south heron
How do I see all the chats archived here in this channel for my queries?
hmm, not sure. I think searching in:#dev-help from: learner#9858 in the Discord search bar will get most of them
In which case does Stripe not saves the credit card but just uses it for one time transaction? Do you know if there is any legal rule to not save the credit card without asking for permissions etc ?
@leaden plank
In which case does Stripe not saves the credit card but just uses it for one time transaction?
you control that — if you don't use a Customer object and save the payment method it's one time use only.
so e.g. https://stripe.com/docs/payments/accept-a-payment is a one-time payment with no ability to charge the customer again without recollecting their info, while https://stripe.com/docs/payments/save-during-payment is augmenting that with also saving the card so you can charge that saved card again
Securely accept payments online.
Learn how to save card details during a payment.
re "legal rules" I think that depends on your own country/business. I don't know much about it unfortunately and we don't directly document much about this topic.
https://support.stripe.com/questions/updating-your-terms-and-conditions-to-make-sure-customers-have-been-given-a-mandate-to-collect-recurring-payments-for-strong-customer-authentication-sca-purposes is probably the most useful thing!
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
When we setup a new customer and save his card details, what all things do we need to save in our DB for future transactions(any IDs etc)
At least the customer ID cus_xxx of the Stripe object.