File size: 630 Bytes
0dff816
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
// 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';
    }
}
?>