Skip to main content

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 KeyDescriptionIntegration TypePreset
shop.unchained.payment.stripeStripe PaymentsServer-sideall
shop.unchained.datatransDatatrans (Swiss PSP)Hosted checkoutall
shop.unchained.payment.saferpayWorldline SaferpayHosted checkoutall
shop.unchained.payment.postfinance-checkoutPostFinance CheckoutHosted checkoutall
shop.unchained.payment.payrexxPayrexx (TWINT, PostFinance)Hosted checkoutall
shop.unchained.payment.cryptopaySelf-hosted crypto paymentsServer-sidecrypto, all
shop.unchained.apple-iapApple In-App PurchaseNative SDKall
shop.unchained.invoicePay-per-invoice (B2B)Offlinebase, all
shop.unchained.invoice-prepaidPrepayment invoiceOfflineall

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.