Download the PHP package yoozi/weixin without Composer
On this page you can find all versions of the php package yoozi/weixin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package weixin
Short Description PHP library for interacting with weixin api.
License MIT
Informations about the package weixin
Weixin [WIP]
This library is deprecated and not maintained, use overtrue/wechat instead.
This library is part of Project Golem, see yoozi/golem for more info.
Weixin is a Laravel package for interacting with 微信公众平台.
Content
- Installation
- Setup
- Usage
Install
You can install this library via Composer:
Or declare in the composer.json
:
and install it:
Setup
Config
Before using this package, you have to publish the configuration file via:
And it will create a configuration file in your-project/app/config/packages/yoozi/weixin/
.
You should setup your weixin account information in weixin.php
:
name | description |
---|---|
token | server side token (required) |
app_id | your weixin account app id (required) |
app_secret | your weixin account app secret key (required) |
end_point | weixin server event receive endpoint (required) |
Service & Facades
To enable this package, you should add this following lines to config/app.php
:
Usage
Weixin will provide you:
- a router for binding server event callback,
- a weixin client for interacting with
api.weixin.qq.com
, - a OAuth client for performing OAuth login.
Bind Events
In routes.php
:
In MyWeixinEventHandler.php
:
Weixin Client
Weixin client can be used to:
- retrieve access token
- retrieve user's basic profile via openid
Example:
OAuth Client
Weixin OAtuth client provides you:
- generate authorize url with callback
- retrieve access token with OAuth code
- retrieve user's basic profile with access token
Example: