2017 © Pedro Peláez
 

library verify-php-client

A PHP library which encapsulates interaction with Jincor Verify service

image

jincor/verify-php-client

A PHP library which encapsulates interaction with Jincor Verify service

  • Thursday, November 30, 2017
  • by Jincor
  • Repository
  • 2 Watchers
  • 1 Stars
  • 47 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Verify client

, (*1)

This is a client library which encapsulates interaction with Jincor Verify. With its help you can: 1. Initiate verification process for methods: email, google_auth. 2. Validate code. 3. Invalidate code., (*2)

Usage

Initialize Verify client

To interact with the HTTP protocol use Guzzle. Headers Accept: application/vnd.jincor+json; version=1 , Content-Type: application/json, Authorization: Bearer JWT_TOKEN are mandatory., (*3)

$verifyClient = new VerifyClient(new Client([
    'base_uri' => 'verify:3000',
    'headers' => [
        'Accept'        => 'application/vnd.jincor+json; version=1',
        'Content-Type'  => 'application/json',
        'Authorization' => 'Bearer JWT_TOKEN',
    ]
]));

Initiate Verification process

$verificationDetails = $verifyClient->initiate(
    (new EmailVerification())
        ->setTemplate('{{{CODE}}}')
        ->setConsumer('test@test.com')
        ->setExpiredOn('01:00:00')
);

Validate Code

$result = $verifyClient->validate(new EmailValidationData(
    new Uuid('d6b78279-db85-467e-b965-c938d043ffac'),
    '123456'
));
// true

Invalidate Code

$result = $verifyClient->invalidate(new GoogleAuthInvalidationData(
    new Uuid('d6b78279-db85-467e-b965-c938d043ffab')
));
// true

More details can be received in the tests., (*4)

Project setup

  1. Clone the repo
  2. cd /path/to/repo
  3. docker-compose build - build development containers
  4. docker-compose up -d - run container
  5. docker-compose exec workspace composer install

Local testing

To run all tests just type docker-compose exec workspace ./vendor/bin/codecept run, (*5)

Credits

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

30/11 2017

dev-master

9999999-dev https://github.com/JincorTech/verify-php-client

A PHP library which encapsulates interaction with Jincor Verify service

  Sources   Download

MIT

The Requires

 

The Development Requires

library jwt sdk client verify

30/11 2017

dev-develop

dev-develop https://github.com/JincorTech/verify-php-client

A PHP library which encapsulates interaction with Jincor Verify service

  Sources   Download

MIT

The Requires

 

The Development Requires

library jwt sdk client verify

30/11 2017

dev-feature/issue-4

dev-feature/issue-4 https://github.com/JincorTech/verify-php-client

A PHP library which encapsulates interaction with Jincor Verify service

  Sources   Download

MIT

The Requires

 

The Development Requires

library jwt sdk client verify