微信支付网关PHP扩展:omnipay-wechat

WBOY
發布: 2016-06-20 12:50:20
原創
1420 人瀏覽過

omnipay-wechat 是 omnipay 的微信支付网关扩展,提供基于 omnipay 支付框架的微信支付接口。

Installation

Omnipay is installed via Composer. To install, simply add it to yourcomposer.jsonfile:

{ "require": { "labs7in0/omnipay-wechat": "dev-master" }}
登入後複製

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php$ php composer.phar update
登入後複製

Basic Usage

The following gateways are provided by this package:

  • WeChat Express (WeChat JSAPI)

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

WeChat JSAPI require OAuth openid to submit a new order, use$WeChat_Express->getAuthCode($callback)to get an url for WeChat OAuth and$WeChat_Express-->getOpenid($code)in callback page to get openid.

p.s. the url for WeChat OAuth must be opened in WeChat In-App broswer, you can usestrpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === falseto check if the page were not opened in it, and generate a QR code for user.

All methods for WeChat OAuth will be removed in next stable version and I'll publish a WeChat MP library package for composer.

项目主页:http://www.open-open.com/lib/view/home/1439890446520

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板