Package Data | |
---|---|
Maintainer Username: | wxm |
Maintainer Contact: | 157215725@qq.com (wxm) |
Package Create Date: | 2020-12-11 |
Package Last Update: | 2021-08-05 |
Home Page: | https://packagist.org/packages/wxm/jd-sdk |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-19 03:20:49 |
Package Statistics | |
---|---|
Total Downloads: | 120 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 17 |
Total Watchers: | 2 |
Total Forks: | 5 |
Total Open Issues: | 2 |
京东 SDK 封装, 调用简单、语义化增强。支持 Laravel/Lumen。
composer require wxm/jd-sdk
$jd = new \Jd\Application('app_key', 'secret_key');
// 例如 jd.union.open.goods.jingfen.query 其他接口同理
$jd->union->open->goods->jingfen->query();
注册 ServiceProvider:
\Jd\ServiceProvider::class
发布配置:
php artisan vendor:publish --provider="\Jd\ServiceProvider" --force
配置.env
Jd_APPKEY=app_key
Jd_APPSECRET=secret_key
使用
// 例如 jd.union.open.goods.jingfen.query 其他接口同理
\Jd\Facades\Jd::union()->open->goods->jingfen->query();
注册 ServiceProvider:
bootstrap/app.php
下添加
$app->register(\Jd\ServiceProvider::class);
手动复制配置文件
配置.env
Jd_APPKEY=app_key
Jd_APPSECRET=secret_key
使用
// 例如 jd.union.open.goods.jingfen.query 其他接口同理
\Jd\Facades\Jd::union()->open->goods->jingfen->query();