Skip to content
iDeal driver for the Omnipay PHP payment processing library
PHP
Branch: master
Clone or download

Latest commit

Latest commit aafc182 Mar 17, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src feat: add support for deutche bank nederland Mar 11, 2020
.gitignore back version Jan 17, 2020
LICENSE Initial commit Apr 1, 2019
README.md Update README.md Apr 5, 2019
composer.json add support for deutche bank nederland Mar 12, 2020

README.md

Omnipay: iDeal

iDeal (PSP) driver for the Omnipay PHP payment processing library

Latest Stable Version Total Downloads Latest Unstable Version License

Omnipay 3.x is a framework agnostic, multi-gateway payment processing library for PHP 5.6+

Table of Contents

Installation

Omnipay is installed via Composer.

composer require deniztezcan/omnipay-ideal:^1

List iDeal Issuers

use Omnipay\Omnipay;

$gateway = Omnipay::create('iDeal');

$gateway->setAcquirer('YOUR_BANK');
$gateway->setMerchantId('MERCHANT_ID');
$gateway->setSubId('SUB_ID');
$gateway->setPrivateKeyPassphrase('PASSPHRASE');
$gateway->setPrivateKeyPath('PATH_TO_PRIVATE_KEY');
$gateway->setPrivateCerPath('PATH_TO_PRIVATE_CER');

$request = $gateway->fetchIssuers();
$response = $request->send();

This gives you an array of Issuers:

$response->getIssuers();

Do a Payment

use Omnipay\Omnipay;

$gateway = Omnipay::create('iDeal');

$gateway->setAcquirer('YOUR_BANK');
$gateway->setMerchantId('MERCHANT_ID');
$gateway->setSubId('SUB_ID');
$gateway->setPrivateKeyPassphrase('PASSPHRASE');
$gateway->setPrivateKeyPath('PATH_TO_PRIVATE_KEY');
$gateway->setPrivateCerPath('PATH_TO_PRIVATE_CER');

$request = $gateway->purchase(['issuer' => 'ISSUER', 'amount' => 99.99, 'currency' => 'EUR', 'returnUrl' => 'RETURN_URL', 'transactionId' => 'PURCHASE_ID', 'description' => 'DESCRIPTION']);
$response = $request->send();

To properly handle the response

if ($response->isRedirect()) {
	// redirect to offsite payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo $response->getConsumerMessage();
}

Complete a Payment

use Omnipay\Omnipay;

$gateway = Omnipay::create('iDeal');

$gateway->setAcquirer('YOUR_BANK');
$gateway->setMerchantId('MERCHANT_ID');
$gateway->setSubId('SUB_ID');
$gateway->setPrivateKeyPassphrase('PASSPHRASE');
$gateway->setPrivateKeyPath('PATH_TO_PRIVATE_KEY');
$gateway->setPrivateCerPath('PATH_TO_PRIVATE_CER');

$request = $gateway->completePurchase(['transactionReference' => 'TRANSACTION_REFERENCE']);
$response = $request->send();

To properly handle the response

if ($response->isSuccessful()) {
	// payment was successful: update database
    print_r($response);
} else {
    // payment failed: display message to customer
    echo $response->getConsumerMessage();
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

You can’t perform that action at this time.