2017 © Pedro Peláez
 

library wxapp_authorize

image

bayuexiong/wxapp_authorize

  • Wednesday, May 3, 2017
  • by bayuexiong
  • Repository
  • 1 Watchers
  • 5 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

Installation

composer require bayuexiong/wxapp_authorize, (*1)

Basic Usage

Get SessionKey
require "vendor/autoload.php";

use Wxapp\Wechat\Auth;

$app_id = '';
$app_secret = '';
$code = '';

$auth = new Auth($app_id, $app_secret);

try {
    $data = $auth->authorize($code);
    $open_id = $data['openid'];
    $session_key = $data['session_key'];
} catch (Exception $e) {
    var_dump($e);
}
Decode UserInfo
$session_key = '';
$encrypt_data = '';
$iv = '';

$user = new User($app_id, $app_secret);
try {
    $info = $user->decode($session_key, $encrypt_data, $iv);
    $open_id = $info['openId'];
    $union_id = $info['unionId'];
catch (Exception $e) {
    var_dump($e);
}

License

wxapp_authorize is licensed under the MIT License - see the LICENSE file for details, (*2)

The Versions

03/05 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Avatar bayuexiong

03/05 2017

v0.2

0.2.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Avatar bayuexiong

28/12 2016

v0.1

0.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Avatar bayuexiong