[data-reveal]{opacity:1!important;transform:none!important}
Interface Stripe Documentation
Stripe

Interface Stripe Documentation

Overview

Create payment intents and react to their status through @antelopejs/interface-stripe. The package uses the official Stripe Node.js SDK; an implementing module supplies the configured client and payment-change events.

Choose a payment task

Your taskStart here
Start a browser checkoutComplete payment flow
Create an intent with your order IDInitializePayment
Reconcile success or cancellationWaitForPayment
React to status updatesEvent monitoring
Use an existing chargeable SourceCompletePayment
Call another Stripe APIGetClient

Configure a Stripe implementation, test credentials, and verified webhook delivery before using these examples. This page does not process payments. Keep secrets on the server and use Stripe test mode when trying a flow.

Installation

Install the interface as a dependency:

npm install @antelopejs/interface-stripe

Exports

The interface exposes the following public API:

ExportTypeDescription
GetClientFunctionReturns the initialized Stripe client instance.
InitializePaymentFunctionCreates a new payment intent and associates a custom payload ID.
WaitForPaymentFunctionWaits for a payment intent to reach a terminal state.
CompletePaymentFunctionCompletes a payment using a chargeable Stripe source.
WatchAllPaymentsFunctionRegisters a callback for all payment intent changes.
WatchPaymentFunctionRegisters a callback for a specific payment intent's changes.
IntentChangeContextInterfaceContext metadata attached to payment intent change events.

Key Concepts

Payment Intents

Every payment flows through the Stripe PaymentIntent object. The InitializePayment function creates a payment intent and stores a custom identifier in its metadata.payload field. This identifier links the Stripe payment intent back to your application-level entity (such as an order ID).

Event Monitoring

Payment intent status changes propagate through an internal event system. IntentChangeContext.local distinguishes events from the current instance from forwarded cluster events. Filtering forwarded events does not deduplicate webhook redelivery; make order updates idempotent and persist enough state to reconcile after a restart.

Terminal States

A payment intent reaches a terminal state when its status becomes either succeeded or canceled. The WaitForPayment function resolves on success and rejects on cancellation. Watcher callbacks registered with WatchPayment are automatically cleaned up once the intent reaches a terminal state.

Documentation Sections