PHP code example of samvdb / payum-paynl

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

    

samvdb / payum-paynl example snippets




use Payum\Core\PayumBuilder;
use Payum\Core\GatewayFactoryInterface;

$defaultConfig = [];

$payum = (new PayumBuilder)
    ->addGatewayFactory('paynl', function(array $config, GatewayFactoryInterface $coreGatewayFactory) {
        return new \Payum\Paynl\PaynlGatewayFactory($config, $coreGatewayFactory);
    })

    ->addGateway('paynl', [
        'factory' => 'paynl',
        'sandbox' => true,
        'token' => '',
        'service_id' => ''
    ])

    ->getPayum()
;



use Payum\Core\Request\Capture;

$paynl = $payum->getGateway('paynl');

$model = new \ArrayObject([
  // ...
]);

$paynl->execute(new Capture($model));