Reputation: 1829
Hi i have been using stripe for the first time in my project where i ask user to provide their Credit card details for payment & i generate stripe token and charge the customer. I have provided a checkbox where customer can save the card details for future transactions & the requirement by the client is that if checkbox is checked, the details have to be saved once the payment successfully done. I am only getting the stripeToken in the processing via POST method and not the card details. Is it possible to get the card details back from the stripeToken in programming way or what can be an equivalent & convenient option to do it?
I tried adding the name attribute to the fields required by stripe for the token generation but in the form POST it is coming empty.
Upvotes: 0
Views: 2501
Reputation: 355
When the checkbox is checked you can use the token to create a new customer (or update if it already exist ). Into the link of @vher2 you can find an example to follow.
EDIT:
Inside the token generated from Stripe.js do you have all the information you need. See the Example Response into Api Stripe of token creation.
Upvotes: 0
Reputation: 486
Stripe Only provides the Last 4 Digits of the card . You can save the CustomerId provided by the Stripe API that can be used later for payments,
Upvotes: 0