Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Address Validator

Build Status Coverage Status Latest Stable Version

Overview

An address validator adapter that supports a variety of third-party validators.

Installation

Run the following composer command to add the package to your project:

composer require dsposito/address-validator

Alternatively, add "dsposito/address-validator": "^0.1" to your composer.json file.

Usage

$provider = Provider::instance(
    'usps',
    [
        'endpoint' => 'http://production.shippingapis.com/ShippingAPI.dll',
        'user_id' => 'SK297O2B7BF221',
    ]
);

$address = $provider->validate(new Address([
    'name' => 'Elon Musk',
    'street1' => '3500 Deer Creek Road',
    'city' => 'Palo Alto',
    'state' => 'CA',
    'zip' => '94304',
    'country' => 'US',
]));

Tests

To run the test suite, run the following commands from the root directory:

composer install
vendor/bin/phpunit -d usps_user_id=YOUR_USPS_ID -d easypost_api_key=YOUR_EASYPOST_KEY

Note: Valid API keys are required when running the integration tests.

About

An address validator adapter that supports a variety of third-party validators.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages