#sweetpotato
1 messages ยท Page 1 of 1 (latest)
hi! generally you build that into your website, like you have the user create an account in your system and log into it, and in your user database you store the ID of the corresponding Customer object cus_xxx
our store user's ID(any primary key ) is matching with Customer object cus_xxx, and we store Customer object (cus_xx) in our database . right??
and one more question,,
if i save incorrectly Customer object (cus_xxx) in our database , we are going to expose another customer's card informations ?
Hi! I'm taking over this thread.
The Stripe API doesn't allow you to view or show the full card details of customers. But if one customer on your end is mapped to the wrong customer ID in Stripe, then yes it could create issues (like using the saved card of a different customer for a purchase).
๐ oh...finally...
I want my customers to use a card what they have previously used.
first i create Customer Object , create card with Customer Object at the time of confirm PaymentIntent? what point do i create user and card??
It depends, which Stripe integration are you using? Checkout Session, Payment Element + Payment Intent, something else?
i use Payment Element + Payment Intent.
And do you want to make a payment while saving the card, or you just want to save the card with no payments?
i want to make a payment while saving the cards
Then the classic flow is like this:
- Create a Customer object
- Create a PaymentIntent with
setup_future_usageto save the card https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage - Load the Payment Element
- Confirm the PaymentIntent
Note that if needed you can create the customer at the end.
is not disappear the PaymentIntent ?
What do you mean?
umm... "Create a PaymentIntent with setup_future_usage to save the card " means that i can confirmPayment success without entering my card number?
permanently
Yes, once the user entered their payment information and you confirmed the PaymentIntent, a PaymentMethod will be created. And if you set setup_future_usage, it means you can reuse that PaymentMethod.
thank you...
Happy to help ๐