英文:
Would PaymentIntent error out during creation if not enough funds or not payment method, etc?
问题
如果我通过Node.js像上面那样创建一个PaymentIntent,它会检查客户是否实际拥有足够的资源来履行这笔支付吗?
英文:
const stripe = require('stripe')(secret_key);
const paymentIntent = await stripe.paymentIntents.create({
customer: customer_id,
amount: 2000,
currency: 'usd',
automatic_payment_methods: {enabled: true},
});
If I create a PaymentIntent like the above via Node, will it check for whether or not the customer actually has the resources to fulfill this payment amount?
答案1
得分: 1
PaymentIntent需要确认(传递confirm: true
)才能尝试收取这个customer_id的款项。
请注意,不应在公共空间像这样分享您的秘密密钥,即使是测试模式下的密钥。
英文:
No. PaymentIntent will need to be confirmed (passing confirm: true
) to actually attempt to charge this customer_id.
Note that you shouldn't share your secret key, even a Test mode one, in a public space like this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论