定制 bileto/omnipay-csob 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bileto/omnipay-csob

最新稳定版本:v0.8.0

Composer 安装命令:

composer require bileto/omnipay-csob

包简介

ČSOB gateway for Omnipay payment processing library

README 文档

README

Č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:

{
    "require": {
        "bileto/omnipay-csob": "~0.8"
    }
}

TL;DR

use Omnipay\Csob\GatewayFactory;

$publicKey = __DIR__ . '/tests/unit/Sign/assets/mips_iplatebnibrana.csob.cz.pub';
$privateKey = __DIR__ . '/tests/unit/Sign/assets/rsa_A1029DTmM7.key';
$gateway = GatewayFactory::createInstance($publicKey, $privateKey);

try {
    $merchantId = 'A1029DTmM7';
    $orderNo = '12345677';
    $returnUrl = 'http://localhost:8000/gateway-return.php';
    $description = 'Shopping at myStore.com (Lenovo ThinkPad Edge E540, Shipping with PPL)';

    $purchase = new \Omnipay\Csob\Purchase($merchantId, $orderNo, $returnUrl, $description);
    $purchase->setCart([
        new \Omnipay\Csob\CartItem("Notebook", 1, 1500000, "Lenovo ThinkPad Edge E540..."),
        new \Omnipay\Csob\CartItem("Shipping", 1, 0, "PPL"),
    ]);

    /** @var \Omnipay\Csob\Message\ProcessPaymentResponse $response */
    $response = $gateway->purchase($purchase->toArray())->send();

    // Payment init OK, redirect to the payment gateway
    echo $response->getRedirectUrl();
} catch (\Exception $e) {
    dump((string)$e);
}

Test Project

The project uses PHPUnit and Mockery to provide unit tests.

./vendor/bin/phpunit

统计信息

  • 总下载量: 17.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 14
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-25