├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── composer.json ├── phpunit.xml ├── src └── Bmartus │ └── LaravelShippo │ └── LaravelShippoServiceProvider.php └── tests └── .gitkeep /.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Abodeo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Shippo for Laravel 5.2 2 | ============== 3 | 4 | Integrates the Shippo PHP library with Laravel 5.2 via a ServiceProvider. 5 | 6 | ### Installation 7 | 8 | Include laravel-shippo as a dependency in composer.json: 9 | 10 | ~~~ 11 | "bmartus/laravel-shippo": "dev-master" 12 | ~~~ 13 | 14 | Run `composer install` to download the dependency. 15 | 16 | Add the ServiceProvider to your provider array within `app/config/app.php`: 17 | 18 | ~~~ 19 | 'providers' => [ 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 | -------------------------------------------------------------------------------- /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 |