PHP code example of mt-apimatic / mt-sdk

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

    

mt-apimatic / mt-sdk example snippets


use ModernTreasuryLib\Logging\LoggingConfigurationBuilder;
use ModernTreasuryLib\Logging\RequestLoggingConfigurationBuilder;
use ModernTreasuryLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use ModernTreasuryLib\Environment;
use ModernTreasuryLib\Authentication\BasicAuthCredentialsBuilder;
use ModernTreasuryLib\ModernTreasuryClientBuilder;

$client = ModernTreasuryClientBuilder::init()
    ->basicAuthCredentials(
        BasicAuthCredentialsBuilder::init(
            'BasicAuthUserName',
            'BasicAuthPassword'
        )
    )
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();