stripe-payments - Stripe 充电多次

标签 stripe-payments

使用 Stripe.js , 我得到一个 card token然后我可以用来通过以下方式充电:

Stripe::Charge.create(
  :amount => 400,
  :currency => "usd",
  :card => "tok_103rC02eZvKYlo2C2RD5docg", # obtained with Stripe.js,
  :metadata => {'order_id' => '6735'}
)

我可以使用相同的 card token多次向客户收费还是 1 个 token /收费和任何后续收费,我将不得不获取一个新 token ?

最佳答案

好问题!当您以这种方式使用 token 时,它会立即被消耗掉,因此无法再次使用。但是,您可以改为提供该 token 作为 card在 Stripe 中创建 Customer 对象时的参数。然后,您可以对该客户执行多项收费。

  • https://stripe.com/docs/api#create_customer

  • 希望有帮助。
    拉里

    PS 我在 Stripe 的支持部门工作。

    关于stripe-payments - Stripe 充电多次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23096516/

    相关文章:

    node.js - 使用卡 ID strip 创建 token

    ruby-on-rails - 如何将 user.id 从一个 Controller 传递到另一个 "undefined method ` id' for nil :NilClass"

    javascript - Stripe : Use apple pay on the web for a subscription

    php - 我的 Stripe 付款工作正常。但现在我想从数据库中捕获

    stripe-payments - Stripe API : create customer and charge in one request

    javascript - 从 Parse.com 的 webhook 中包含的 ID 检索客户电子邮件

    CSS - 白框周围区域

    c# - 无需为订阅开具发票 - 在审核购买时创建发票

    php - 如何为单个客户ID添加多张卡并直接使用 strip 转账?

    javascript - 如何迭代 Stripe 集合 JSON