Search code examples
node.jsstripe-paymentsreact-stripe

stripe is there a function to use confirmCardPayment in serverside


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

Solution

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