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

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

    

apimatic-adyen / adyen-apimatic-sdk example snippets


use AdyenApIsLib\Logging\LoggingConfigurationBuilder;
use AdyenApIsLib\Logging\RequestLoggingConfigurationBuilder;
use AdyenApIsLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use AdyenApIsLib\Environment;
use AdyenApIsLib\Authentication\ApiKeyAuthCredentialsBuilder;
use AdyenApIsLib\Authentication\BasicAuthCredentialsBuilder;
use AdyenApIsLib\AdyenApIsClientBuilder;

$client = AdyenApIsClientBuilder::init()
    ->apiKeyAuthCredentials(
        ApiKeyAuthCredentialsBuilder::init(
            'X-API-Key'
        )
    )
    ->basicAuthCredentials(
        BasicAuthCredentialsBuilder::init(
            'Username',
            'Password'
        )
    )
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();