Stripe Adapter

amerta


amerta / Stripe Payment Adapter / StripeAdapter

Variable: StripeAdapter

const StripeAdapter: PaymentAdapter

Defined in: amerta/payload/payments/gateway/stripe.ts:79

Stripe Payment Adapter

Remarks

This adapter implements the PaymentAdapter interface to handle credit card payments via Stripe. It supports both frontend (Client Secret) and backend payment processing with automatic webhook setup.

Features

  • PCI-compliant credit card processing
  • Support for multiple payment methods (cards, wallets, etc.)
  • Automatic webhook creation and management
  • Multi-currency support with zero-decimal currency handling
  • Duplicate transaction detection
  • Server-side payment intent management
  • Currency conversion with exchange rates

Configuration

  • slug: "stripe"
  • label: "Credit Card (Stripe)"
  • Settings: Publishable key, secret key, webhook ID, webhook secret

Payment Flow

  1. Frontend creates/updates payment intent using client secret
  2. User completes payment on frontend with Stripe Elements
  3. Stripe sends webhook to confirm payment
  4. Backend processes webhook, verifies transaction, and updates order
  5. User is redirected to order confirmation page

Webhook Events Handled

  • payment_intent.succeeded - Payment successfully completed
  • payment_intent.payment_failed - Payment failed
  • charge.refunded - Payment refunded