"escapeboy/epay": "1.*"
Escapeboy\Epay\EpayServiceProvider::class,
'Epay' => Escapeboy\Epay\EpayServiceProvider::class,
php artisan vendor:publish --provider="Escapeboy\Epay\EpayServiceProvider" --tag="config"
--
Edit config/epay.php
return [
'submit_url' => 'https://devep2.datamax.bg/ep2/epay2_demo/', // test submit url
// 'submit_url' => 'https://www.epay.bg/', // production submit url
'secret' => REQUIRED, // client secret
'client_id' => REQUIRED, // client id
'expire_days' => 1 // expire time for transations in days
'success_url' => 'epay/success', // return url for success
'cancel_url' => 'epay/cancel', // return url for cancel
];
Generate hidden input fields to submit to Epay
echo \Epay::generateInputFields([
'invoice' => '000001', // invoice ID
'amount' => 100, // amount
'descr' => 'Some info about order' // info about order
]);
Receive epay notification (url is filled in merchant's profile)
Route::post('epay/notification', function(){
$notification_data = \Epay::receiveNotification(request()->all());
/**
* $notification_data contains array with data:
*
* array (
* 'invoice' => 'your_order_id',
* 'status' => 'PAID',
* 'pay_date' => '20162304154530',
* 'stan' => '045138',
* 'bcode' => '045138'
* ),
*
**/
return response()->make($notification_data['response']);
});