使用 Stripe checkout.js 编辑信用卡 [英] Edit a credit card using Stripe checkout.js

查看:31
本文介绍了使用 Stripe checkout.js 编辑信用卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Checkout from Stripe 提供了一种为交易添加信用卡的好方法,只需调用 StripeCheckout.open().

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

是否可以使用 .open()编辑卡片?(传入卡片令牌)

Is it possible to use .open() to edit a card? (passing in the card token)

另外,我在哪里可以下载 checkout.js 的非缩小版本以查看 .open() 方法签名?

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

推荐答案

没有办法以这种方式编辑一张卡片.您可以做的是使用 Stripe Checkout 向您的客户索要新卡,而无需他支付任何费用.这个想法是为了避免设置 amountdata-amount 参数.

There is no way to edit a card that way. What you can do though is use Stripe Checkout to ask your customer for a new card without asking him to pay anything. The idea is to avoid setting 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>

您将获得该新卡的新卡令牌,然后您可以使用更新客户 API 将新卡保存在客户身上.

You would get a new card token for that new card and you could then use the Update Customer API to save the new card on the customer.

至于您的第二个问题,很遗憾,目前没有可访问的 Checkout.js 的未压缩版本.

As for your second question, there is unfortunately no unminified version of Checkout.js accessible at the moment.

这篇关于使用 Stripe checkout.js 编辑信用卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆