What is the difference between Sandbox and Production in M-PESA settings?
The Sandbox environment is used for testing purposes — it connects to Safaricom’s test infrastructure (https://sandbox.safaricom.co.ke) and does not process real payments or deduct real funds. It is intended for development and verification before going live.
The Production environment connects to Safaricom’s live infrastructure (https://api.safaricom.co.ke) and processes real payments from actual M-PESA accounts. This is the setting that must be selected once your app has been approved by Safaricom and you are ready to accept live payments.
The environment setting defaults to Production on first load. Make sure you are using the correct credentials for whichever environment you select — Sandbox credentials will not work in Production and vice versa.