PHP code example of worldpay-apimatic / worldpay-apimatic-sdk

1. Go to this page and download the library: Download worldpay-apimatic/worldpay-apimatic-sdk 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/ */

    

worldpay-apimatic / worldpay-apimatic-sdk example snippets


use ReportingAuthorizationSummaryApiLib\Logging\LoggingConfigurationBuilder;
use ReportingAuthorizationSummaryApiLib\Logging\RequestLoggingConfigurationBuilder;
use ReportingAuthorizationSummaryApiLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use ReportingAuthorizationSummaryApiLib\Authentication\CustomHeaderAuthenticationCredentialsBuilder;
use ReportingAuthorizationSummaryApiLib\ReportingAuthorizationSummaryApiClientBuilder;

$client = ReportingAuthorizationSummaryApiClientBuilder::init()
    ->customHeaderAuthenticationCredentials(
        CustomHeaderAuthenticationCredentialsBuilder::init(
            'Authorization'
        )
    )
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();