allivcorp / iamport
I'mport;Laravel 的 REST API 模块
v1.0.5
2018-03-26 18:13 UTC
Requires
- php: >=7.1.0
Requires (Dev)
- illuminate/support: ^5.6
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-20 00:05:54 UTC
README
此包是I'mport;,为 Laravel 5 提供的 REST API 模块。
安装
您可以通过 composer 安装此包,使用以下命令:
composer require allivcorp/iamport
然后在 .../config/app.php
中
'providers' => [ // ... Alliv\Iamport\IamportServiceProvider::class, ]
'aliases' => [ // ... 'Iamport' => Alliv\Iamport\Facades\IamportFacade::class, ]
配置
要发布配置文件到 config/iamport.php
,请运行
php artisan vendor:publish --provider="Alliv\Iamport\IamportServiceProvider"
这将发布一个文件 iamport.php
在您的配置目录中,其内容如下
return [ 'apiKey' => env('IAMPORT_REST_API_KEY', 'imp_apikey'), 'apiSecret' => env('IAMPORT_REST_API_SECRET', 'ekKoeW8RyKuT0zgaZsUtXXTLQ4AhPFW3ZGseDA6bkA5lamv9OqDMnxyeB9wqOsuO9W3Mx9YSJ4dTqJ3f') ];
使用方法
use Iamport; // Add subscribe customer (Issue billing key) Iamport::addSubscribeCustomer('customer_1234', '1234123412341234', '2020-10', '920327', '00'); // Checkout merchant(order) Iamport::subscribeAgain('customer_1234', 'merchant_1234', 6000, 'Coffee');
有关更多信息,请参阅I'mport API。
待定
- 使用 Guzzle(目前正在开发中。将在 2018 年 7 月之前发布)
- I'mport API 提供的其他 REST API。
许可证
MIT 许可证(MIT)。请参阅许可证文件以获取更多信息。