#manu32 - CC Tokens
1 messages · Page 1 of 1 (latest)
Hi
My first read of this scenario is that you need to attach the token to the customer before you can use both together
@slate siren Thank you so much for your reply
I'm new to stripe
Can you please guide me
I'm looking for the right doc
Okay first, using tokens is very outdated. If you want to collect payment info to be saved to a customer we recommend using a Setup Intent. If you want to charge the user AND save payment method details you can use a Payment Intent
- Setup Intent: https://stripe.com/docs/payments/save-and-reuse
- Payment Intent with saved Payment Method: https://stripe.com/docs/payments/save-during-payment
Tell me what is complex about Payment Intents to you?
Yes Sure
They are more safe and secure so I want to make sure you feel you can use them effectively
my be because I'm new and my understanding is less
any way I'm explaining
I'm working on car sharing app and on submit reservation I need to deduct payment
for that If I go with token way I
I will collect reservation ID with token and do some process on the backend side
this is what i'm trying to do
in Payment Intent way
I need to create payment intent and return to front-end
and I'm unable to figure out how front-end and back-end will communicate
Give me some time
I need to write it properly
Okay so let's start off with the basics. Do you have a back-end or server that is hosting the app you wish to build?
while creating payment intent, we need some reservation data to associate with. how will we create this association? because before submit the reservation, our current reservation object is stored in reservationCache, not in Reservations collection
okm
Yeah let's zoom out and make sure we have the basics covered
sure
- Do you have a back-end server and if so, what programming language are you using?
JavaScript
As in Node.JS?
Yes
Okay, off to a great start. So have you already integrated the Stripe library for node?
Yes
I already did with payment intent
but due to I'm unable to figure out how the properly design the flow
Okay and your front-end can make requests to your back-end and receive responses, yes?
yes
my issue is reservation have some timeout time
like reservation could be invalid at some point of time
and if user may the payment in that time
you can think like a race condition
while deleting the reservation, at the same time, user can be in the process of payment for
Okay so in that case you would need to cancel the Payment Intent when that threshold is reached:
https://stripe.com/docs/api/payment_intents/cancel
And your integration would need to handle that race condition. Like looking up the expiration time and blocking the user from completing payment.
interesting
I'm checking
Thank you so much @slate siren for the support
I need to check this and apply on my use case
Can I open same thread of chat again If i need your help
Okay great. Feel free to ask any other questions you may have about using Payment Intents to capture card details and process charges.
You can ask that this one be un-archived if you come back and it is archived.
I have one more question
but is this mean
no additional charges means? no extra additional charges? or all previous charges will be deleted also
it is written on documentation
What is the context here? Could you direct me to a specific part of the docs?
sure
Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status=’requires_capture’, the remaining amount_capturable will automatically be refunded.
Right. A payment intent can be already have made a charge by this point. What this means is that any charges not already processed will not go through.
You too 🙂