Configure Modem Pay for your Laravel app.
Environment Variables
Add these to your .env file:
MODEMPAY_API_KEY=your_api_key_here
MODEMPAY_WEBHOOK_SECRET=your_webhook_secret_here
Never commit your API keys to version control. Always use .env file.
Publish Config (Optional)
If you need to customize settings, publish the config file:
php artisan vendor:publish --tag=modempay-config
This creates config/modempay.php:
return [
'api_key' => env('MODEMPAY_API_KEY'),
'webhook_secret' => env('MODEMPAY_WEBHOOK_SECRET'),
];
Getting Your API Keys
- Log in to your ModemPay Dashboard
- Go to Developers → API Keys
- Copy your keys
- Add them to
.env
Use test keys during development and live keys in production.
Verifying Setup
Test your configuration in Tinker:
ModemPay::paymentIntents()->list();
If this works, you’re all set!