Introduction
One typed runtime for independently published payment providers.
@payments-sdk/payments gives applications one configured interface
for provider checkout and verification while leaving HTTP routes,
persistence, and settlement in the application.
Install for Agents
npx skills add neplextech/payments-sdkAgents can load the project index at https://payments.neplex.dev/llms.txt or the full reference at https://payments.neplex.dev/llms-full.txt.
The boundary
The runtime does not know which providers exist. Install the provider
packages you need and pass their instances to createPayments():
import { fonepay } from '@payments-sdk/fonepay';
import { createPayments } from '@payments-sdk/payments';
const payments = createPayments({
providers: [
fonepay({
merchantCode,
secretKey,
username,
password,
}),
],
});The configured provider IDs and capabilities drive the resulting TypeScript surface. A provider that does not implement returns or webhooks does not add those namespaces to the inferred runtime.
Start here
Install the SDK
Build your first checkout
Provider architecture
Provider guides
Read the repository README
What the runtime owns
@payments-sdk/payments validates normalized payment inputs, selects
a configured provider, supplies the runtime fetch and clock, and
returns normalized actions and statuses. It does not create HTTP
routes, store payment records, or decide when an order is fulfilled.
The application owns those boundaries. A typical flow is:
- Create an application payment record and a payment intent.
- Call
payments.checkout()and execute the returned action in the browser. - Accept the provider's return or webhook in an application route.
- Call
payments.verify()where the provider supports it. - Persist settlement idempotently and fulfill the order.
Important distinction
A browser return is a request to parse, not proof that an order is settled. Use a provider's verification capability before fulfilling an order, and make the final state change idempotent in your application's persistence boundary.