ingenico/ogone-client

Ingenico ePayments 核心库

7.1.0 2022-03-13 08:19 UTC

This package is auto-updated.

Last update: 2024-09-13 13:52:18 UTC


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 支付

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);

添加日志记录器

您可以将任何实现了PSR LoggerInterface的日志记录器传递给它以记录请求/响应数据。

use IngenicoClient\Configuration;
use IngenicoClient\IngenicoCoreLibrary;

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

使用LoggerBuilder构建您的monolog日志记录器

use IngenicoClient\LoggerBuilder;

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

使用LoggerBuilder构建您的Gelf日志记录器

use IngenicoClient\LoggerBuilder;

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