1. Go to this page and download the library: Download peaceofmind/ideal2 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/ */
peaceofmind / ideal2 example snippets
use POM\iDEAL\Banks\BankFactory;
use POM\iDEAL\Hub\Config;
use POM\iDEAL\Hub\SigningAlgorithm;
use POM\iDEAL\Hub\iDEAL;
$config = new Config(
merchantId: 'your-merchant-id',
testMode: true,
bank: BankFactory::bankFromString('ing'),
INGmTLSCertificatePath: '/path/to/ing-mtls-cert.pem',
INGmTLSKeyPath: '/path/to/ing-mtls-key.pem',
INGmTLSPassPhrase: 'passphrase',
INGSigningKey: file_get_contents('/path/to/ing-signing-key.pem'),
INGSigningPassphrase: 'passphrase',
INGSigningCertificate: file_get_contents('/path/to/ing-signing-cert.pem'),
hubmTLSCertificatePath: '/path/to/hub-mtls-cert.pem',
hubmTLSKeyPath: '/path/to/hub-mtls-key.pem',
hubmTLSPassphrase: 'passphrase',
hubSigningKey: file_get_contents('/path/to/hub-signing-key.pem'),
hubSigningCertificate: file_get_contents('/path/to/hub-signing-cert.pem'),
hubSigningPassphrase: 'passphrase',
signingAlgorithm: SigningAlgorithm::ES256,
cache: $yourPsr16Cache, // any PSR-16 CacheInterface implementation
);
$ideal = new iDEAL($config);
$transaction = $ideal->createTransactionRequest()->execute(
amount: 1000, // amount in cents (e.g. 1000 = EUR 10.00)
description: 'Order #123', // shown to the payer
reference: 'INV-2024-001', // appears on bank statements
returnUrl: 'https://example.com/return',
callbackUrl: 'https://example.com/webhook', // optional
);
// redirect the payer
header('Location: ' . $transaction->getRedirectUrl());
$status = $ideal->doStatusRequest()->execute($transactionId);
$status->getPaymentStatus(); // e.g. "SettlementCompleted"
$status->getIdentification(); // payer IBAN
$status->getName(); // payer name
$status->getGuaranteedAmount(); // settled amount
$status->getTransactionIdentifier(); // your original transaction ID
use POM\iDEAL\Worldline\CallbackVerifier;
$verifier = new CallbackVerifier(file_get_contents('/path/to/acquirer-cert.pem'));
$isValid = $verifier->verify(
callbackResponse: file_get_contents('php://input'),
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.