Skip to main content

Payrexx

Payment plugin for Payrexx, a Swiss payment service provider supporting credit cards, TWINT, PostFinance, and more.

Installation​

Included in the all preset — registerAllPlugins() registers the plugin together with its webhook route.

To register it individually:

import { pluginRegistry } from '@unchainedshop/core';
import { PayrexxPlugin } from '@unchainedshop/plugins/payment/payrexx';

pluginRegistry.register(PayrexxPlugin);

Register before startPlatform(). At startup, the plugin enables the webhook route POST /payment/payrexx (path configurable via PAYREXX_WEBHOOK_PATH); the Express/Fastify connector mounts it on the Unchained HTTP server. If PAYREXX_SECRET is missing, initialization logs a warning and skips this plugin's adapter and route.

In your Payrexx dashboard, configure the webhook URL https://your-domain.com/payment/payrexx and enable transaction notifications.

Environment Variables​

VariableDefaultDescription
PAYREXX_SECRET-Payrexx API secret key (required; the adapter and route are skipped without it)
PAYREXX_WEBHOOK_PATH/payment/payrexxWebhook endpoint path
EMAIL_WEBSITE_URL-Base URL for redirects (e.g. https://shop.example.com)
EMAIL_WEBSITE_NAMEUnchainedShop name shown in the payment purpose
PAYREXX_SUCCESS_PATH/payrexx/successPath for successful payment redirect
PAYREXX_ERROR_PATH/payrexx/errorPath for failed payment redirect
PAYREXX_CANCEL_PATH/payrexx/cancelPath for cancelled payment redirect

Create Provider​

mutation CreatePayrexxProvider {
createPaymentProvider(
paymentProvider: {
type: GENERIC
adapterKey: "shop.unchained.payment.payrexx"
}
) {
_id
}
}

mutation ConfigurePayrexxProvider {
updatePaymentProvider(
paymentProviderId: "provider-id"
paymentProvider: {
configuration: [
{ key: "instance", value: "your-instance-name" }
]
}
) {
_id
}
}

Provider configuration:

KeyDescription
instancePayrexx instance name (required — the provider is inactive without it)

Payment Flow​

Follows the standard checkout flow. Payrexx specifics:

signPaymentProviderForCheckout(orderPaymentId: "...") creates a Payrexx gateway and returns it as a JSON string:

{
"id": "gateway-id",
"status": "waiting",
"link": "https://instance.payrexx.com/pay?gateway=..."
}

Redirect the user to link. After payment, the user is redirected back to EMAIL_WEBSITE_URL + PAYREXX_SUCCESS_PATH / PAYREXX_ERROR_PATH / PAYREXX_CANCEL_PATH, and the webhook checks out the cart server-side. Fallback — checkout with the gateway id:

mutation {
checkoutCart(paymentContext: { gatewayId: "payrexx-gateway-id" }) {
_id
status
}
}

Pre-Authorization​

Payrexx uses reservation mode: the payment is reserved (reserved status) at checkout, then captured on confirmOrder and released on rejectOrder:

mutation ConfirmOrder {
confirmOrder(orderId: "order-id") {
_id
status
}
}

Adapter Details​

PropertyValue
Keyshop.unchained.payment.payrexx
TypeGENERIC
Version1.0.0
Sourcepayment/payrexx/