#dtfk

1 messages ยท Page 1 of 1 (latest)

unborn mothBOT
silver quartz
#

Hello ๐Ÿ‘‹
Tokens API is old and will be deprecated in future. You should really be using PaymentMethods API along with SetupIntents. It would allow you to save payment method details and charge them later on.
https://stripe.com/docs/payments/save-and-reuse

dreamy skiff
#

Hi

#

But in documentation they still provide Create Card token

#

๐Ÿค”

silver quartz
#

What docs are you referring to?

dreamy skiff
#

This one

silver quartz
dreamy skiff
#

Let me share a document with you, I just want to replicate it using Payment Intent api

#

Because our business model is using tokens

#

this one

silver quartz
#

which should work (haven't tested this myself recently, so would recommend testing it out in test mode to be 100% sure)

dreamy skiff
#

Actually the idea behind is that if we create card token & charge it using card token then we can use token only once

#

But if we create card token >>>> create customer with card token >>>> create charge using customer id
then we can charge the customer multiple times without asking card details again n again

#

But the thing is this is legacy api & I want to do it with Payment Intent Api

silver quartz
#

Right, the token becomes re-usable once you attach it to a customer

#

Have you tried creating a PaymentIntent by only providing a customer ID to see if it charges the attached source? Similar to how the guide does it

dreamy skiff
#

No, I havent tried it yet.

silver quartz
#

Give it a try and see if that works

dreamy skiff
#

And if it works, will it be considered as right way

silver quartz
#

yup

dreamy skiff
#

I m trying using cli

#

can u please levae this thread open for a while

silver quartz
#

Sure

dreamy skiff
#

Thanks

#

Yes its working with the test card

#

Please let me know one thing, now we can create card token using Create Card Token and can use anytime in future like after 90 days?

old hollow
#

I don't see an explicit expiration date for tokens but they are meant to be used very soon after they are created. I think it would be best to at least save the token as a PaymentMethod or source, those will be able to work indefinitely once saved

dreamy skiff
#

Hi @old hollow so here we were discussing about using Payment Intent API create card token >>>> create customer with card token >>>> create charge using customer id
then we can charge the customer multiple times without asking card details again n again

#

And i used stripe cli & replicated the methods create card token >>>> create customer with card token >>>> create charge using customer id

#

and its working

old hollow
#

Yep yep, once you have the card saved like that it should work in future

dreamy skiff
#

so plz tell me one thing can I save card details by generating the token

#

by just using Create Card Token method

#

or do I need to do whole process like setup intent?

old hollow
#

Using a SetupIntent is what you should do if you are starting your integration now. As hanzo mentioned, the Tokens API is older and more limited

#

Just creating a token won't save the card details long term necessarily, you could use a token to create a source or payment method, but using a setup intent will do the payment method creation for you and can make other parts of integrating this easier

dreamy skiff
#

correct?

old hollow
#

Yes, exactly

dreamy skiff
#

this creates payment method id

#

and we can use this payment method id again n again

#

Right?

old hollow
#

Correct!

dreamy skiff
#

Token API is going to deprecate?

old hollow
#

I don't think there are current plans for it but at some point it likely will. We don't recommend using it if you are starting with your integration now

dreamy skiff
#

ok

#

Thank u so much for all the help

#

๐Ÿ™‚

#

@old hollow one more thing

#

in this whole process we are not saving the actual card number & cvv. Right?

old hollow
#

Correct, Stripe is saving that info but your system never sees the CC info so you have less of a PCI compliance requirement

dreamy skiff
#

and in return its providing payment method id?

old hollow
#

Yes

#

You pass us the ID and we use the CC info that we have saved

dreamy skiff
#

Ok thanks a lot @old hollow