Payment Plugins
Payment plugins integrate payment service providers with Unchained Engine. Built-in plugins are IPlugin objects that self-register their adapters, webhook routes, and database modules — register them via a preset or individually with pluginRegistry.register(...) before startPlatform().
| Adapter Key | Description | Integration Type | Preset |
|---|---|---|---|
shop.unchained.payment.stripe | Stripe Payments | Server-side | all |
shop.unchained.datatrans | Datatrans (Swiss PSP) | Hosted checkout | all |
shop.unchained.payment.saferpay | Worldline Saferpay | Hosted checkout | all |
shop.unchained.payment.postfinance-checkout | PostFinance Checkout | Hosted checkout | all |
shop.unchained.payment.payrexx | Payrexx (TWINT, PostFinance) | Hosted checkout | all |
shop.unchained.payment.cryptopay | Self-hosted crypto payments | Server-side | crypto, all |
shop.unchained.apple-iap | Apple In-App Purchase | Native SDK | all |
shop.unchained.invoice | Pay-per-invoice (B2B) | Offline | base, all |
shop.unchained.invoice-prepaid | Prepayment invoice | Offline | all |
Checkout Flow
All gateway plugins (Stripe, Datatrans, Saferpay, PostFinance Checkout, Payrexx, Cryptopay) share the same flow. The provider pages only document the provider-specific parts.
1. Get the order payment id of the active cart:
query {
me {
cart {
payment {
_id
}
}
}
}
2. Sign the payment — returns a provider-specific JSON string (client secret, redirect URL, payment addresses, ...):
mutation {
signPaymentProviderForCheckout(
orderPaymentId: "order-payment-id"
transactionContext: {} # provider-specific options
)
}
3. Process the payment client-side (redirect, SDK, or wallet transfer — see the provider page).
4. Webhook completes the checkout. The payment provider calls the plugin's auto-registered webhook route; Unchained validates the transaction and checks out the cart server-side.
5. Fallback: client-side checkout. If the webhook has not completed the checkout (e.g. it failed or is still in flight), call checkoutCart yourself with the provider-specific paymentContext:
mutation {
checkoutCart(paymentContext: { transactionId: "..." }) {
_id
status
}
}
This gives Unchained a second chance to process and settle the payment.
Creating Custom Payment Plugins
See Custom Payment Plugins and the registerPaymentProvider factory.