承接 dranes/omnipay-ippay 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dranes/omnipay-ippay

最新稳定版本:2.0.0

Composer 安装命令:

composer require dranes/omnipay-ippay

包简介

IPpay driver for the Omnipay payment processing library

README 文档

README

IPpay 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 IPpay support for Omnipay.

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

{
    "require": {
        "dranes/omnipay-ippay": "~1.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage (Tokenization)

use Omnipay\Omnipay;
use Omnipay\Common\GatewayFactory;
use Omnipay\Common\Helper;
use Omnipay\Common\CreditCard;

$gateway = Omnipay::create('Ippay');
$gateway->setTerminalId('xxxxxxxx');
$gateway->setTestMode(true);

$creditCardData = [
    'firstName' => 'John',
    'lastName' => 'Doe',
    'number' => '4111111111111111',
    'expiryMonth' => '02',
    'expiryYear' => '22',
    'cvv' => '123'
];

$card = new CreditCard($creditCardData);
$ccResponse = $gateway->createCard([
    'card' => $card
])->send();    

$message = $ccResponse->getMessage();

$response = new \SimpleXMLElement($message);
if($ccResponse->isSuccessful()) {
    $token = $response->Token;
} else {
    $error = $response->ResponseText;
}

Basic Usage (Sale with a token)

use Omnipay\Omnipay;
use Omnipay\Common\GatewayFactory;
use Omnipay\Common\Helper;
use Omnipay\Common\CreditCard;

$gateway = Omnipay::create('Ippay');
$gateway->setTerminalId('xxxxxxxx');
$gateway->setTestMode(true);

$response = $gateway->purchase([
    'transaction_type' => 'SALE',
    'amount' => 100, 
    'token' => $token, //previously saved
])->send();

$message = $response->getMessage();
$response = new \SimpleXMLElement($message);

if($response->isSuccessful()) {
    $transaction_reference = $response->getTransactionReference();
} else {
    $error = $response->ResponseText);
}

For general usage instructions, please see the main Omnipay repository.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-10