Framework
A support rep can send a one-off payment link without creating a full sales order. Configure the provider, create the pay link and follow the transaction back into the admin. The successful browser return and the recorded payment status are worth checking separately.
The checkout module lives in the standalone @open-mercato/checkout package and adds Phase A pay links to Open Mercato. It is intentionally decoupled from sales: merchants can collect one-off payments through shareable URLs without creating quotes or orders.
For day-to-day operator workflow, see the Checkout Pay Links user guide.
fixed, custom_amount, and price_list pricing modespaymentGatewayServiceAdd the package and register it in the app module list:
// apps/mercato/src/modules.ts
{ id: 'checkout', from: '@open-mercato/checkout' }
After enabling the module, run migrations and yarn generate when you add or modify auto-discovered module files.
Use templates when you repeat the same payment setup:
Create a pay link directly or from a template. The link form supports:
On the create-link form itself, users can also search and apply a template as a starting point without leaving the page.
Links start in draft, can be previewed, and become public only after they are published.
Transactions are read-only in admin. Users with checkout.view can inspect status and gateway correlation. Users also need checkout.viewPii to see decrypted customer fields.
The public flow uses four endpoints:
GET /api/checkout/pay/:slugPOST /api/checkout/pay/:slug/verify-passwordPOST /api/checkout/pay/:slug/submitGET /api/checkout/pay/:slug/status/:transactionIdPassword-protected pay links sign a short-lived cookie-backed session. Set AUTH_SECRET or NEXTAUTH_SECRET in the app env when possible. If those are not configured, checkout falls back to JWT_SECRET, then TENANT_DATA_ENCRYPTION_FALLBACK_KEY.
The server remains authoritative for:
POST /submit requires Idempotency-Key to prevent duplicate transactions during client retries.
Checkout is intentionally customizable at the UI layer, but strict at the integrity layer. The module includes the following protections out of the box.
active status are publicly payable.draft and inactive links are not accepted on the public payment route.checkout.view.checkout.view, checkout.create, checkout.edit, and checkout.delete.checkout.view to inspect transactions.checkout.viewPii to see decrypted customer identity fields, submitted customer data, IP address, user agent, and stored legal-consent proof.HttpOnly, Secure, SameSite=Strict, and expires after one hour.AUTH_SECRETNEXTAUTH_SECRETJWT_SECRETTENANT_DATA_ENCRYPTION_FALLBACK_KEYPOST /api/checkout/pay/:slug/submit requires an Idempotency-Key header.organization + tenant + link + idempotency key.activeReservationCount transactionally.completionCount + activeReservationCount reaches maxCompletions.completionCount.pending or processing, checkout can refresh provider status through the payment gateway service before returning the latest result.checkout.viewPii is granted.passwordHash and gatewaySettings are excluded from checkout search indexing.Checkout can send:
Checkout uses the Communications Hub system email transport. Omit SYSTEM_EMAIL_PROVIDER or set it to resend for the Resend channel provider, or set SYSTEM_EMAIL_PROVIDER=ses for the Amazon SES channel provider.
Checkout email sender resolution follows the same precedence as the notifications system:
NOTIFICATIONS_EMAIL_FROMEMAIL_FROMADMIN_EMAILIf only ADMIN_EMAIL is configured, it is used as the sender fallback, so it must be a valid address accepted by your mail provider.
It also emits in-app notifications for:
Checkout exposes stable UMES surfaces for extension without forking the module.
data-table:payment_gateways.transactions.list:toolbaradmin.page:payment-gateways/transactions:aftercheckout.pay-page:header:beforecheckout.pay-page:header:aftercheckout.pay-page:description:aftercheckout.pay-page:customer-fields:beforecheckout.pay-page:customer-fields:aftercheckout.pay-page:pricing:beforecheckout.pay-page:pricing:aftercheckout.pay-page:summary:beforecheckout.pay-page:summary:aftercheckout.pay-page:legal-consent:beforecheckout.pay-page:legal-consent:aftercheckout.pay-page:submit:beforecheckout.pay-page:submit:aftercheckout.pay-page:payment:beforecheckout.pay-page:payment:aftercheckout.pay-page:help:beforecheckout.pay-page:help:aftercheckout.pay-page:footer:beforecheckout.pay-page:footer:aftercheckout.pay-page:gateway-widget:beforecheckout.pay-page:gateway-widget:renderer:beforecheckout.pay-page:gateway-widget:renderer:aftercheckout.pay-page:gateway-widget:actions:beforecheckout.pay-page:gateway-widget:actions:aftercheckout.pay-page:gateway-widget:aftercheckout.pay-page:form (behavior spot for onFieldChange, transformValidation, transformFormData, onBeforeSave, onSave, onAfterSave)page:checkout.pay-pagepage:checkout.success-pagepage:checkout.error-pagesection:checkout.pay-page.headersection:checkout.pay-page.descriptionsection:checkout.pay-page.summarysection:checkout.pay-page.pricingsection:checkout.pay-page.paymentsection:checkout.pay-page.customer-formsection:checkout.pay-page.legal-consentsection:checkout.pay-page.gateway-formsection:checkout.pay-page.helpsection:checkout.pay-page.footersection:checkout.success-page.contentsection:checkout.error-page.contentcrud-form:checkout:linkcrud-form:checkout:templatedata-table:checkout-linksdata-table:checkout-templatesdata-table:checkout-transactionsCustomization stops at payment-critical boundaries. Extensions can change layout and presentation, but they must not replace the server-side pricing, consent, password, or transaction-reconciliation rules.
Checkout relies on the additive provider-descriptor surface from payment_gateways, not on provider-specific code. Gateway packages must publish safe descriptors that expose:
embedded, redirect, either)requiresPayerFields), when the provider cannot create a session without payer dataWhen the selected provider declares requiresPayerFields, the template and link create/update commands reject the save with a 422 field error on gatewayProviderKey (checkout.validation.gatewayProviderKey.payerFieldsNotCollected) unless customer details are collected and each mapped customer field is required: email → email, name → firstName and lastName. Updates validate the merged (stored + submitted) state, so an already-misconfigured link keeps working at payment time but must be fixed on its next save. The editor shows the same rule as an inline warning in the payment section.
Checkout reads these descriptors through the descriptor service and the safe provider endpoints in payment_gateways. Credentials stay owned by the gateway package and its integration records.
Provider-owned browser payment UI is auto-discovered from widgets/payments/client.tsx in each gateway package. Checkout never imports Stripe, PayU, or other provider UI directly; it resolves provider widgets through the shared payment renderer registry using the clientSession returned by the payment gateway layer.
Create a test link with a configured provider. Open it in a separate browser session, check the amount and required payer fields, then follow the payment through the provider's test environment. Verify the resulting transaction in the back office.