Edit a credit card using Stripe checkout.js

前端 未结 2 1738
无人及你
无人及你 2021-02-05 19:35

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

<

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 19:54

    Try http://unminify.com/ to see an unminified version of checkout.

    I saw this done for the first time today. If you have an app where users log in, you should be able to do it with a custom Checkout integration (the above is the simple integration) found here https://stripe.com/docs/checkout#integration-custom

    On the server side you would retrieve the customer via Stripe's API. From the linked custom example, you can pass the retrieved ID through to Checkout via session data so it knows which customer 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 yet tested this, if I get a chance I'll report back.

提交回复
热议问题