定制 xplwechat/weixin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xplwechat/weixin

Composer 安装命令:

composer require xplwechat/weixin

包简介

yii2微信支付组件

README 文档

README

yii2微信支付组件

CHANGE LOG

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require xplwechat/weixin

or add

"xplwechat/weixin": "*"

to the require section of your composer.json.

Configuration

To use this extension, simply add the following code in your application configuration:

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><![CDATA[SUCCESS]]></return_code></xml>';
}else{
	echo '<xml><return_code><![CDATA[FAIL]]></return_code></xml>';
}

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固