iliakondrashov / inmotiv-sdk-php
InMotiv RDC SOAP PHP client
Installs: 4 651
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 2
Requires (Dev)
- kint-php/kint: ^2.2
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~5.0
- squizlabs/php_codesniffer: ^3.2
- vlucas/phpdotenv: ~2.0
README
InMotiv (https://www.rdc.nl/) is one of the official RDW partners. It provides SOAP endpoints to access RDW database. For example you can check whether driver licence is valid or not by number and owner birthday.
Requirements
- PHP 7.1
- SOAP extension
How to use
Fill your InMotiv credentials and driver license details in the code below:
$endpointProvider = new ProductionEndpointProvider(); $xmlBuilder = new XmlBuilder(); $client = new InMotivClient( $endpointProvider, $xmlBuilder, 111111, 'rdc111111999', 'xxxXXXxxx' ); var_dump($client->isDriverLicenceValid('1111111111', 1990, 1, 1));
And result should be
bool(true)
See full example in example.php.
Debug mode
Request and response headers and bodies can be printed by forcing debug mode of the client. Notice the last optional argument:
$client = new InMotivClient( $endpointProvider, $xmlBuilder, 111111, 'rdc111111999', 'xxxXXXxxx', true );
Now lots of details became visible.
What is currently implemented
- driver licence check
- very basic vehicle details by numberplates
How to test
Since InMotiv does not have open sandbox account, you have to create .env
file in the project root with
your credentials. Also you need to provide a valid driver licence and numberplates details.
INMOTIV_CLIENT_NUMBER=111111
INMOTIV_USERNAME=rdc111111999
INMOTIV_PASSWORD=xxxXXXxxx
DRIVER_LICENCE_NUMBER=xxxxxxxxxx
BIRTHDAY_YEAR=2000
BIRTHDAY_MONTH=10
BIRTHDAY_DAY=10
NUMBERPLATES_CAR=22PBR4
NUMBERPLATES_MOTORCYCLE=05MMGG
NUMBERPLATES_MOTORCYCLE_ELECTRIC=81MGVP
NUMBERPLATES_MOTORCYCLE_WITHOUT_FIRST_REGISTRATION_DATE=07MJHJ
Then just run ./vendor/bin/phpunit
. Everything should be green.