Alipay driver for the Omnipay PHP payment processing library
PHP
Latest commit 465f9e3 May 24, 2018
Permalink
Failed to load latest commit information.
src Apply fixes from StyleCI May 24, 2018
tests Upgrade Omnipay Core to v3 stable May 21, 2018
.gitignore Add .DS_Store Sep 23, 2016
.travis.yml only support > php 7.1 Mar 30, 2018
CHANGELOG.md Add changelog Sep 25, 2016
CONTRIBUTING.md Update CONTRIBUTING guide. May 21, 2018
LICENSE Rename Sep 25, 2016
README.md Update README May 21, 2018
composer.json recover May 24, 2018
phpunit.xml.dist - Sep 25, 2016

README.md

Omnipay: Alipay

travis Latest Version on Packagist Total Downloads Code Coverage Software License

Alipay driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Alipay support for Omnipay.

Cross-border Alipay payment please use lokielse/omnipay-global-alipay

Legacy Version please use "lokielse/omnipay-alipay": "dev-legacy"

Installation

composer require lokielse/omnipay-alipay

Basic Usage

The following gateways are provided by this package:

Gateway Description 说明   Links
Alipay_AopPage Alipay Page Gateway 电脑网站支付 - new Usage Doc
Alipay_AopApp Alipay APP Gateway APP支付 - new Usage Doc
Alipay_AopF2F Alipay Face To Face Gateway 当面付 - new Usage Doc
Alipay_AopWap Alipay WAP Gateway 手机网站支付 - new Usage Doc
Alipay_AopJs Alipay Js Gateway JSAPI - new Usage Doc
Alipay_LegacyApp Alipay Legacy APP Gateway APP支付 Usage Doc
Alipay_LegacyExpress Alipay Legacy Express Gateway 即时到账 Usage Doc
Alipay_LegacyWap Alipay Legacy WAP Gateway 手机网站支付 Usage Doc

Usage

Purchase (购买)

/**
 * @var AopAppGateway $gateway
 */
$gateway = Omnipay::create('Alipay_AopPage');
$gateway->setSignType('RSA2'); // RSA/RSA2/MD5
$gateway->setAppId('the_app_id');
$gateway->setPrivateKey('the_app_private_key');
$gateway->setAlipayPublicKey('the_alipay_public_key');
$gateway->setReturnUrl('https://www.example.com/return');
$gateway->setNotifyUrl('https://www.example.com/notify');

/**
 * @var AopTradePagePayResponse $response
 */
$response = $gateway->purchase()->setBizContent([
    'subject'      => 'test',
    'out_trade_no' => date('YmdHis') . mt_rand(1000, 9999),
    'total_amount' => '0.01',
    'product_code' => 'FAST_INSTANT_TRADE_PAY',
])->send();

$url = $response->getRedirectUrl();

For general usage instructions, please see the

Related

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.