dgeorgiev / epay
Laravel epay.bg API 集成
1.0.0
2015-12-04 16:44 UTC
Requires
- php: >=5.3.0
- illuminate/support: ~5.1
This package is not auto-updated.
Last update: 2024-09-14 18:20:35 UTC
README
Laravel 对 Epay.bg API 的包装。支持 Laravel 5.1
安装
通过 Composer
$ composer require dgeorgiev/epay
- 在 config/app.php 文件中将服务提供者添加到 $providers 数组中,例如:
Dgeorgiev\Epay\EpayServiceProvider::class
- 在 config/app.php 文件中将别名添加到 $aliases 数组中,例如:
Epay' => Dgeorgiev\Epay\Facades\Epay::class
- 运行以下命令以发布配置:
php artisan vendor:publish
使用方法
$invoice = sprintf("%.0f", rand(1, 50) * 105); $amount = '22,80'; $expiration = '01.08.2020'; $description = 'Test'; Epay::setData( $invoice, $amount, $expiration, $description );
通知接收路由(POST)
Route::post('receive', function(){ $receiver = Epay::receiveNotification(Request::all()); /** * Update order or status of payment * * array ( * 'invoice' => '1890', * 'status' => 'PAID', * 'pay_date' => '20151204143730', * 'stan' => '036257', * 'bcode' => '036257', * ), * **/ foreach($receiver['items'] as $item){ Log::info($item); Log::info($item['status']); Log::info($item['invoice']); } return $receiver['response']; });
视图中的表单
<form action="{{ Epay::getSubmitUrl() }}" method="post">
{!! Epay::generateHiddenInputs() !!}
// your code here
<button type=submit>Изпрати</button>
</form>
支持
此包目前仅支持 Laravel 5 和 Laravel 5.1。
- 如果有任何问题,请在问题部分创建一个问题。
- 如果您想贡献
- 分支此仓库。
- 实现您的功能。
- 生成 pull request。
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
安全
如果您发现任何安全相关的问题,请通过电子邮件 me@dgeorgiev.biz 而不是使用问题跟踪器。
致谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件。