stripe is there a function to use confirmCardPayment in serverside

47 Views Asked by At

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

There are 1 best solutions below

0
yuting On BEST ANSWER

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'}
);