static-variables / jweb /ac1 /src /api /mpesa_config.php
fellybikush's picture
Upload 99 files
0dff816 verified
raw
history blame
630 Bytes
<?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';
}
}
?>