Skip to content

Return to shop

When the payer is finished, Paydot offers them a return to shop step. Following it redirects their browser to the callback URL you configured under Online Payments in the portal, with two query parameters appended.

RequirementDetail
Schemehttps only.
Length500 characters or fewer.
Query stringNot allowed. Paydot appends its own, and a second ? would produce an unusable URL.
FragmentNot allowed.
HostA dotted domain name, with an optional port.

A callback URL is mandatory. Online payments cannot be switched on until one is saved.

302 Found
Location: https://shop.example/paydot/return?paymentId=payment-id-...&data=order-9987
ParameterValue
paymentIdThe Paydot payment id. Use it to fetch the payment.
dataWhatever you sent as data when you generated the link.

Both values are URL-encoded. A data value containing & or = cannot break out and forge a second parameter, so decode both before use rather than pattern-matching the raw query string.

The redirect happens because the payer chose to follow the return step. Nothing else triggers it.

  • A payer who closes the tab, loses their connection or walks away never arrives, even though their payment may still complete perfectly well.
  • The callback carries no status and no signature. A request landing on your callback URL proves only that a browser followed a link.
  • The payer’s status when they return is whatever it is at that moment. They are sent back on any status, including PENDING, INCOMPLETE and UNKNOWN, because leaving is their decision and not something Paydot blocks until the bank has made up its mind.
  • If online payments are switched off, or the callback URL is cleared, the return step keeps the payer on a Paydot receipt instead. Payments already in flight when you change that setting do not come back to you.

The generate-link response contains only url — it does not tell you the payment id, because no payment exists yet. The payment is created when the payer initiates it. So store your data value against your own order when you generate the link, and record the paymentId the first time you see it, on this callback or on the webhook event.

app.get("/paydot/return", async (req, res) => {
const { paymentId, data } = req.query;
const orderId = data === "null" ? null : data;
const payment = await fetch(`https://pay-api.paydot.eu/payments/${paymentId}`)
.then((response) => response.json());
if (payment.status === "EXECUTED" || payment.status === "SETTLED") {
return res.redirect(`/orders/${orderId}/thanks`);
}
return res.redirect(`/orders/${orderId}/pending`);
});

Showing the payer a page is the job here. Releasing the order is the webhook’s job, and doing it in both places is safe only if that step is idempotent.