Package Data | |
---|---|
Maintainer Username: | Xiphin |
Maintainer Contact: | Xiphin@qq.com (Xiphin) |
Package Create Date: | 2017-03-15 |
Package Last Update: | 2023-08-22 |
Home Page: | https://packagist.org/packages/xlstudio/laravel-hupun |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:14:35 |
Package Statistics | |
---|---|
Total Downloads: | 1,610 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
为 Laravel 提供的万里牛ERP开放接口的 PHP SDK
composer require xlstudio/laravel-hupun dev-master
composer 安装或更新之后,把 HupunServiceProvider 添加到 config/app.php
'providers' => [
Xlstudio\Hupun\HupunServiceProvider::class,
],
如果你想使用 Facade 把下面的添加到 config/app.php
:
'aliases' => [
'Hupun' => Xlstudio\Hupun\Facades\Hupun::class,
],
通过运行下面命令把配置文件发布到项目配置里:
php artisan vendor:publish --provider="Xlstudio\Hupun\HupunServiceProvider"
在 .env
添加配置项:
HUPUN_TEST_ENV = true // 是否为测试环境(正式环境:false,测试环境:true)
// 测试环境配置
HUPUN_TEST_API_KEY = 填写你申请的appKey
HUPUN_TEST_API_SERECT = 填写你申请的appSecret
HUPUN_TEST_API_URL = http://114.67.231.99/open/api
// 正式环境配置
HUPUN_API_KEY = 填写你申请的appKey
HUPUN_API_SERECT = 填写你申请的appSecret
HUPUN_API_URL = https://erp-open.hupun.com/api
单笔查询库存的接口
use Hupun;
$params['shop_type'] = 100;
$params['shop_nick'] = '你的店铺昵称';
$params['item_id'] = '1';
$params['sku_id'] = '111-1';
var_dump(Hupun::execute('/inventories/erp/single', $params, 'get'));
如有不明白的地方,请联系[QQ:2019809069]