我读过大部分条状付款的东西。他们说,首先给客户添加一张卡片,就意味着将卡片保存到客户手中,然后付款。但我的要求是使用卡付款,不需要将卡的细节保存在条上。
下面是我传递给客户id和条标记的代码,而不是卡片id(card_****)。
Stripe::Charge.create(
  amount: amount_in_cents, 
  currency: currency_code,
  customer: stripe_customer_id,
  source: stripe_token
)但是它抛出一个错误
获取错误,因为客户cus_*****没有ID为tok_*****的链接卡
我已经阅读了链接*,它告诉您,如果要同时使用params客户和源,那么源应该是卡id(card_****)。有没有其他的解决方案,如何使用?
发布于 2019-01-21 09:44:15
如果您不想使用您不需要使用的客户,只需直接收费支付令牌,并省略customer参数:
Stripe::Charge.create(
  amount: amount_in_cents, 
  currency: currency_code,
  source: stripe_token
)https://stackoverflow.com/questions/54284554
复制相似问题