PHP code example of gpupo / adyen-sdk

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

    

gpupo / adyen-sdk example snippets


//...
use Gpupo\AdyenSdk\Factory;

$adyenSdk = Factory::getInstance()->setup([
    'client_user'       => 'foo',
    'client_password'   => 'bar',
    'version'           => 'test'
]);

 PHP
//...
$request = $adyenSdk->createRequest($data);
$request->setEncryptedData($hash);
$manager = $adyenSdk->factoryManager('request');
$response = $manager->submit($request);

 PHP
//...
$request = $adyenSdk->createRequest($data);
$response = $manager->capture($request);

 PHP
//...
$request = $adyenSdk->createRequest($data);
$response = $manager->refund($request, 10.99);

 PHP
//...
$request = $adyenSdk->createRequest($data);
$response = $manager->cancelOrRefund($request);