问题
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:
- Using the
sourceparameter and nocustomerparameter. Thesourceparameter in this instance starts withtok_ - Using the
customerparameter, which will use the default card on file. - Using the
customerandsourceparameters, wheresourceis the card ID associated with the customer starting withcard_.
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:
- You create a card token
- You add the card to a customer
- You charge that card
- 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