PaymentProvider interface from the Payments Module using the Stripe REST API. When you configure a signing secret, it verifies Stripe’s timestamped HMAC-SHA256 Webhook signatures.
Source: modules/stripe · npm: @86d-store/stripe
Installation
config.json:
STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET in the server environment. The generator passes those values to the current provider factory. Do not put secret keys in source, config.json, browser variables, or Store Admin fields.
Configuration
string
required
Your Stripe test secret. Keep it in the server environment.
string
Stripe test-event signing secret. When provided, incoming requests use Stripe’s HMAC-SHA256 verification and timestamp tolerance.
PaymentProvider API
StripePaymentProvider implements the PaymentProvider interface. Use it directly when you need to create or manage payment intents in server-side code.
createIntent
Creates a Stripe PaymentIntent and returns a clientSecret in providerMetadata. Pass amount in the smallest currency unit (cents for USD).
confirmIntent
Confirms a PaymentIntent after the Shopper completes payment on the client side.
cancelIntent
Cancels an uncaptured PaymentIntent.
createRefund
Issues a full or partial refund. Omit amount for a full refund.
Status mapping
Store endpoints
Webhook setup
1
Set the environment variable
Add your webhook signing secret to your environment:
2
Register your endpoint in Stripe
In the Stripe dashboard, add a new endpoint:
3
Select events to listen to
Enable at minimum:
payment_intent.succeededpayment_intent.payment_failedcharge.refunded
How signature verification works
The webhook endpoint reads the raw request body before JSON parsing (required for HMAC integrity), then verifies theStripe-Signature header:
v1 signature from the header in constant time to prevent timing attacks. Requests with invalid or expired signatures (older than 5 minutes) return 401.
Verification uses the Web Crypto API and needs no external dependencies.
Types
PaymentProvider interface from @86d-store/payments: