项目作者: bileto

项目描述 :
ČSOB driver for the Omnipay PHP payment processing library
高级语言: PHP
项目地址: git://github.com/bileto/omnipay-csob.git
创建时间: 2015-06-24T15:46:19Z
项目社区:https://github.com/bileto/omnipay-csob

开源协议:

下载


Omnipay: ČSOB

ČSOB driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements ČSOB Online Payment Gateway support for Omnipay.

ČSOB Online Payment Gateway documentation

Installation

Omnipay is installed via Composer. To install, simply add it
to your composer.json file:

  1. {
  2. "require": {
  3. "bileto/omnipay-csob": "~0.8"
  4. }
  5. }

TL;DR

  1. use Omnipay\Csob\GatewayFactory;
  2. $publicKey = __DIR__ . '/tests/unit/Sign/assets/mips_iplatebnibrana.csob.cz.pub';
  3. $privateKey = __DIR__ . '/tests/unit/Sign/assets/rsa_A1029DTmM7.key';
  4. $gateway = GatewayFactory::createInstance($publicKey, $privateKey);
  5. try {
  6. $merchantId = 'A1029DTmM7';
  7. $orderNo = '12345677';
  8. $returnUrl = 'http://localhost:8000/gateway-return.php';
  9. $description = 'Shopping at myStore.com (Lenovo ThinkPad Edge E540, Shipping with PPL)';
  10. $purchase = new \Omnipay\Csob\Purchase($merchantId, $orderNo, $returnUrl, $description);
  11. $purchase->setCart([
  12. new \Omnipay\Csob\CartItem("Notebook", 1, 1500000, "Lenovo ThinkPad Edge E540..."),
  13. new \Omnipay\Csob\CartItem("Shipping", 1, 0, "PPL"),
  14. ]);
  15. /** @var \Omnipay\Csob\Message\ProcessPaymentResponse $response */
  16. $response = $gateway->purchase($purchase->toArray())->send();
  17. // Payment init OK, redirect to the payment gateway
  18. echo $response->getRedirectUrl();
  19. } catch (\Exception $e) {
  20. dump((string)$e);
  21. }

Test Project

The project uses PHPUnit and Mockery to provide unit tests.

  1. ./vendor/bin/phpunit