PHP code example of nocksapp / omnipay-nocks
1. Go to this page and download the library: Download nocksapp/omnipay-nocks 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/ */
nocksapp / omnipay-nocks example snippets
use Omnipay\Omnipay;
$accessToken = '';
$merchant = '';
$gateway = Omnipay::create('Nocks');
$gateway->setAccessToken($accessToken);
$gateway->setTestMode(true); // Use Nocks testmode/sandbox for testing
$response = $gateway->purchase([
'merchant' => $merchant,
'amount' => 10.00,
'currency' => 'NLG',
'sourceCurrency' => 'EUR',
'returnUrl' => 'http://example.com/return',
'callbackUrl' => 'http://example.com/callback',
'paymentMethod' => 'ideal',
'issuer' => 'ABNANL2A',
])->send();
if ($response->isRedirect()) {
$response->redirect();
}