英文:
Do you have to store your products in Stripe to process payment
问题
Stripe是否要求产品在其系统中才能进行支付处理?根据他们的文档,我没有看到明确的答案,所以我不确定。
英文:
I'm building a new web application, and we have a system that manages our products already. Does Stripe require the products to be in their system in order to be able to handle the payment processing? I don't see a clear answer to this via their docs, so I'm unsure.
答案1
得分: 0
No. 在你向Stripe发起API请求以处理客户付款时,你需要传递一些关于价格、货币等基本信息。
价格 可以直接从你的数据库中获取,或者作为来自前端的变量传递。
令牌 是从前端传递的,包括客户的付款信息。
所以不需要将你的产品存储在Stripe中。
function createCharge(token, amount) {
return stripe.charges.create({
amount: amount * 100,
currency: 'usd',
source: token,
description: "..."
})
}
英文:
No. As part of the API request you make to stripe to process your clients payment, you need to pass some basic info about price, currency, etc.
The price you can simply retrieve from your DB, or pass as a variable from the FE.
The token is what is passed in from the FE, and includes the clients payment info.
So no need to store your products with stripe.
function createCharge(token, amount) {
return stripe.charges.create({
amount: amount * 100,
currency: 'usd',
source: token,
description: "..."
})
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论