PHP code example of slm / ideal-payment

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

    

slm / ideal-payment example snippets


$client = $sl->get('SlmIdealPayment\Client\Standard\Rabobank');

$request  = new DirectoryRequest;
$response = $client->send($request);

foreach ($response->getCountries() as $country) {
    echo sprintf("Country: %s\n", $country->getName());

    foreach ($country->getIssuers() as $issuer) {
        echo sprintf("%s: %s\n", $issuer->getId(), $issuer->getName());
    }
}

use SlmIdealPayment\Model;

$client = $sl->get('SlmIdealPayment\Client\Standard\Rabobank');

// Set up the issuer
$issuer = new Model\Issuer;
$issuer->setId($issuerId); // set selected issuer here

// Set up the transaction
$transaction = new Model\Transaction;
$transaction->setPurchaseId($purchaseId);
$transaction->setAmount($amount);
$transaction->setDescription($description);
$transaction->setEntranceCode($ec);

$request  = new TransactionRequest;
$request->setIssuer($issuer);
$request->setTransaction($transaction);

$response = $client->send($request);

echo $response->getTransaction()->getTransactionId();

// Then perform redirect:
// Redirect to $response->getAuthenticationUrl();

use SlmIdealPayment\Model;

$client = $sl->get('SlmIdealPayment\Client\Standard\Rabobank');

$transaction = new Model\Transaction;
$transaction->setTransactionId($transactionId);

$request  = new StatusRequest;
$request->setTransaction($transaction);

$response = $client->send($request);

echo $response->getTransaction()->getStatus();

use SlmIdealPayment\Client\StandardClient;
use SlmIdealPayment\Options\StandardClientOptions;

$options = new StandardClientOptions;
$options->setRequestUrl('https://ideal.rabobank.nl/ideal/iDEALv3');
$options->setMerchantId('00X0XXXXX');
$options->setSubId('0');

$options->setPublicCertificate('data/ssl/rabobank.cer');
$options->setPrivateCertificate('data/ssl/cert.cer');

$options->setKeyFile('data/ssl/priv.pem');
$options->setKeyPassword('h4x0r');

$client = new StandardClient($options);

curl -s http://getcomposer.org/installer | php
php composer.phar install