WeChat payment gateway PHP extension: omnipay-wechat

Source: Internet
Author: User
Tags oauth openid
Omnipay-wechat is the omnipay payment gateway extension that provides payment interfaces 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 is 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 the URL for We Chat OAuth And$wechat_express-->getopenid ($code) in callback page to get OpenID.

p.s. The URL for WeChat OAuth must is opened in WeChat In-app Broswer, can Usestrpos ($_server[' http_user_agent '), ' Mic Romessenger ') = = = Falseto Check if the page were not opened in it, and generate a QR code for user.

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

Project home: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.