All systems operational
View Categories

Switching from sandbox to live

3 min read

Quick answer #

Switching from sandbox to live takes about 10 minutes once your account is verified. You’ll need to: replace your test API keys with live keys, update any webhook URLs, run a small real test transaction to confirm everything works, and then switch your customer-facing checkout to live mode. The whole flow is designed to be reversible — you can flip back to sandbox at any time during testing without affecting real transactions.


Before you start #

Three things must be true before switching to live:

  • Your Pay@ Gateway account is verified. Check your dashboard — status must show “Verified”. If you see “In progress” or “Action required”, complete those steps first.
  • Your integration works end-to-end in sandbox. Place at least 5 test transactions covering: successful payment, declined card, 3D Secure flow, refund. If any of these fail in sandbox, they’ll fail in production too.
  • You have your live API keys ready. Available in your Pay@ Gateway dashboard under Settings → API Keys, on the Live tab.

Step 1 — Get your live API keys #

In your merchant dashboard:

  1. Go to Settings → API Keys
  2. Switch to the Live tab (it’s separate from the Test tab)
  3. Click “Reveal” next to each key — for security, live keys are hidden by default
  4. Copy both keys: the public key (pk_live_...) and the secret key (sk_live_...)

Important: the live secret key is shown in full only once. After you close the page, only the first few characters will be visible. If you lose the full key, you can regenerate it — but this will invalidate the old one, so any active integration breaks until updated.

Step 2 — Update your store’s plugin / integration #

For WooCommerce, Shopify, Wix users #

  1. Open the Pay@ Gateway plugin settings in your store admin
  2. Switch the plugin to “Live mode” or “Production mode”
  3. Paste the live public key and live secret key into the appropriate fields
  4. Save

The plugin will validate the keys immediately. If you see “Live mode active” or similar, you’re connected. If you see an error, check that you’ve copied the keys without missing any characters.

For custom API integrations #

Replace your environment variables on your production server:

PAY_AT_GATEWAY_PUBLIC_KEY=pk_live_xxxxxxxxxxxxxxxxxxxxxxxx
PAY_AT_GATEWAY_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
PAY_AT_GATEWAY_MODE=live

Restart your production server so the new variables load. Never deploy live keys to source control — use your hosting platform’s secrets management.

Step 3 — Update your webhook URL #

If your sandbox webhook URL was pointing to a dev/staging server, update it to your production server:

  1. Pay@ Gateway dashboard → Settings → Webhooks
  2. Update the Live webhook URL to your production endpoint (e.g., https://yourstore.co.za/webhooks/pay-at-gateway)
  3. Click “Send test event” — Pay@ Gateway will fire a sample event to confirm the URL is reachable
  4. Confirm your server returns a 200 OK response

If the test event fails, the issue is on your server side (firewall, SSL certificate, plugin order). Fix this before going live — webhook failures cause orders to stay in “pending” status.

Step 4 — Run a live test transaction #

This is the most important step. Do NOT skip it.

  1. Use a real card to make a small purchase from your store (the team usually uses R10 or R50 for this)
  2. Confirm the payment completes successfully
  3. Confirm the order shows up in your store’s order management
  4. Confirm the transaction appears in your Pay@ Gateway dashboard
  5. Refund the test transaction from your dashboard
  6. Confirm the refund processes successfully

If all four steps work, you’re production-ready.

Step 5 — Switch your customer-facing checkout #

Until now, your customer-facing store may have still been showing test mode (e.g., a “Test mode” banner). Remove this:

[PH-011]

Once live, the test mode banner disappears and customers see the normal checkout.

Reversing the switch (in development scenarios) #

If something goes wrong after switching to live and you need to roll back to sandbox quickly:

  1. Replace live keys with test keys in your plugin
  2. Switch the plugin back to test mode
  3. Update the webhook URL back to your dev/staging endpoint

This protects customers while you investigate. Real transactions made before the rollback still settle normally — they’re not affected.

Common things that break at go-live #

A few things that work in sandbox but trip up at the moment of going live:

  • Webhook URL still pointing to staging. Easy to forget when you switch keys but not URLs.
  • Live key in test mode plugin setting. Plugin rejects with environment mismatch — common toggle mistake.
  • 3D Secure not configured for live. Sandbox skips 3DS by default for some test cards; live requires it on every card transaction.
  • Production server can’t reach Pay@ Gateway API. Outbound HTTPS often blocked by corporate firewalls in fresh production environments.
  • Documentation for the older API version. Make sure your integration matches the latest spec at [PH-038].

Related articles #


Was this helpful? 👍 Yes / 👎 No
Still stuck? Chat to us on WhatsApp.

Updated on May 12, 2026