, (*1)
, (*2)
Introduction
iDIN is used for personal identification by bank and is supported by Dutch banks.
With iDIN you can be sure who is registering on your application. This PHP package contains a client for CM Telecom., (*3)
See for more information: https://www.idin.nl, (*4)
Installation
Download the package using composer
Install package by running the command:, (*5)
``` bash
$ composer require nimbles-nl/cm-telecom, (*6)
## Usage
This package is easy to use and can be used in any php project with php 7.0 or later.
### Initializing iDIN Client
``` php
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
$adapter = new GuzzleAdapter(new GuzzleClient());
$apiToken = 'secret-token';
$apiUrl = 'https://idin.cmtelecom.com/idin/v1.0/test';
$applicationName = 'MyApp';
$client = new IDINClient($adapter, $apiToken, $apiUrl, $applicationName);
Get a list of issuers
``` php
$issuers = $client->getIssuers();, (*7)
### Start an iDIN Transaction
``` php
$issuers = $client->getIssuers();
$issuer = $issuers[0];
$transaction = $client->getIDINTransaction($issuer);
// Remember this data / store it in your database
$transactionId = $transaction->getTransactionId();
$entranceCode = $transaction->getEntranceCode();
$merchantReference = $transaction->getMerchantReference();
// Redirect the user to the bank page
return new RedirectResponse($transaction->getAuthenticationUrl());
Receive an array of user details with the iDIN Transaction object
``` php
$transaction = new IDINTransaction($transactionId, $merchantReference, $entranceCode);, (*8)
$userData = $client->getUserInfo($transaction);, (*9)
You can also receive bank account details with the IBANClient. It works almost the same as with IDIN. The client is already included in this package, but remember you use a different url for the api requests.
### Initializing IBAN Client
``` php
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
$adapter = new GuzzleAdapter(new GuzzleClient());
$apiToken = 'secret-token';
$apiUrl = 'https://ibancheck.cmdisp.com/ibancheck/v1.0/test';
$applicationName = 'MyApp';
$client = new IBANClient($adapter, $apiToken, $apiUrl, $applicationName);
Get a list of issuers
``` php
$issuers = $client->getIssuers();, (*10)
### Start an IBAN Transaction
``` php
$issuers = $client->getIssuers();
$issuer = $issuers[0];
$transaction = $client->getIBANTransaction($issuer);
// Remember this data / store it in your database
$transactionId = $transaction->getTransactionId();
$entranceCode = $transaction->getEntranceCode();
$merchantReference = $transaction->getMerchantReference();
// Redirect the user to the bank page
return new RedirectResponse($transaction->getAuthenticationUrl());
Receive an array of bank details with the IBAN Transaction object
``` php
$transaction = new IBANTransaction($transactionId, $merchantReference, $entranceCode);, (*11)
$userData = $client->getTransactionInfo($transaction);
```, (*12)