flydreamers/shipwire-api
最新稳定版本:v0.2.5
Composer 安装命令:
composer require flydreamers/shipwire-api
包简介
Shipwire php integration
README 文档
README
These library will help you with the usage of Shipwire API.
Installing via Composer
The recommended way to install Shipwire-API is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version of Shipwire-API:
composer require flydreamers/shipwire-api
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Documentation
Initial configuration
To configure the library just call ShipwireConnector::init() function to and start using it.
To use it you only have to configure your username and password in The clientyour config-local file like this:
ShipwireConnector::init($config['username'], $config['password'], 'sandbox');
Stock
To check for Stock of a product:
$response = $stock->getStockBySKUs(['CAPTRACKERBLUE']);
If you have more than one SKU, just add them to the array like:
$response = $stock->getStockBySKUs(['CAPTRACKERBLUE', 'CAPTRACKERRED', 'ETCETERA']);
Extra parameters can be used. See \flydreamers\shipwire\Stock for more information.
Rates
You can ask Shipwire API for a shipping rate using Rate class.
$rate = new Rate; $options = [ "currency" => "USD", "groupBy" => "all", "canSplit" => 1, "warehouseArea" => "US" ]; $address = Address::createFromArray([ "address1" => "6501 Railroad Avenue SE", "address2" => "Room 315", "address3" => "", "city" => "Snoqualmie", "postalCode" => "85283", "region" => "WA", "country" => "US", "isCommercial" => 0, "isPoBox" => 0 ]); $items = [ ['sku' => 'CAPTRACKERBLUE', 'quantity' => 3] ]; $shippingInfo = $rate->quote($address, $items, $options);
Orders
$order = new \flydreamers\shipwire\Order();
TBD
##Issues and Feature Requests
If you have issues to report, or issues to request, use the issue tracker in Github.
##Contributing
Currently, the library isn't very feature rich or mature. If you'd like to offer improvements:
- Fork it
- Create your feature branch
git checkout -b feature-name - Commit your changes
git commit -am 'Add feature'* - Push the branch
git push origin feature-name - Create a pull request
##Contact
Have a question? I'm on twitter: @sebathi
##License
统计信息
- 总下载量: 6.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-16