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

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

    

ps-apimatic / ps-apimatic-sdk example snippets


use PaysecureApiDocumentationLiveLib\Logging\LoggingConfigurationBuilder;
use PaysecureApiDocumentationLiveLib\Logging\RequestLoggingConfigurationBuilder;
use PaysecureApiDocumentationLiveLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use PaysecureApiDocumentationLiveLib\Environment;
use PaysecureApiDocumentationLiveLib\Authentication\BearerAuthCredentialsBuilder;
use PaysecureApiDocumentationLiveLib\PaysecureApiDocumentationLiveClientBuilder;

$client = PaysecureApiDocumentationLiveClientBuilder::init()
    ->bearerAuthCredentials(
        BearerAuthCredentialsBuilder::init(
            'AccessToken'
        )
    )
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();