beaudierman/ups
最新稳定版本:v1.1.1
Composer 安装命令:
composer require beaudierman/ups
包简介
A simple tool to return UPS shipping rates.
关键字:
README 文档
README
This package is used to send shipment rate quote requests to the UPS webservice.
Install using Composer, edit your composer.json file to include:
"require": {
"beaudierman/ups": "1.*"
}
Update composer from the command line:
composer update
Add a new Service Provider to the providers array in your app/config/app.php file:
'Beaudierman\Ups\UpsServiceProvider'
Add a class alias in the same configuration file to the aliases array:
'Ups' => 'Beaudierman\Ups\Facades\Ups'
Example:
$return = Ups::getQuote(
array(
'access_key' => 'your key',
'username' => 'your username',
'password' => 'your password',
'account_number' => 'your account number',
),
array(
'from_zip' => '37902',
'from_state' => 'TN', // Optional, may yield a more accurate quote
'from_country' => 'US', // Optional, defaults to US
'to_zip' => '90210',
'to_state' => 'CA', // Optional, may yield a more accurate quote
'to_country' => 'US', // Optional, defaults to US
'packages' => 1,
'weight' => 50,
'measurement' => 'LBS', // Currently the UPS API will only allow LBS and KG, default is LBS
'negotiated_rates' => true // Optional, set true to return negotiated rates from UPS
)
);
Returns:
Array
(
[03] => Array
(
[service] => UPS Ground
[rate] => 52.32
)
[12] => Array
(
[service] => UPS 3 Day Select
[rate] => 145.09
)
[02] => Array
(
[service] => UPS 2nd Day Air
[rate] => 235.40
)
[01] => Array
(
[service] => UPS Next Day Air
[rate] => 301.46
)
)
统计信息
- 总下载量: 11.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-01-02