silentlun/yii2-wxpay
Composer 安装命令:
composer require silentlun/yii2-wxpay
包简介
Wxpay extension for YII2
关键字:
README 文档
README
Wxpay extension for YII2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist silentlun/yii2-wxpay "*"
or add
"silentlun/yii2-wxpay": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
Controller
namespace app\controllers; use yii\web\Controller; use silentlun\wxpay\WxPay; class SiteController extends Controller { public $wxpayConfig = [ 'appid' => '公众号ID', 'mch_id' => '商户号ID', 'key' => '商户KEY', 'app_secret' => '公众号SECRET', ]; public function actionPay() { $order = []; // 订单信息 $payment = new WxPay($this->wxpayConfig); $result = $payment->createMiniPay($order); Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return $payment->GetJsApiParameters($result); } }
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-03-08