blood72 / laravel-iamport
此包已弃用,不再维护。未建议替代包。
Laravel 7 的 Iamport API
v1.1.0
2020-11-23 16:50 UTC
Requires
- php: ^7.4
- ext-json: *
- guzzlehttp/guzzle: ^6.3|^7.0
- illuminate/support: ^7.0|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- orchestra/testbench: ^5.3|^6.4
- phpunit/phpunit: ^8.5|^9.0
This package is auto-updated.
Last update: 2023-09-24 20:51:49 UTC
README
아임포트(Iamport)는 국내 주요 PG사들을 쉽게 연동할 수 있도록 도와주는 서비스입니다.
Iamport 是一种帮助轻松实现主要支付网关集成的服务。
此包不受官方支持。
This package is not officially supported.
索引
需求
- PHP ^7.4
- Laravel ^7.0 | ^8.0
- Guzzle ^6.3 | ^7.0
安装
composer 可以安装。
使用 composer 安装。
composer require blood72/laravel-iamport
php artisan vendor:publish --provider="Blood72\Iamport\IamportServiceProvider"
配置
需要 IAMPORT_KEY
和 IAMPORT_SECRET
值。
需要 IAMPORT_KEY
和 IAMPORT_SECRET
。
// in iamport.php 'id' => env('IAMPORT_ID_CODE'), // 가맹점 식별코드 (Merchant ID) 'key' => env('IAMPORT_KEY', 'imp_apikey'), 'secret' => env('IAMPORT_SECRET', 'ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f'),
使用
可以通过 Facade 或 resolve 方法使用。
您可以使用 Facade 或 resolve 方法。
$payments = app('iamport')->getPayments(); $payments = Iamport::getPayments();
查看 参考 的 API 文档以了解方法。
查看 API 文档的参考可以帮助理解方法。
getPayment(...$impUid)
// same result $payment = Iamport::getPayment('imp_779297761907'); $payment = app('iamport')->getPayment(282589766101); // method adds 'imp_' automatically // return \Illuminate\Support\Collection::class $payments = Iamport::getPayment('imp_604050400483', 'imp_993488541671');
getPayments($status = 'all', $options = [])
// same result (TODO) $payments = Iamport::getPayments('paid', ['limit' => 3]); // $payments = Iamport::getPayments([ // 'status' => 'paid', // 'limit' => 3, // ]);
findPayment($merchantUid, $status = null, array $options = [])
$payment = Iamport::findPayment('merchant_1591942195747');
findPayments($merchantUid, $status = null, array $options = [])
$payment = Iamport::findPayment('merchant_1591942195747');
setPreparePayment($merchantUid, $amount)
&getPreparePayment($merchantUid)
// return \Blood72\Iamport\Payloads\PreparedPayment::class $payment = Iamport::setPreparePayment('b72-ae8ea2f204bd2285c03918ec321fa4ff', 124); $payment = Iamport::getPreparePayment('b72-ae8ea2f204bd2285c03918ec321fa4ff');
cancelPayment($impUid, ?int $amount = null, ?string $reason = null, array $options = [])
// same result Iamport::cancelPayment($impUid, $amount, $reason); Iamport::cancelPayment([ 'imp_uid' => $impUid, 'amount' => $amount, 'reason' => $reason, ]);
TODO
参考
- Iamport
- Iamport 文档
- Iamport API
- alliv corporation 的 Iamport
- Modern PHP User Group 的 iamport-rest-client
许可证
此包是 MIT 许可证的开放源代码软件。
This package is open-sourced software licensed under the MIT license.