├── tests └── .gitkeep ├── .gitignore ├── .travis.yml ├── composer.json ├── phpunit.xml ├── src └── Bmartus │ └── LaravelShippo │ └── LaravelShippoServiceProvider.php ├── LICENSE └── README.md /tests/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | composer.phar 3 | composer.lock 4 | .DS_Store -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.9 5 | - 7.0 6 | 7 | before_script: 8 | - curl -s http://getcomposer.org/installer | php 9 | - php composer.phar install --dev 10 | 11 | script: phpunit 12 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bmartus/laravel-shippo", 3 | "description": "Shippo for Laravel 5", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Brandon Martus", 8 | "email": "bmartus@gmail.com" 9 | } 10 | ], 11 | "require": { 12 | "php": ">=5.5.9", 13 | "illuminate/support": "~5.1", 14 | "shippo/shippo-php": "~1.1" 15 | }, 16 | "autoload": { 17 | "psr-0": { 18 | "Bmartus\\LaravelShippo": "src/" 19 | } 20 | }, 21 | "minimum-stability": "stable" 22 | } 23 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Bmartus/LaravelShippo/LaravelShippoServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 20 | ... 21 | Bmartus\LaravelShippo\LaravelShippoServiceProvider::class, 22 | ] 23 | ~~~ 24 | 25 | ### Configuration 26 | 27 | Add the following to your `.env` file: 28 | ~~~ 29 | SHIPPO_API_KEY=key_from_shippo 30 | ~~~ 31 | 32 | ### Usage 33 | 34 | You may use the [Shippo PHP Library](https://github.com/goshippo/shippo-php-client) as normal within your application. The Shippo API will automatically be configured with your API Key, so you do not need to set it yourself. 35 | 36 | ### Example 37 | 38 | A quick example in `routes.php`: 39 | ~~~ 40 | 'QUOTE', 46 | 'name' => 'John Smith', 47 | 'company' => 'Initech', 48 | 'street1' => 'Greene Rd.', 49 | 'street_no' => '6512', 50 | 'street2' => '', 51 | 'city' => 'Woodridge', 52 | 'state' => 'IL', 53 | 'zip' => '60517', 54 | 'country' => 'US', 55 | 'phone' => '123 353 2345', 56 | 'email' => 'jmercouris@iit.com', 57 | 'metadata' => 'Customer ID 234;234' 58 | ]); 59 | 60 | }); 61 | 62 | ~~~ 63 | --------------------------------------------------------------------------------