PHP code example of deniztezcan / omnipay-ingenico-epayments
1. Go to this page and download the library: Download deniztezcan/omnipay-ingenico-epayments 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/ */
deniztezcan / omnipay-ingenico-epayments example snippets
use Omnipay\Omnipay;
$gateway = Omnipay::create('IngenicoePayments');
$gateway->setMode('test');
$gateway->setPSPID('PSID');
$gateway->setLanguage('nl_NL');
$gateway->setShaIn('SHAIN');
$gateway->setShaOut('SHAOUT');
$gateway->setHashing('SHA-1');
$request = $gateway->purchase([
'amount' => 9999,
'currency' => 'EUR',
'returnUrl' => 'https://example.com/tmp/done',
'cancelUrl' => 'https://example.com/tmp/cancel',
'transactionId' => '1111111',
'description' => 'DESCRIPTION',
'paymentMethod' => 'PAYMENTMETHOD',
'card' => [
'firstName' => 'firstName',
'lastName' => 'lastName',
'billingAddress1' => 'billingAddress1',
'postcode' => 'postcode',
'city' => 'city',
'phone' => 'phone',
'email' => 'email'
],
'customfields' => [
'XX' => 'XX',
]
]);
$response = $request->send();
$response->redirect();
use Omnipay\Omnipay;
$gateway = Omnipay::create('IngenicoePayments');
$gateway->setMode('test');
$gateway->setPSPID('PSID');
$gateway->setLanguage('nl_NL');
$gateway->setShaIn('SHAIN');
$gateway->setShaOut('SHAOUT');
$request = $gateway->completePurchase(['transaction' => $_GET]);
$response = $request->send();
if ($response->isSuccessful()) {
echo $response->getTransactionId();
}else{
echo $response->getError();
}