slvler / veriphone-validation
Phone number validation API for veriphone.io
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires (Dev)
- guzzlehttp/guzzle: ^7.0.1
- orchestra/testbench: ^6.18.0
- phpunit/phpunit: ^9.5
README
This package provides a convenient wrapper to the Veriphone API for Laravel applications.
Veriphone API is a REST based JSON API. It provides a set of stateless endpoints that any program or web browser can call by sending a standard HTTP request. Veriphone will respond with a standard HTTP response carrying a JSON payload. This documentation describes these endpoints, their input/output parameters and authentication methods.
Requirements
- PHP 8.0+
- Laravel 9.x
Installation
To install this package tou can use composer:
composer require slvler/veriphone-validation
Usage
- First of all we'll add the API key and API Url of the service we're using to our .env file of our project. If you don't have an account yet on veriphone.io, you should create one. Once you have an account you can copy your API key from the dashboard page and put it into you .env file.
VERIPHONE_BASE_URL="https://api.veriphone.io/" VERIPHONE_API_KEY="YOUR-API-KEY"
- you should extract the config/veriphone.php file to the config folder.
php artisan vendor:publish --tag=veriphone
- Abstract's Phone Number Validation and Verification API simply requires your unique API key and the phone number you'd like to check:
use Slvler\VeriphoneValidation\Facedes\VeriphoneValidation; VeriphoneValidation::get('14152007986');
- This was a successful request, so the valid phone number and details associated with it are returned below:
{ "status": "success", "phone": "+14152007986", "phone_valid": true, "phone_type": "fixed_line_or_mobile", "phone_region": "California", "country": "United States", "country_code": "US", "country_prefix": "1", "international_number": "+1 415-200-7986", "local_number": "(415) 200-7986", "e164": "+14152007986", "carrier": "" }
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.