Stripe有一个在服务器端使用confirmCardPayment的函数吗?

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

stripe is there a function to use confirmCardPayment in serverside

问题

在服务器端存在与confirmCardPayment等效的函数吗?

我需要在服务器端使用这个函数:

const confirmPayment = await stripe?.confirmCardPayment(data, {
  payment_method: paymentMethodReq?.paymentMethod.id
});
英文:

exists are function that is equavilent to confirmCardPayment but in serverside ?

I need this function in serverside:

      const confirmPayment = await stripe?.confirmCardPayment(data, {
        payment_method: paymentMethodReq?.paymentMethod.id
      });

答案1

得分: 1

Stripe在服务器上提供了与stripe.confirmCardPayment等效的Payment Intent Confirmation API。您可以在确认PI时在payment_method参数中设置支付方法ID(pm_xxx)。例如,

const paymentIntent = await stripe.paymentIntents.confirm(
  'pi_xxx',
  {payment_method: 'pm_xxx'}
);
英文:

Stripe provides Payment Intent Confirmation API at the server, which is equivalent to stripe.confirmCardPayment.

You may set the payment method ID (pm_xxx) in payment_method parameter when confirming the PI. For example,

const paymentIntent = await stripe.paymentIntents.confirm(
  'pi_xxx',
  {payment_method: 'pm_xxx'}
);

huangapple
  • 本文由 发表于 2023年4月20日 08:36:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76059751.html
匿名

发表评论

匿名网友

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

确定