hopeofiran/nicardpayment
最新稳定版本:v1.0.3
Composer 安装命令:
composer require hopeofiran/nicardpayment
包简介
You can make your Nick Card payments with this package.
README 文档
README
Laravel Parsian Refund provides amount refundation.
License
Laravel Persian Validation is open-sourced software licensed under the MIT license
Requirement
- Laravel 8.* to up
- PHP 7.3 to up
Install
Via Composer
$ composer require hopeofiran/nicardpayment
Config
Add the following provider to providers part of config/app.php
HopeOfIran\NicardPayment\Providers\NicardPaymentProvider::class
vendor:publish
You can run vendor:publish command to have custom config file of package on this path ( config/parsianRefund.php )
php artisan vendor:publish --provider=HopeOfIran\NicardPayment\Providers\NicardPaymentProvider
Sample code (payment)
Route::any('/payment', function () { return \HopeOfIran\NicardPayment\Facades\NicardPaymentFacade::creditAmount(200000) ->cashAmount(0) ->callbackUrl(\route('payment.verification')) ->backUrl(\route('payment.verification')) ->installmentsCountList([3, 4]) ->purchase(function (\HopeOfIran\NicardPayment\NicardPayment $nicardPayment, \Illuminate\Http\Client\Response $response, $data) { return $nicardPayment->pay($data['open_cpg_url']); return 'payment failed'; }); })->name('payment');
Sample code (verification)
Route::any('/payment/verification', function (\Illuminate\Http\Request $request) { $response = \HopeOfIran\NicardPayment\Facades\NicardPaymentFacade::verify($request->input('tid')); if ($response->successful()) { return $response['is_totally_success']; } return $response->collect()->get('status'); })->name('payment.verification');
统计信息
- 总下载量: 1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-12