Associate one-off Stripe payment token (tok_) with Customer object

◇◆丶佛笑我妖孽 提交于 2019-12-14 02:24:21

问题


Is it possible to associate a one-off Stripe charge/payment with a Stripe Customer profile but not save the card to the profile? I'd really like to organize my Customers and their purchases within the Stripe dashboard, but I can't see any way to do this. From what I can tell there are three ways to create a payment:

  1. Using the source parameter and no customer parameter. The source parameter in this instance starts with tok_
  2. Using the customer parameter, which will use the default card on file.
  3. Using the customer and source parameters, where source is the card ID associated with the customer starting with card_.

I've looked through the docs and can't see anything that alludes to being able to create a payment using customer and a tok_ source. Am I missing something here?


回答1:


This is not supported by Stripe at the moment. You can still do this though with a few steps:

  1. You create a card token
  2. You add the card to a customer
  3. You charge that card
  4. You delete the card from the customer

This ensures that you don't save the card but still have the charge associated with the right customer.



来源:https://stackoverflow.com/questions/43554371/associate-one-off-stripe-payment-token-tok-with-customer-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!