Would PaymentIntent error out during creation if not enough funds or not payment method, etc?

huangapple go评论64阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月30日 05:18:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76360365.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定