Wechat payment gateway PHP extension: omnipay-wechat

Source: Internet
Author: User
Tags oauth openid
Payment Gateway PHP extension: omnipay-wechat is an extension of omnipay's payment gateway, which provides a payment interface based on the omnipay payment framework.

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.

Project homepage:Http://www.open-open.com/lib/view/home/1439890446520

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.