escapeboy/epay
Composer 安装命令:
composer require escapeboy/epay
包简介
Epay API Payment Wrapper
关键字:
README 文档
README
Installation
"escapeboy/epay": "1.*"
In config/app.php
Escapeboy\Epay\EpayServiceProvider::class,
'Epay' => Escapeboy\Epay\EpayServiceProvider::class,
Publish config file
php artisan vendor:publish --provider="Escapeboy\Epay\EpayServiceProvider" --tag="config"
--
Usage
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']); });
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-23