25/03
2017
dev-master
9999999-devBunq API Client
The Requires
The Development Requires
by Dennis Snijder
Bunq API Client
A PHP Client Library for accessing Bunq's API., (*2)
$ composer require snijder/bunq-api-client
$keyPair = new \Snijder\Bunq\Model\KeyPair($apiKey, $publicKey, $privateKey); $bunqClient = new \Snijder\Bunq\BunqClient($keyPair); $userResource = new \Snijder\Bunq\Resource\UserResource($BunqClient); $userResource->listUsers(); //list all available users.
This Bunq API client automatically handles the installation by itself. By default the tokens are being store in the "PHP temporary folder"., (*3)
You can use the TokenStorageInterface
to overwrite the default file system storage., (*4)
$bunqClient->setInstallationTokenStorage($myInstallationTokenStorage); $bunqClient->setSessionTokenStorage($mySessionTokenStorage);
or use the default token file storage., (*5)
$bunqClient->setSessionTokenStorage( new \Snijder\Bunq\Storage\SessionTokenFileStorage($path) ); $bunqClient->setInstallationTokenStorage( new \Snijder\Bunq\Storage\InstallationTokenFileStorage($path) );
Bunq API Client