https://github.com/zacksleo/ec-sdk
电商平台 SDK:苏宁,淘宝,京东
https://github.com/zacksleo/ec-sdk
Last synced: about 1 year ago
JSON representation
电商平台 SDK:苏宁,淘宝,京东
- Host: GitHub
- URL: https://github.com/zacksleo/ec-sdk
- Owner: zacksleo
- Created: 2019-07-18T06:53:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T03:39:13.000Z (almost 7 years ago)
- Last Synced: 2025-02-07T13:47:45.024Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ec-sdk
电商平台 SDK.
## Installing
```shell
$ composer require zacksleo/ec-sdk -vvv
```
## Usage
```php
try {
$config = [
'key' => 'key',
'secret' => 'secret',
'debug' => false,
'log' =>[
'file' => __DIR__.'/suning.log',
'level' => 'error',
'permission' => 0777,
]
];
$code = Factory::suning($config)->express->name2code('申通快递');
var_dump($code);
} catch (\Zacksleo\SuningSdk\SuningException $exception) {
//苏宁返回错误
var_dump($exception->getMessage());
} catch (\Hanson\Foundation\Exception\HttpException $exception) {
//Http 请求发生错误
var_dump($exception->getMessage());
} catch (\Exception $exception) {
$exception->getMessage();
var_dump($exception->getMessage());
}
```
## Contributing
You can contribute in one of three ways:
1. File bug reports using the [issue tracker](https://github.com/zacksleo/ec-sdk/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/zacksleo/ec-sdk/issues).
3. Contribute new features or update the wiki.
_The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._
## License
MIT