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

Interface Stripe Documentation

Overview

Interface Stripe provides a structured API for integrating Stripe payment processing into AntelopeJS applications. The interface wraps the official Stripe Node.js SDK and exposes functions for creating payment intents, completing payments, and reacting to payment status changes.

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. The IntentChangeContext interface carries a local flag that indicates whether the event originated from the current instance or from another node in a clustered deployment. This distinction allows you to avoid duplicate processing across instances.

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