User guide
Connect the Autopay credentials for the environment you plan to use. Check the integration's health before making it available for customer payments.
This is a self-service integration: @open-mercato/gateway-autopay is a reusable provider package, not a bespoke integration tied to one merchant's account. To use it you register your own Autopay Partner Service and enter your own credentials – Open Mercato never ships or shares credentials on your behalf.
Caution
The Autopay documentation's own worked examples use ServiceID=2 and shared key 2test2 to demonstrate the hash calculation. These values only prove the signing math is correct – they will not authenticate against Autopay's sandbox or process a real session. You need your own registration.
| Field | Where it comes from |
|---|---|
| Service ID | Issued when you register at portal.autopay.eu |
| Shared Key | Issued alongside the Service ID – keep this secret |
| Hash Algorithm | SHA-256 by default; only change this if Autopay configured SHA-512 for your Service |
| Payment Initiation URL | The exact hosted-session URL Autopay gives you – never guess or reuse another merchant's URL. Must be under https://testpay.autopay.eu (sandbox) or https://pay.autopay.eu (production) |
Switch to the Health tab and click Run Check. Open Mercato probes Autopay's transactionStatus endpoint with a synthetic order ID that can never match a real transaction – this proves your Service ID, shared key, and gateway URL are valid without creating or affecting any real payment.
If the check fails, double-check that the Payment Initiation URL's host matches exactly https://testpay.autopay.eu or https://pay.autopay.eu, and that the shared key matches what Autopay issued for that Service ID.
After paying, Autopay sends the payer back to the return address configured on your Partner Service, appending ServiceID, OrderID and a signed Hash. Open Mercato ships a return page for this: it verifies the signature, reads the real payment status from Autopay, and sends the payer to the matching shop page (success or cancel).
Set the return address of your Autopay Partner Service to:
https://<your-shop-host>/api/gateway_autopay/return
Replace <your-shop-host> with the public host of your Open Mercato app. If you cannot find this setting in the Autopay portal, ask Autopay to set it for your Service. Without it, payers return to whatever address Autopay has on file and the shop's own success and cancel pages are not reached automatically.
If your deployment already knows the Autopay credentials, you can preconfigure the integration automatically instead of filling the credentials form manually after every fresh install.
Use these env vars:
OM_INTEGRATION_AUTOPAY_SERVICE_ID=your-service-id
OM_INTEGRATION_AUTOPAY_SHARED_KEY=your-shared-key
OM_INTEGRATION_AUTOPAY_GATEWAY_URL=https://testpay.autopay.eu/your-issued-path
OM_INTEGRATION_AUTOPAY_HASH_ALGORITHM=sha256
OM_INTEGRATION_AUTOPAY_ENABLED=true
OM_INTEGRATION_AUTOPAY_FORCE_PRECONFIGURE=false
To rerun the preset for an existing tenant:
yarn mercato gateway_autopay configure-from-env --tenant <tenantId> --org <organizationId>
/api/gateway_autopay/launch) that forwards them to Autopay with a signed POST, so their email address never appears in a link. The payer completes payment on Autopay's own page (bank transfer, BLIK, cards), then returns to your store through the return address. The launch link works for 30 minutes and only while the payment is still pending.transactionStatus API (used on the payer's return, or any time you want to check).transactionStatus (on payer return, or via your own polling) rather than by push.captured, nothing is counted as refunded yet, and providerData.refundStatus is pending. It does not confirm the final outcome, because a status check reports the original payment, not the refund. A refund that fails during Autopay's processing is reported by Autopay in its next-business-day report, so reconcile refunds there until a push-notification follow-up exists. Refunds also require your Autopay Partner Service to have settlement balance enabled – confirm this with Autopay if a refund is rejected unexpectedly.This provider implements the same GatewayAdapter contract as every other payment gateway. For building custom checkout flows or server-to-server integrations, see the Payment Gateways REST API reference – everything there (POST /payment_gateways/sessions with providerKey: "autopay", status polling, cancel/refund) applies the same way it does for Stripe.