Payment API keys belong on the server in environment variables or a secrets store — not in code, not in the repository, not in messengers. A key can create payments on behalf of your store, so a leak is equivalent to access to money.
Where to keep them
- Environment variables on the server — the minimum acceptable option.
- A secrets store — once the infrastructure is more than one server.
- Never in the repository. Even a private repo is the wrong place: access is broader than it looks, and history keeps everything.
- Never in the browser. A secret key must not reach client-side code under any circumstances.
How keys work at MulenPay
Keys are issued in the dashboard, in the store section. The secret key is shown once — save it to your secrets store straight away, as the dashboard will not show it again. Alongside it an API key is issued for requests: the server that creates payments needs the API key, while the notification handler needs the secret key, which is never sent in API requests. Give each store or service its own key: revoking one will not stop the others. Platform modules keep the key in their settings on the site's server — keep those settings out of backups shared by email. The request and signature format is documented at docs.mulenpay.com.
Example: a Laravel store keeps the key in .env on the server and reads it through the app config; the file is in .gitignore, and staging holds a separate test store key. When a contractor finishes the job, the key is reissued in the dashboard and updated in .env — five minutes, and the contractor's access to live payments is gone.
Who should have access
The application needs the keys, plus one or two responsible people — not the whole team. A developer, a manager and an ad contractor should not share one secret. Lock down the dashboard too: staff permissions there deserve the same scoping.
If you suspect a leak
- Issue a new key and switch the application to it.
- Revoke the old one.
- Review transactions for the period the key could have been exposed.
- Work out how it leaked — otherwise it happens again.
Related
Integration details are on the payment API page. Never collect card numbers yourself — see what is PCI DSS; verifying notification signatures is covered in what is a webhook.