2017 © Pedro Peláez
 

yii2-extension weixin

yii2微信支付组件

image

xplwechat/weixin

yii2微信支付组件

  • Sunday, April 1, 2018
  • by q490880
  • Repository
  • 1 Watchers
  • 2 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 33 % Grown

The README.md

yii2-wxpay

yii2微信支付组件, (*1)

CHANGE LOG, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require xplwechat/weixin

or add, (*5)

"xplwechat/weixin": "*"

to the require section of your composer.json., (*6)

Configuration

To use this extension, simply add the following code in your application configuration:, (*7)

return [
    //....
    'components' => [
        'wxpay'=>[
            'class'=>'xplwechat\weixin\Wxpay',
            'back_url'=> '回调地址',
            'app_id'=>'APPID',
            'mch_id'=>'MCHID',
            'key'=>'KEY',
            'app_secret'=>'APPSECRET',
            'ssl_cert_path'=>'../cert/apiclient_cert.pem',
            'ssl_key_path'=>'../cert/apiclient_key.pem',
            'curl_proxy_host'=>'0.0.0.0',
            'curl_proxy_port'=>0,
            'report_level'=>1,
        ],
    ],
];

[生成支付信息]
$result = \Yii::$app->wxpay->unifiedOrder([
                'attach'=>'扩展字段',
                'out_trade_no'=>'订单号',
                'price'=>'价格(分)',
                'body'=>'商品描述',
                'tag'=>'商品标签',
                'id'=>'商品ID',
            ])
将result通过json形式返给客户端即可

[回调代码]
--------------------
$result = false;
if($notifyData = \Yii::$app->wxpay->notify()){
    $result = "回调逻辑";
}
if($result){
    echo '<xml><return_code></return_code></xml>';
}else{
    echo '<xml><return_code></return_code></xml>';
}

The Versions

01/04 2018

dev-master

9999999-dev

yii2微信支付组件

  Sources   Download

MIT

The Requires

 

by XuPengLiang

yii2 wechat wxpay

01/04 2018

v0.1

0.1.0.0

yii2微信支付组件

  Sources   Download

MIT

The Requires

 

by XuPengLiang

yii2 wechat wxpay