Update read me

pull/3/head
Troy Davisson 10 years ago
parent a89504e722
commit ad3c950d6d

@ -21,23 +21,18 @@ Add the following lines to your ``composer.json`` file.
Create a shipment object: Create a shipment object:
```php ```php
$shipment = [ $shipment = new Shipment;
'weight' => 3, // lbs $shipment->setFromStateProvinceCode('IN')->setFromPostalCode('46205')
'dimensions' => [ ->setFromCountryCode('US')
'width' => 9, // inches ->setToPostalCode('20101')
'length' => 9, ->setToCountryCode('US')
'height' => 9, ->setToResidential(true);
],
'from' => [ $package = new Package;
'postal_code' => '90401', $package->setLength(12)->setWidth(4)->setHeight(3)->setWeight(3);
'country_code' => 'US', $package->setPackaging(Package::USPS_CONTAINER_RECTANGULAR);
], $package->setSizeClassification(Package::USPS_SIZE_LARGE);
'to' => [ $shipment->addPackage($package);
'postal_code' => '78703',
'country_code' => 'US',
'is_residential' => TRUE,
],
];
``` ```
## UPS (Stub) Example ## UPS (Stub) Example
@ -116,10 +111,7 @@ $usps = new USPS\Rate([
'prod' => FALSE, 'prod' => FALSE,
'username' => 'XXXX', 'username' => 'XXXX',
'password' => 'XXXX', 'password' => 'XXXX',
'shipment' => array_merge($shipment, [ 'shipment' => $shipment,
'size' => 'LARGE',
'container' => 'RECTANGULAR',
]),
'approved_codes' => [ 'approved_codes' => [
'1', // 1-3 business days '1', // 1-3 business days
'4', // 2-8 business days '4', // 2-8 business days
@ -162,9 +154,7 @@ $fedex = new Fedex\Rate([
'account_number' => 'XXXX', 'account_number' => 'XXXX',
'meter_number' => 'XXXX', 'meter_number' => 'XXXX',
'drop_off_type' => 'BUSINESS_SERVICE_CENTER', 'drop_off_type' => 'BUSINESS_SERVICE_CENTER',
'shipment' => array_merge($shipment, [ 'shipment' => $shipment,
'packaging_type' => 'YOUR_PACKAGING',
]),
'approved_codes' => [ 'approved_codes' => [
'FEDEX_EXPRESS_SAVER', // 1-3 business days 'FEDEX_EXPRESS_SAVER', // 1-3 business days
'FEDEX_GROUND', // 1-5 business days 'FEDEX_GROUND', // 1-5 business days

Loading…
Cancel
Save