PHP code example of ingenico / ogone-client

1. Go to this page and download the library: Download ingenico/ogone-client 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/ */

    

ingenico / ogone-client example snippets


use IngenicoClient\Configuration;
use IngenicoClient\Client;
use IngenicoClient\Order;
use IngenicoClient\Alias;

$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new Client($configuration);
$order = new Order();
$order->setAmount(100);
$order->setCurrency('EUR');
$order->setOrderid('Order1');
$order->setPaymentMethod('CreditCard');
$alias = new Alias('customer1');
$url = $client->getFlexCheckoutUrl($order, $alias);

use IngenicoClient\Alias;
use IngenicoClient\Configuration;
use IngenicoClient\Client;
use IngenicoClient\Order;

$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$order = new Order();
$order->setAmount(100);
$order->setCurrency('EUR');
$order->setOrderid('Order1');
$alias = new Alias('customer1');
$client = new Client($configuration);
$transaction = $client->createDirectLinkPayment($order, $alias);

use IngenicoClient\Configuration;
use IngenicoClient\Client;

$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new Client($configuration);
$payment_status = $client->getPaymentStatus('3041842086');

use IngenicoClient\Configuration;
use IngenicoClient\Client;
use IngenicoClient\Order;

$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new Client($configuration);
$order = new Order();
$order->setAmount(100);
$order->setCurrency('EUR');
$order->setOrderid('Order1');
$html = $client->initiateRedirectPayment($order);

use IngenicoClient\Configuration;
use IngenicoClient\IngenicoCoreLibrary;

$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new IngenicoCoreLibrary($configuration);
$client->selLogger($yourLogger);

use IngenicoClient\LoggerBuilder;

$yourLogger = (new LoggerBuilder())
  ->createLogger('log', '/tmp/test.log', Logger::DEBUG)
  ->getLogger(); 


use IngenicoClient\LoggerBuilder;

$yourLogger = (new LoggerBuilder())
  ->createGelfLogger('log', 'logs.ing.limegrow.com', 12201, Logger::DEBUG)
  ->getLogger();