Stripe Payment: Save token and customer and make payment later from token

Instead of saving the token itself, I recommend creating a customer and saving your customer ID. You can then charge your customer at any time in the future. See our documentation on saving card details for later. In javscript file how we handle stripeResponseHandler and function stripeResponseHandler(status, response). You will need to create a function … Read more

Stripe checkout.js with coupons

Stripe Checkout does not currently support coupons. It’s not listed in the documentation, for either the button or the custom integration. One might wonder if there is some secret feature. However, using undocumented features, especially when it comes to your payment processor is a bad idea. Full stop. This being Stack Overflow – let’s keep … Read more

Creating stripe token using separate elements

From the Elements reference. element: the Element you wish to tokenize data from. The Element will pull data from other Elements you’ve created on the same instance of elements to tokenize. https://stripe.com/docs/elements/reference#stripe-create-token So you can initialize elements var elements = stripe.elements(); And then define / mount your fields var cardNumber = elements.create(‘cardNumber’); cardNumber.mount(‘#card-number’); var cardExpiry … Read more

Non-English texts in Stripe possible?

For further reference: While you can’t use human messages on stripe errors to be displayed directly on localized pages, you can take advantage of response.error.code to provide your own translations. var errorMessages = { incorrect_number: “The card number is incorrect.”, invalid_number: “The card number is not a valid credit card number.”, invalid_expiry_month: “The card’s expiration … Read more

How to add card holder’s name to Stripe checkout using Elements?

Elements does not support collecting the cardholder’s name at the moment. It focuses on collecting: Card number Expiration date CVC ZIP code (in some countries) If you want to collect the cardholder’s name you have to build your own field for the name and submit it to the API during token creation: var card_name = … Read more

tech