An open API service indexing awesome lists of open source software.

https://github.com/kulikov-dev/ups-autocomplete

Address validation and auto-complete for PHP>=5.5
https://github.com/kulikov-dev/ups-autocomplete

address-validation api auto-complete autocomplete-address php php55 soap ups validation

Last synced: 9 months ago
JSON representation

Address validation and auto-complete for PHP>=5.5

Awesome Lists containing this project

README

          

### Address validation and auto-comlete using [UPS API](https://www.ups.com/tr/en/services/technology-integration/us-address-validation.page) for PHP 5.5 >=

The tool allows to work with UPS address validation tool through the SOAP, realizing operations of validation and auto-complete addresses. Contains two methods:
* validate_address - to validate an address or get a list of possible address candidates;
* get_address_field_candidates - to get a list of possible candidates for a specific field (like state, zip or address).

Before work you need to initialize the tool with your credentials:
``` php
/**
* Setup API credentials
*/
public function set_credentials()
{
$this->user_name = ''; // TODO initialize credentials from your storage.
$this->password = '';
$this->license_number = '';
}
```

After that it is ready to work. Below are sample of auto-completing a field 'address':
``` php
try {
$output = $ups_connector->get_address_field_candidates('US', $zip, $state, $city, $street, $type);
} catch (Exception $e) {
echo 'ERROR: ' . $e->getMessage();
die;
}
```