Edit your credit card using Stripe checkout.js

Checkout from Stripe has a great way to add a credit card to a transaction by simply clicking StripeCheckout.open() .

Stripe checkout

Can I use .open() to change the map ? (passing in the card token)

Also, where can I download a non-reduced version of checkout.js to see the signature of the .open() method?

+8
stripe-payments
source share
2 answers

There is no way to edit the map in this way. What you can do is use Stripe Checkout to ask your customer about a new card without asking him to pay anything. The idea is not to set the amount or data-amount parameter.

 <form action="/charge" method="POST"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="pk_test_XXX" data-name="Demo Site" data-description="Update Card Details" data-panel-label="Update Card Details" data-label="Update Card Details"> </script> </form> 

You will receive a new card token for this new card, and then you can use the Update Client API to save the new card from the client.

Regarding your second question, unfortunately, the incomplete version of Checkout.js is currently not available.

+11
source share

Try http://unminify.com/ to view the incomplete version of the check.

I first saw it today. If you have an application in which users are logged in, you can do this using the special Checkout integration (the simple integration above) found here https://stripe.com/docs/checkout#integration-custom

On the server side, you will receive the client through the Stripe API. From the associated user example, you can pass the received identifier via Checkout through the session data so that it knows which client to update here:

 $('#customButton').on('click', function(e) { // Open Checkout with further options handler.open({ name: 'Your Company Name', email: customer_email, id: customer_id, zipCode: false, }); 

I have not tested this yet, if I have a chance, I will report.

+1
source share

All Articles