A crypto payment return URL should bring the buyer back to an order, not turn a browser visit into proof of payment. Build the confirmation page around your server's verified order state and the visitor's permission to view it. Never unlock a purchase because the address contains a success flag.
A buyer may refresh the page, paste its URL into another browser or never return from the payment page at all. These paths must lead to the same fulfillment decision. The design below is merchant-side guidance, not a claim that Yolfi provides your order portal, access controls or delivery system.
Separate the return URL from payment confirmation
The Yolfi Checkout Sessions API documents successUrl as a redirect after confirmed payment and cancelUrl as the return destination when checkout is cancelled. The success URL supports the {CHECKOUT_SESSION_ID} placeholder. These fields describe browser navigation; a visitor can still open your destination independently.
The checkout lifecycle reference also distinguishes a Checkout Session from its Invoice. Session status COMPLETED means an Invoice was linked, not that payment has been confirmed. It directs merchants to verified, idempotent payment.confirmed processing for fulfillment, rather than the redirect.
Keep three responsibilities separate:
| Component | Responsibility | Must not do |
|---|---|---|
| Return page | Identify an authorized order and show its current state | Declare payment from a query parameter |
| Payment processor in your application | Verify the documented confirmation and update the order once | Depend on the buyer keeping a tab open |
| Delivery worker | Deliver an eligible paid order and record the result | Issue another item whenever the page reloads |
This separation also matters when the buyer uses USDC or USDT: selecting a familiar stablecoin does not make the browser an authoritative payment channel. Offer only asset and network combinations enabled in your actual payment flow.
Bind the session to an order before redirecting
Create your order and store the agreed price on the server before opening checkout. Save the resulting Checkout Session ID against that order, along with the merchant order reference and Invoice ID when available. The server-pricing guide covers the price boundary; this page focuses on what happens after navigation back.
When the browser returns with a session reference:
- Validate the reference's format and length before using it in a lookup.
- Find the stored attempt in your own order records.
- Check that the current visitor is authorized to see that order.
- Read the order's verified payment and delivery states on the server.
- Return only the information that visitor needs to continue.
Do not accept a browser-supplied amount, customer identifier or paid flag as a replacement for the saved record. If a buyer edits the reference to another valid session, authorization must still prevent access to the other order. Keep merchant API credentials and authenticated payment-service requests on the server; do not expose them through the return page.
Treat the order reference as a locator, not permission
A random-looking session or order ID is not a login. The OWASP guidance on direct object references recommends object-level access checks even when identifiers are difficult to guess.
For signed-in buyers, scope the order lookup to the account or organization they may access. Recheck access on the page and on every status, receipt or download endpoint it calls. Hiding a button is not authorization.
For guest purchases, use a separately designed, narrowly scoped access mechanism. For example, your application can issue a short-lived opaque token limited to viewing one order's status, with a recovery path through the buyer's verified contact channel. This is an application design option, not a documented Yolfi feature. A payment-session ID alone must not grant access to private invoices or downloads.
If the visitor has lost access, offer sign-in or controlled recovery without disclosing whether another person's order exists. A public page can show a generic explanation, but it should not reveal customer names, email addresses, full payment records or delivery links.
Keep redirect destinations under server control
Choose the production return destination from your server configuration, not a destination submitted by the browser. If different products or locales need different pages, map an approved internal destination key to a fixed route.
The OWASP redirect prevention guide favors server-side destination mappings. Where external destinations are necessary, validate the parsed scheme, host and port against an explicit allowlist, and constrain the path where appropriate. A string that merely begins with your brand name is not sufficient validation.
Apply that policy to both success and cancellation destinations and to any onward navigation your return page accepts. Keep test environments separate from production destinations. Do not build a route that accepts an arbitrary next destination and forwards buyers there.
Leave private order details and access secrets out of redirect URLs. Where a guest-access token must travel in a link, treat it as a credential: scope its authority, limit its lifetime and prevent it from entering analytics or routine logs. The payment privacy guide covers the wider data trail beyond this return-page boundary.
Show payment and delivery as different states
A page called “success” can still need to show that your application is checking the order. Use text based on the verified server record, not the route name. These are suggested merchant-side messages, not Yolfi API status names.
| Verified application state | Useful buyer message | Appropriate action |
|---|---|---|
| No confirmed payment recorded | We are checking this payment | Refresh status without requesting another transfer |
| Payment confirmed, delivery queued | Payment received; delivery is being prepared | Show the order reference and next step |
| Payment confirmed, delivery failed | Payment received; delivery needs attention | Retry delivery internally and provide assistance |
| Order delivered | Your order is ready | Show only the authorized receipt or access route |
| Payment state unavailable | We cannot retrieve the latest status yet | Offer a bounded retry and a contact route |
An unavailable lookup is not the same as an unpaid order. Do not display a fresh payment button just because your status request timed out. If funds may already have been sent, direct the buyer to the existing attempt or assistance, not an automatic second payment. Use the pending-confirmations checklist for investigation.
Bound automatic polling, stop it when the page is no longer active and provide a manual refresh. Use a private, non-shared cache policy for personalized order responses. A shared cached confirmation must never show one buyer's details to another.
Let fulfillment finish without the return visit
Process verified payment confirmation independently of the return page. Persist the paid-order transition and the delivery task durably, and make repeated processing safe. The webhook idempotency guide covers duplicate notifications; refreshing the return page must not bypass the same protections.
A browser request that displays order status should be read-only. It should not grant access, send funds, mark an order paid or start another delivery simply because a visitor loaded the URL. If an authorized buyer explicitly requests a delivery retry, keep it a separate protected action that checks the current order state.
Record a return-page view separately from a verified sale. Otherwise, reloads can inflate conversion reports and a buyer who closes the browser can disappear from them. Keep purchase reporting tied to the verified order transition, without leaking guest tokens or private order data to analytics.
For a simpler payment-link flow, start with Yolfi payment links and the return options actually available in your setup. The same rule applies: a thank-you page is presentation, not a replacement for payment verification.
Test the return boundary before launch
Use controlled test orders and application fixtures. These tests do not require sending a real payment for every failure case.
| Test | Required result |
|---|---|
| Open the return route without paying | No paid status or delivery is created |
| Change the reference to another buyer's valid order | No private order details or access are returned |
| Refresh or reopen a paid order | The same state appears; no duplicate delivery |
| Confirm payment while the browser is closed | Fulfillment still proceeds through the verified server path |
| Return before the local order update is visible | Show checking or pending, then the current verified state |
| Open the cancellation route after sending funds | Check the original attempt; do not mark it unpaid from navigation |
| Supply an unapproved onward destination | Reject it or use a fixed safe destination |
| Repeat the request through a shared cache | No other buyer's personalized response is exposed |
Also test an expired guest-access token, a payment lookup outage and a delivery failure after payment. Verify both what the buyer sees and what changed in your order records. A reassuring screenshot is not enough if the underlying order was delivered twice.
FAQ
Does a success URL prove a crypto payment succeeded?
No. Even when the payment service redirects after confirmation, a visitor can open your page directly. Read the authorized order's verified server state before displaying payment success or access.
Is a cancellation return proof that no funds were sent?
No. Navigation cannot reverse a transfer or establish the current payment state. Reconcile the existing attempt before offering a replacement payment.
Can the return page call the merchant API from the browser?
Do not put merchant API credentials in browser code. Use your server to make authenticated requests and expose only a minimal, access-controlled status response for the buyer.
What if the buyer never returns to the site?
Verified payment processing and delivery must still work. Let the buyer resume through an authorized order page or a controlled recovery channel rather than requiring the original redirect.
Conclusion: return to an order, not a promise
A dependable return flow has a stored payment-to-order binding, object-level authorization, controlled destinations and truthful status messages. Its browser page reads state; verified server processing determines payment and delivery. Test direct visits, missing visits and repeated visits before calling the page a confirmation.
