Download the PHP package openforall/wechat-sdk without Composer

On this page you can find all versions of the php package openforall/wechat-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wechat-sdk

OpenForAll 微信开发 SDK - PHP版

![OpenForAll Logo](https://img.shields.io/badge/OpenForAll-微信开发SDK-blue) [![PHP Version](https://img.shields.io/badge/PHP-%3E%3D7.0-8892BF.svg)](https://www.php.net/) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/openforall/wechat-sdk-php.svg)](https://github.com/openforall/wechat-sdk-php/stargazers) [![GitHub Issues](https://img.shields.io/github/issues/openforall/wechat-sdk-php.svg)](https://github.com/openforall/wechat-sdk-php/issues) **🚀 企业级微信API开发工具包 | 5分钟快速接入 | 开箱即用** [快速开始](#快速开始) • [在线演示](https://openforall.liebianjun.com/sdk/php/demo/) • [完整文档](https://openforall.liebianjun.com/docs) • [API参考](#api文档)

✨ 核心特性

🎯 功能全面

🔒 安全可靠

📦 开箱即用


📋 目录


🔧 系统要求


🚀 快速开始

方式一:Composer安装(推荐)

方式二:手动下载

基础使用


📦 安装方式

Composer安装(推荐)

在项目根目录执行:

在代码中引入:

手动安装

  1. 下载SDK

  2. 引入文件

  3. 配置应用

⚙️ 配置说明

基础配置

创建 config.php 文件:

获取API密钥

  1. 访问 OpenForAll平台
  2. 注册并登录账号
  3. 进入"应用管理"页面
  4. 创建应用并获取 API KeyAPI Secret

环境变量配置(推荐)


💡 使用示例

用户注册与登录

微信支付

支付宝支付

余额支付

用户信息管理

文件上传

短信验证码

邮件验证码


📚 API文档

用户接口

方法 说明 参数
userRegister() 用户注册 username, password, email, mobile, code
userLogin() 账号登录 account, password
userMobileLogin() 手机验证码登录 mobile, captcha
getUserInfo() 获取用户信息 -
updateProfile() 修改用户资料 array $data
changeEmail() 修改邮箱 email, code
changeMobile() 修改手机号 mobile, code
resetPassword() 重置密码 mobile, code, newpassword
userLogout() 退出登录 -

支付接口

方法 说明 参数
createPayment() 创建支付订单 array $data
wechatPay() 微信支付 billId, tradeType, openid
alipay() 支付宝支付 billId
balancePay() 余额支付 billId, requestId
balancePayPackage() 余额支付套餐 array $data
queryPayment() 查询支付状态 orderNo
cancelPayment() 取消支付 orderNo

短信接口

方法 说明 参数
sendSms() 发送短信验证码 mobile, event
verifySms() 验证短信验证码 mobile, code, event

邮件接口

方法 说明 参数
sendEmail() 发送邮件验证码 email, event
verifyEmail() 验证邮件验证码 email, code, event

公共接口

方法 说明 参数
init() 初始化配置 version, lng, lat
uploadFile() 上传文件 filePath
getCaptcha() 获取验证码 id

完整API文档

访问 完整API文档 查看详细的接口说明和参数定义。


🎨 在线演示

我们提供了完整的在线演示,您可以直接体验所有功能:

演示地址

🌐 主页: https://openforall.liebianjun.com/sdk/php/demo/

演示功能

测试账号


🔍 错误处理

所有API调用失败时返回 false,可以通过 getLastError() 获取错误信息:

常见错误码

错误码 说明 解决方案
401 签名验证失败 检查API Key和Secret是否正确
403 权限不足 检查账号权限配置
404 接口不存在 检查API URL和接口路径
422 参数验证失败 检查请求参数是否完整
500 服务器错误 联系技术支持

❓ 常见问题

1. 如何获取API密钥?

访问 OpenForAll平台,注册账号后在"应用管理"页面创建应用,即可获取API Key和API Secret。

2. 签名验证失败怎么办?

3. 支付回调如何处理?

SDK会自动处理支付回调,您只需要在配置文件中设置正确的回调地址。详见支付回调文档

4. 如何启用调试模式?

在配置文件中设置 debugtrue

5. 支持哪些PHP版本?

SDK支持PHP 7.0及以上版本,推荐使用PHP 7.4或PHP 8.x。

6. 如何处理并发请求?

SDK内置了连接池和请求队列,可以自动处理并发请求。建议使用异步处理或消息队列处理大量并发。


🤝 贡献指南

我们欢迎所有形式的贡献!

如何贡献

  1. Fork 本仓库
  2. 创建 特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交 更改 (git commit -m 'Add some AmazingFeature')
  4. 推送 到分支 (git push origin feature/AmazingFeature)
  5. 提交 Pull Request

贡献类型

代码规范


📞 技术支持

获取帮助

社区交流


🌟 相关项目

官方SDK

框架集成


📄 开源协议

本项目采用 MIT License 开源协议。


📈 项目统计

GitHub stars GitHub forks GitHub watchers


🎉 致谢

感谢所有为本项目做出贡献的开发者!

Contributors


**⭐ 如果这个项目对您有帮助,请给我们一个Star!⭐** Made with ❤️ by [OpenForAll Team](https://openforall.liebianjun.com) [官网](https://openforall.liebianjun.com) • [文档](https://openforall.liebianjun.com/docs) • [演示](https://openforall.liebianjun.com/sdk/php/demo/) • [博客](https://blog.openforall.com)

All versions of wechat-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
ext-json Version *
ext-openssl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package openforall/wechat-sdk contains the following files

Loading the files please wait ...