Download the PHP package pdt256/shipping without Composer
On this page you can find all versions of the php package pdt256/shipping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package shipping
PHP Shipping API
A shipping rate wrapper for USPS, UPS, and Fedex.
Introduction
This is a PHP shipping package that wraps API calls to UPS, FedEx, and USPS for shipping rates. Multiple packages can be added to get additional rates.
All code (including tests) conform to the PSR-2 coding standards. The namespace and autoloader are using the PSR-4 standard.
All pull requests are processed by Travis CI to conform to PSR-2 and to verify all unit tests pass.
Installation
Add the following lines to your composer.json
file.
Example
Create a shipment object:
UPS (Stub) Example
Below is an example request to get shipping rates from the UPS API.
Notice: The below line uses a stub class to fake a response from the UPS API. You can immediately use this method in your code until you get an account with UPS.
Output array sorted by cost: (in cents)
USPS (Stub) Example
Output array sorted by cost: (in cents)
Fedex (Stub) Example
Output array sorted by cost: (in cents)
Unit Tests:
With Code Coverage:
With Live API Tests:
Run Coding Standards Test:
License
The MIT License (MIT)
Copyright (c) 2014 Jamie Isaacs [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.