Overview
TheStripeAdapter implements the PaymentAdapter interface to process payments through Stripe’s API. It supports cards, bank transfers, and digital wallets across 40+ countries and 20+ currencies.
Class Signature
Constructor
Configuration
Stripe secret API key (starts with
sk_test_ or sk_live_).Required. Throws VaultConfigError if not provided.Stripe webhook signing secret for signature verification (starts with
whsec_).Optional. Required if using handleWebhook() method.Custom Stripe API base URL.Default:
"https://api.stripe.com"Request timeout in milliseconds.Default:
15000 (15 seconds)Custom fetch implementation for testing or special network requirements.Default: global
fetchConfiguration Example
Supported Capabilities
Payment Methods
Credit and debit cards via Stripe’s card processing network.Supports tokenized cards and raw card details (PCI-compliant environments only).
Bank transfers using Stripe’s customer balance API.Available in select markets with ACH, SEPA, and other local bank transfer methods.
Digital wallets including Apple Pay, Google Pay, and other Stripe-supported wallets.Requires wallet-specific integration and tokenization.
Supported Currencies
23 currencies including:- Americas: USD, CAD, MXN, BRL
- Europe: EUR, GBP, CHF, SEK, NOK, DKK, PLN, CZK, HUF, RON, BGN
- Asia-Pacific: JPY, AUD, NZD, SGD, HKD, INR, MYR, THB
Supported Countries
42 countries across:- North America (US, CA)
- Europe (EU27 + UK, Switzerland, Norway)
- Asia-Pacific (JP, AU, NZ, SG, HK, MY, IN, TH)
- Latin America (MX, BR)
Methods
Implements allPaymentAdapter interface methods:
charge()- Creates a Stripe Payment Intent with automatic captureauthorize()- Creates a Payment Intent with manual capturecapture()- Captures an authorized Payment Intentrefund()- Creates a Stripe Refundvoid()- Cancels an uncaptured Payment IntentgetStatus()- Retrieves Payment Intent statuslistPaymentMethods()- Returns available Stripe payment methodshandleWebhook()- Verifies and processes Stripe webhook events
Webhook Events
The adapter maps Stripe webhook events to VaultSaaS event types:| Stripe Event | VaultSaaS Event |
|---|---|
payment_intent.succeeded | payment.completed |
payment_intent.payment_failed | payment.failed |
payment_intent.processing | payment.pending |
payment_intent.requires_action | payment.requires_action |
charge.refunded | payment.refunded |
charge.dispute.created | payment.disputed |
charge.dispute.closed | payment.dispute_resolved |
payout.paid | payout.completed |
payout.failed | payout.failed |
Webhook Verification
Stripe webhooks are verified using HMAC-SHA256 signatures with timestamp validation:- Signature header:
stripe-signature - Timestamp tolerance: 5 minutes
- Signature format:
t={timestamp},v1={signature}
Status Mapping
Stripe Payment Intent statuses are mapped to VaultSaaS statuses:| Stripe Status | VaultSaaS Status |
|---|---|
succeeded | completed |
requires_capture | authorized |
requires_action | requires_action |
processing | pending |
canceled | cancelled |
requires_payment_method | declined |
requires_confirmation | pending |
| Other | failed |