微信开发工具包 WeChatDeveloper for PHP

码农软件 · 软件分类 · 微信/微信小程序 · 2019-03-13 10:59:51

软件介绍

Latest Stable Version Latest Unstable Version Total Downloads License

WeChatDeveloper for PHP

  • WeChatDeveloper 是基于 wechat-php-sdk 重构,优化并完善;

  • 运行最底要求 PHP 版本 5.4 , 建议在 PHP7 上运行以获取最佳性能;

  • WeChatDeveloper 针对 access_token 失效增加了自动刷新机制;

  • 微信的部分接口需要缓存数据在本地,因此对目录需要有写权限;

  • 我们鼓励大家使用 composer 来管理您的第三方库,方便后期更新操作;

  • WeChatDeveloper 已历经数个线上项目考验,欢迎 fork 或 star 此项目。

功能描述

  • 微信小程序,服务端接口支持

  • 微信认证服务号,服务端接口支持

  • 微信支付(账单、卡券、红包、退款、转账、App支付、JSAPI支付、Web支付、扫码支付等)

  • 支付宝支付(账单、转账、App支付、刷卡支付、扫码支付、Web支付、Wap支付等)

技术帮助

WeChatDeveloper 是基于官方接口封装,在做微信开发前,必需先阅读微信官方文档。

针对 WeChatDeveloper 也有一准备了帮助资料可供参考。

代码仓库

WeChatDeveloper 为开源项目,允许把它用于任何地方,不受任何约束,欢迎 fork 项目。

文件说明

文件名类名描述类型加载 ①
App.phpAliPay\App支付宝App支付支付宝\We::AliPayApp()
Bill.phpAliPay\Bill支付宝账单下载支付宝\We::AliPayBill()
Pos.phpAliPay\Pos支付宝刷卡支付支付宝\We::AliPayPos()
Scan.phpAliPay\Scan支付宝扫码支付支付宝\We::AliPayScan()
Transfer.phpAliPay\Transfer支付宝转账支付宝\We::AliPayTransfer()
Wap.phpAliPay\Wap支付宝Wap支付支付宝\We::AliPayWap()
Web.phpAliPay\Web支付宝Web支付支付宝\We::AliPayWeb()
Card.phpWeChat\Card微信卡券接口支持认证服务号\We::WeChatCard()
Custom.phpWeChat\Custom微信客服消息接口支持认证服务号\We::WeChatCustom()
Media.phpWeChat\Media微信媒体素材接口支持认证服务号\We::WeChatMedia()
Oauth.phpWeChat\Oauth微信网页授权消息类接口认证服务号\We::WeChatOauth()
Pay.phpWeChat\Pay微信支付类接口认证服务号\We::WeChatPay()
Product.phpWeChat\Product微信商店类接口认证服务号\We::WeChatProduct()
Qrcode.phpWeChat\Qrcode微信二维码接口支持认证服务号\We::WeChatQrcode()
Receive.phpWeChat\Receive微信推送事件消息处理支持认证服务号\We::WeChatReceive()
Scan.phpWeChat\Scan微信扫一扫接口支持认证服务号\We::WeChatScan()
Script.phpWeChat\Script微信前端JSSDK支持认证服务号\We::WeChatScript()
Shake.phpWeChat\Shake微信蓝牙设备揺一揺接口认证服务号\We::WeChatShake()
Tags.phpWeChat\Tags微信粉丝标签接口支持认证服务号\We::WeChatTags()
Template.phpWeChat\Template微信模板消息接口支持认证服务号\We::WeChatTemplate()
User.phpWeChat\User微信粉丝管理接口支持认证服务号\We::WeChatCard()
Wifi.phpWeChat\Wifi微信门店WIFI管理支持认证服务号\We::WeChatWifi()
Bill.phpWePay\Bill微信商户账单及评论微信支付\We::WePayBill()
Coupon.phpWePay\Coupon微信商户代金券微信支付\We::WePayCoupon()
Order.phpWePay\Order微信商户订单微信支付\We::WePayOrder()
Redpack.phpWePay\Redpack微信红包支持微信支付\We::WePayRedpack()
Refund.phpWePay\Refund微信商户退款微信支付\We::WePayRefund()
Transfers.phpWePay\Transfers微信商户打款到零钱微信支付\We::WePayTransfers()
TransfersBank.phpWePay\TransfersBank微信商户打款到银行卡微信支付\We::WePayTransfersBank()
Crypt.phpWeMini\Crypt微信小程序数据加密处理微信小程序\We::WeMiniCrypt()
Plugs.phpWeMini\Plugs微信小程序插件管理微信小程序\We::WeMiniPlugs()
Poi.phpWeMini\Poi微信小程序地址管理微信小程序\We::WeMiniPoi()
Qrcode.phpWeMini\Qrcode微信小程序二维码管理微信小程序\We::WeMiniCrypt()
Template.phpWeMini\Template微信小程序模板消息支持微信小程序\We::WeMiniTemplate()
Total.phpWeMini\Total微信小程序数据接口微信小程序\We::WeMiniTotal()

安装使用

1.1 通过 Composer 来管理安装

# 首次安装 线上版本(稳定)
composer require zoujingli/wechat-developer

# 首次安装 开发版本(开发)
composer require zoujingli/wechat-developer dev-master

# 更新 WeChatDeveloper
composer update zoujingli/wechat-developer

1.2 如果不使用 Composer, 可以下载 WeChatDeveloper 并解压到项目中

# 在项目中加载初始化文件
include "您的目录/WeChatDeveloper/include.php";

2.1 接口实例所需参数

$config = [
    'token'          => 'test',
    'appid'          => 'wx60a43dd8161666d4',
    'appsecret'      => '71308e96a204296c57d7cd4b21b883e8',
    'encodingaeskey' => 'BJIUzE0gqlWy0GxfPp4J1oPTBmOrNDIGPNav1YFH5Z5',
    // 配置商户支付参数(可选,在使用支付功能时需要)
    'mch_id'         => "1235704602",
    'mch_key'        => 'IKI4kpHjU94ji3oqre5zYaQMwLHuZPmj',
    // 配置商户支付双向证书目录(可选,在使用退款|打款|红包时需要)
    'ssl_key'        => '',
    'ssl_cer'        => '',
    // 缓存目录配置(可选,需拥有读写权限)
    'cache_path'     => '',
];

3.1 实例指定接口

try {

    // 实例对应的接口对象
    $user = new \WeChat\User($config);
    
    // 调用接口对象方法
    $list = $user->getUserList();
    
    // 处理返回的结果
    echo '';
    var_export($list);
    
} catch (Exception $e) {

    // 出错啦,处理下吧
    echo $e->getMessage() . PHP_EOL;
    
}

本文地址:https://codercto.com/soft/d/1246.html

Ant Colony Optimization

Ant Colony Optimization

Marco Dorigo、Thomas Stützle / A Bradford Book / 2004-6-4 / USD 45.00

The complex social behaviors of ants have been much studied by science, and computer scientists are now finding that these behavior patterns can provide models for solving difficult combinatorial opti......一起来看看 《Ant Colony Optimization》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器