agence-gw / ingenico-ogone-client
Ingenico ePayments Core Library
7.1.0.7
2023-06-13 09:30 UTC
Requires
- php: >=7.0
- ext-bcmath: *
- ext-curl: *
- ext-mbstring: *
- agence-gw/ingenico-ogone-sdk-php: ^3.1.0
- graylog2/gelf-php: ~1.5
- league/iso3166: *
- mobiledetect/mobiledetectlib: ~2.8.0
- monolog/monolog: *
- symfony/translation: ~4.2
- viison/address-splitter: ~0.3.4
README
FlexCheckout URL
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);
DirectLink Payment
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);
Payment status
use IngenicoClient\Configuration;
use IngenicoClient\Client;
$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new Client($configuration);
$payment_status = $client->getPaymentStatus('3041842086');
Hosted Checkout
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);
Add logger
you can pass any logger implemented PSR LoggerInterface to log request/response data.
use IngenicoClient\Configuration;
use IngenicoClient\IngenicoCoreLibrary;
$configuration = new Configuration('pspid', 'api_username', 'password', 'passphrase', 'sha512');
$client = new IngenicoCoreLibrary($configuration);
$client->selLogger($yourLogger);
to build your monolog logger use LoggerBuilder:
use IngenicoClient\LoggerBuilder;
$yourLogger = (new LoggerBuilder())
->createLogger('log', '/tmp/test.log', Logger::DEBUG)
->getLogger();
to build your Gelf logger use LoggerBuilder:
use IngenicoClient\LoggerBuilder;
$yourLogger = (new LoggerBuilder())
->createGelfLogger('log', 'logs.ing.limegrow.com', 12201, Logger::DEBUG)
->getLogger();