2017 © Pedro Peláez
 

library omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

image

wjminions/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 28 % Grown

The README.md

Omnipay: UnionPay

UnionPay driver for the Omnipay PHP payment processing library, (*1)

Build Status Latest Stable Version Total Downloads, (*2)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements UnionPay support for Omnipay., (*3)

Installation

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

{
    "require": {
        "lokielse/omnipay-unionpay": "dev-master"
    }
}

And run composer to update your dependencies:, (*5)

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

Basic Usage

The following gateways are provided by this package:, (*6)

  • Union_Express (Union Express Checkout) 银联全产品网关(PC,APP,WAP支付)
  • Union_LegacyMobile (Union Legacy Mobile Checkout) 银联老网关(APP)
  • Union_LegacyQuickPay (Union Legacy QuickPay Checkout) 银联老网关(PC)

Usage

Sandbox Param can be found at: UnionPay Developer Center, (*7)

Consume

$gateway    = Omnipay::create('UnionPay_Express');
$gateway->setMerId($config['merId']);
$gateway->setCertPath($config['certPath']); // .pfx file
$gateway->setCertPassword($config['certPassword']);
$gateway->setReturnUrl($config['returnUrl']);
$gateway->setNotifyUrl($config['notifyUrl']);

$order = [
    'orderId'   => date('YmdHis'), //Your order ID
    'txnTime'   => date('YmdHis'), //Should be format 'YmdHis'
    'orderDesc' => 'My order title', //Order Title
    'txnAmt'    => '100', //Order Total Fee
];

$response = $gateway->purchase($order)->send();

$response->getRedirectHtml(); //For PC/Wap
$response->getTradeNo(); //For APP

Return/Notify

$gateway    = Omnipay::create('UnionPay_Express');
$gateway->setMerId($config['merId']);
$gateway->setCertDir($config['certDir']); //The directory contain *.cer files
$response = $gateway->completePurchase(['request_params'=>$_REQUEST])->send();
if ($response->isPaid()) {
    //pay success
}else{
    //pay fail
}

Query Order Status

$response = $gateway->Omnipay::queryStatus([
    'orderId' => '20150815121214', //Your site trade no, not union tn.
    'txnTime' => '20150815121214', //Order trade time
    'txnAmt'  => '200', //Order total fee
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

Consume Undo

$response = $gateway->consumeUndo([
    'orderId' => '20150815121214', //Your site trade no, not union tn.
    'txnTime' => date('YmdHis'), //Regenerate a new time
    'txnAmt'  => '200', //Order total fee
    'queryId' => 'xxxxxxxxx', //Order total fee
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

Refund

$response = $gateway->refund([
    'orderId' => '20150815121214', //Your site trade no, not union tn.
    'txnTime' => '20150815121214', //Order trade time
    'txnAmt'  => '200', //Order total fee
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

File Transfer

$response = $gateway->fileTransfer([
    'txnTime'    => '20150815121214', //Order trade time
    'settleDate' => '0119', //Settle Date
    'fileType'   => '00', //File Type
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

For general usage instructions, please see the main Omnipay repository., (*8)

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., (*9)

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., (*10)

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., (*11)

The Versions

29/08 2017

dev-master

9999999-dev https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

29/08 2017

1.0.9

1.0.9.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

31/07 2017

1.0.8

1.0.8.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

31/07 2017

1.0.7

1.0.7.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

31/07 2017

1.0.6

1.0.6.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

31/07 2017

1.0.5

1.0.5.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

24/07 2017

1.0.4

1.0.4.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

27/06 2017

1.0.3

1.0.3.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

27/03 2017

1.0.2

1.0.2.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

16/02 2017

1.0.1

1.0.1.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联

16/02 2017

1.0.0

1.0.0.0 https://github.com/wjminons/omnipay-unionpay

UnionPay gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

payment pay gateway merchant purchase omnipay union unionpay 银联