@bates-solutions/stripe API Reference - v2.2.1
    Preparing search index...

    Class PaymentsService

    Payments service wrapping Stripe PaymentIntents.

    const payment = await stripe.payments.create({
    amount: 1000, // $10.00 in cents
    currency: 'usd',
    paymentMethod: 'pm_card_visa',
    confirm: true,
    });
    Index
    • Cancel a payment.

      Parameters

      • paymentId: string

        PaymentIntent ID to cancel

      Returns Promise<PaymentIntent>

      The cancelled PaymentIntent

      const payment = await stripe.payments.cancel('pi_123');
      
    • Capture a payment that was authorized with capture_method: manual.

      Parameters

      • paymentId: string

        PaymentIntent ID to capture

      Returns Promise<PaymentIntent>

      The captured PaymentIntent

      const payment = await stripe.payments.capture('pi_123');
      
    • Create a payment (PaymentIntent).

      Parameters

      Returns Promise<PaymentIntent>

      Created PaymentIntent

      When input validation fails

      When the card is declined

      const payment = await stripe.payments.create({
      amount: 1000,
      currency: 'usd',
      customerId: 'cus_123',
      paymentMethod: 'pm_card_visa',
      confirm: true,
      });
    • Retrieve a payment by ID.

      Parameters

      • paymentId: string

        PaymentIntent ID

      Returns Promise<PaymentIntent>

      The PaymentIntent

      const payment = await stripe.payments.get('pi_123');