This package is designed for use with Laravel.
composer require roksta/ipay-ke
Publish config file to set iPay options.
php artisan vendor:publish --provider="Roksta\IPay\Providers\IPayServiceProvider"
Set your environment variables in your .env file
IPAY_ENV=live or sandbox
IPAY_SECRET_KEY="your_ipay_secret_key"
IPAY_VENDOR_ID="your_ipay_vendor_id"
IPAY_MOBILE_CALLBACK_URL="https://yoursite.com/callback-url"
IPAY_CARD_CALLBACK_URL="https://yoursite.com/callback-url"
$ipay = IPay::orderId(1234)
->amount(1)
->customer($phone_number, $email);
$response = $ipay->initiate();
- Note, phone numer and email cannot be null.
$stk_response = Ipay::stk('network')->push($phone_number, $response->data->sid);
- Note: network options and sid are contained within the $response object
$ipay->generateForm('button_text', 'button_class')
- button_text refers to the text diplayed in the button, eg, Pay With IPay
- button_class refers to which classes to be applied to the button, eg 'btn btn-primary'
The package is provided under the MIT License.