| // M-Pesa API Configuration | |
| class MpesaConfig { | |
| const CONSUMER_KEY = 'your_consumer_key'; | |
| const CONSUMER_SECRET = 'your_consumer_secret'; | |
| const SHORTCODE = 'your_business_shortcode'; | |
| const PASSKEY = 'your_passkey'; | |
| const CALLBACK_URL = 'https://yourdomain.com/mpesa_callback.php'; | |
| const TRANSACTION_TYPE = 'CustomerPayBillOnline'; | |
| // Sandbox or Production | |
| const ENVIRONMENT = 'sandbox'; | |
| public static function getBaseUrl() { | |
| return self::ENVIRONMENT === 'sandbox' | |
| ? 'https://sandbox.safaricom.co.ke' | |
| : 'https://api.safaricom.co.ke'; | |
| } | |
| } | |