PHP code example of dvsa / mot-cpms-client

1. Go to this page and download the library: Download dvsa/mot-cpms-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dvsa / mot-cpms-client example snippets


             return array(
                 'cpms_api'                => array(
                     'version'           => 1,  
                     'logger_alias'      => '',  
                     'identity_provider' => '',
                     'enable_cache'      => true, //Enable of caching of access tokens for reuse
                     'cache_storage'     => 'filesystem',
                     'rest_client'   => array(
                         'options' => array(
                             'domain'             => ''
                         ),
                     ),
                 ),
             );
   
   * 
. The client would generate the o not need to manually generate the access token. 

            $           'page'   => 1,
                  'sort'   => 'id:desc',
                  'params' => array(
                      'depth'           => -2,
                      't_details',
                              'payment_status',
                              'customer_reference',
                              'created_by'
                          ),
                          'paymentDetail' => array(
                              'product_reference',
                              'sales_reference',
                              'payment_reference',
                              'amount'
                          ),
                          'scope'         => array(
                              'code',
                              'name'
                          ),
                          'paymentStatus' => array(
                              'code',
                              'name',
                          )
                      )
                  ),
              );
              
              $payments = $this->getCpmsRestClient()->get($endPoint, $