Skip to content

Mobile crypto checkout: wallet handoff and safe return

Design a mobile crypto checkout that survives wallet app switching. Preserve the payment attempt, refresh real status and avoid asking customers to pay twice.

MobileSafe return

A mobile crypto checkout should let buyers leave for their wallet and return to the same payment attempt, not a fresh request to pay. Treat app switching as an interruption to the interface, not evidence that a payment failed or succeeded.

This guide is for merchants and developers building the journey around a hosted payment page. It focuses on same-phone payment, browser restoration and recovery. The controls below are application recommendations, not a claim that Yolfi provides a native mobile SDK, universal wallet deep links or automatic recovery in every browser.

Map the handoff before choosing a wallet button

Write down the actual route: product page, merchant order, hosted checkout, wallet, checkout status and merchant confirmation. A buyer may return manually, use the browser's Back button or reopen the original tab. Your flow must have an understandable outcome even when an automatic return does not happen.

Yolfi API Checkout creates a hosted Checkout Session from a server-approved amount. The buyer chooses an available network and token, then Yolfi creates an Invoice. For a fixed-price offer, payment links provide a reusable entry point. Neither choice makes every mobile wallet or browser combination compatible; test the route you actually offer.

Keep the order, payment attempt and browser visit separate. Reloading a page is a new visit, not necessarily a new order or a reason to create another Invoice.

Give same-phone buyers a usable payment route

A QR code shown on the phone holding the wallet cannot rely on that phone's camera scanning its own screen. Do not make a second device the only practical way to proceed.

Use the hosted page's supported wallet action when available. If it offers manual transfer instructions, preserve the complete destination, exact amount, asset and network together with clearly labelled copy controls. Do not invent a wallet URL scheme or replace invoice instructions with the merchant's settlement address. Use the QR code guide when distinguishing a link to checkout from transfer data.

Before leaving the browser, make the next step explicit: review the payment in the wallet, then return to this order to check its status. Do not label wallet connection or a signature request as a completed payment. If the wallet cannot open, give a safe way back to the current instructions instead of repeatedly launching another payment attempt.

Save the attempt before handing control to another app

Persist the relationship between the customer's authorized order and the payment attempt on your server. Keep the hosted URL and provider references in protected application storage as appropriate; do not rely on an in-memory variable that disappears when a tab reloads.

For Yolfi, the Checkout lifecycle reference distinguishes merchantOrderId, checkoutSessionId and invoiceId. It also says a Checkout Session marked COMPLETED has been linked to an Invoice, whose payment may still be pending. Preserve those distinctions in your return page.

Recommended merchant-side records include:

  • The agreed order version and its customer authorization boundary.
  • The current attempt and its relationship to any earlier attempt.
  • The provider references needed for authenticated status lookup.
  • The last verified payment state and when it was checked.
  • A fulfillment result separate from the browser's current screen.

An order identifier in a URL is not authorization. Require an authenticated customer session or an appropriately protected guest-access mechanism before displaying private order details. Never place API credentials, wallet secrets or unnecessary personal data in a return URL.

Refresh status when the browser resumes

A page can look unchanged after an app switch while its displayed payment state is old. MDN's Page Visibility API guide describes visibility changes and background timer throttling. Do not assume a polling interval continued to run normally while the wallet was open.

On your own status page, use the transition back to a visible document as a reason to request current server-side order state. Also handle initial load and restoration: MDN documents pageshow for navigation, including history restoration and frozen mobile pages. That event alone does not prove the page is visible or a payment occurred.

Deduplicate overlapping refreshes, apply bounded retries and keep provider credentials on the server. If a status request fails, show that the current state could not be checked. Do not transform a network error into “payment failed.” Prevent an older response from overwriting a newer verified result.

These are controls for pages you own. Do not inject scripts into a hosted checkout or assume a merchant page can inspect the internal state of an external wallet.

Make the return screen truthful and useful

Separate navigation progress from payment and delivery:

Observed situation Useful customer message Safe next action
Buyer returned, current status not yet loaded Checking your payment status Retrieve the existing order state
No verified payment and the attempt is still payable Awaiting payment Show the current instructions
Transfer is being confirmed Payment is being confirmed; do not send again Refresh status without creating a new attempt
Payment verified, delivery still processing Payment received; preparing your order Resume the fulfillment job
Status service unavailable We cannot check the latest status right now Retry the lookup or contact support with the order reference

These are suggested application messages, not Yolfi API status names. For fulfillment, use verified server-side payment confirmation rather than a wallet return or successUrl. If the buyer sent funds but the order remains pending, follow the pending-confirmations checklist, not an immediate second-payment prompt.

Recover without silently replacing the invoice

When a buyer reopens an old tab, retrieve its existing attempt before offering a new one. A closed tab, disconnected wallet or expired browser login does not establish that no transfer was submitted.

If the attempt has expired, check its payment history and follow the expired-invoice procedure. Explain whether the original instructions remain usable under the provider's rules. Do not extend validity by changing only the countdown on screen or assume a new checkout cancels an earlier blockchain transfer.

For example, a buyer approves a transfer, loses mobile data and returns to a stale “awaiting payment” page. The safe recovery is to restore that order and check its existing payment. Creating a new address and telling the buyer to send again would hide uncertainty rather than resolve it. This is a failure scenario to test, not a customer story.

Test interruption paths on real phones

A narrow desktop viewport tests layout, not app switching. Use real devices for the browser-to-wallet boundary and controlled fixtures for payment-state failures. Do not make unnecessary real transfers to simulate every interruption.

Test Expected merchant-side result
Open the wallet, then cancel before sending Return to the same order without a false paid state
Approve payment and return manually Refresh the existing attempt; no duplicate request to pay
Lock the phone while checkout is open Resume with current status, not a timer-based assumption
Reload or restore the original browser tab Recover the stored order-to-attempt relationship
Lose connectivity during the return Show status uncertainty and a lookup retry
Reopen an older checkout after a newer attempt exists Identify which attempt is current and review earlier payments
Payment confirms while delivery is delayed Keep payment and fulfillment states distinct

Include iPhone Safari, the iPhone browser your audience uses, Android Chrome and any in-app browser that is a real entry point. Record operating system, browser and wallet versions, the exact failing step and the retest result. Passing in one wallet does not certify all wallets. Add these cases to your integration testing checklist.

FAQ

Does returning from a wallet mean the buyer paid?

No. The buyer may have connected, cancelled, signed a request or submitted a transfer that is still pending. Retrieve verified payment state before releasing the order.

Should reopening checkout create a new payment attempt?

Not by default. Look up the existing attempt first. Create a replacement only through an explicit recovery process that accounts for any earlier transfer.

Is mobile browser emulation enough?

No. It is useful for layout checks, but it does not reproduce a real wallet app, operating-system handoff, locked phone or restored browser process.

Conclusion: resume the order, not the request to pay

Keep the commercial order durable, preserve its payment references and refresh verified status after interruptions. Choose a fixed-price payment link or server-created Checkout Session for the sale, then test the complete mobile return path. A buyer should be able to learn what happened without being pushed to send funds a second time.

Start accepting crypto payments today

Connect a wallet, create your first link and get paid in minutes.

Business owner working at a laptop
Payment received+120.00 USDT