elilee/yii2-weixin

一个专注于yii2微信的SDK

安装: 8

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:yii2-extension

v1.0.2 2018-08-16 03:16 UTC

This package is not auto-updated.

Last update: 2024-09-20 09:49:28 UTC


README

写在前面,该扩展是根据北哥yii2-wx课程,边学边写的,但不保证和北哥代码完全一致,如果想要深入学习可以到北哥网站(https://nai8.me/)学习相关课程。

之所以建立这个扩展主要是为了自用方便。

yii2微信的SDK (自用)

安装

安装此扩展的首选方式是通过 composer

运行

php composer.phar require --prefer-dist elilee/yii2-wx "*"

或添加

"elilee/yii2-wx": "*"

到你的 composer.json 文件的 require 部分。

用法

设置

在 params 中增加如下内容

'wx'=>[

        'app_id' => 'wxasdasf3slfmiem3mi2f',
        'secret' => '***************************',
        'token'  => 'elilee',

        'payment' => [
            'mch_id'        => '',//商户ID
            'key'           => '', //商户KEY
            'notify_url'    => '',//支付通知地址
            'cert_path'     => '',//证书
            'key_path'      => '',//证书
        ]
    ]

use

use elilee\wx\Application;

$config = Yii::$app->params['wx'];
$app = new Application(['conf'=>$config]);

$server=$app->driver('server');
$response = $server->server();

return $response;

function list

用户相关 支付相关 客服功能 红包相关