MonCash never redirects back to my site after payment

posée 3 months ago525 vuesen

0

The customer pays successfully (they even get the SMS), but they stay on the MonCash page or land on a MonCash success screen. My return URL is never hit. Where do I set the return URL in the request?

Diagnostic IA

Généré par IA. Ce n'est pas une réponse — la communauté ci-dessous le confirme ou le corrige. Vérifiez toujours avant de vous y fier.

posée 3 months ago

1 réponse

7
✓
✓ Réponse acceptée

You don't set it in the request. The return URL (and the alert/notification URL) are configured in the MonCash merchant portal, per business account and per environment. If they're empty or wrong, MonCash has nowhere to send the customer.

Checklist:

  1. Portal settings: open the business dashboard for the same environment (sandbox or live) you're testing and set the return URL, e.g. https://shop.example.ht/moncash/return.
  2. It must be reachable from the internet. http://localhost:3000 works only if the redirect happens in your browser. For the alert URL, which MonCash calls server to server, localhost never works. While developing, expose your machine with a tunnel (Cloudflare Tunnel or ngrok) and put the tunnel URL in the sandbox settings.
  3. Use HTTPS in production, with a valid certificate.
  4. Don't depend on the redirect alone. Customers close tabs and phones lose connection mid-payment. Also run a background check that looks up orders still "pending" after a few minutes with RetrieveOrderPayment, so a paid order never stays unpaid in your system.

Connectez-vous pour dire si ça a marché.

answered 3 months ago

Sign in and verify your email to post an answer.