Download the PHP package yuyue8/tp-wechat without Composer

On this page you can find all versions of the php package yuyue8/tp-wechat. 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 tp-wechat

TpWechat

安装

composer require yuyue8/tp-wechat

微信公众号

微信公众号配置

在tp_wechat配置文件内修改wechat配置

微信公众号服务接口

在控制器中添加以下代码,并在公众号后台设置该接口

微信公众号内置功能

若使用内置的关注、取消关注、模版消息功能,需要创建相关数据表,创建语句如下:

然后运行Yuyue8\TpWechat\jobs\WechatNoticeSendJobs消息队列,对消息进行处理

模版消息发送

在template配置文件设置模版消息相关配置,然后调用Yuyue8\TpWechat\services\WechatNoticeRecordServices类的sendTemplate方法,

将会保存消息记录到数据表,并进入Yuyue8\TpWechat\jobs\WechatNoticeSendJobs消息队列

自定义微信公众号相关功能

如需自定义微信公众号相关功能,只需以下步骤:

创建微信服务类,继承Yuyue8\TpWechat\service\WechatService类或者Yuyue8\TpWechat\interfaces\WechatInterface接口,并实现相关方法 在provider.php文件中绑定微信服务类到接口

例如: 创建的微信服务类为app\service\Wechat,在provider.php文件中添加

后续所有操作将由app\service\Wechat类完成

微信支付

微信支付配置

在tp_wechat配置文件内修改wechat_pay配置

微信支付服务接口

在控制器中添加以下代码,并在商户号后台设置该接口,以接受订单支付通知和退款通知

由于订单数据表没有规则,所以请自行实现订单支付通知和退款通知后续操作,具体步骤如下:

🚨🚨🚨 注意:推送信息不一定靠谱哈,请务必验证 建议是拿订单号调用微信支付查询接口,以查询到的订单状态为准

自定义微信支付相关功能

Yuyue8\TpWechat\service\WechatPayService类内置了下单退单等功能,直接调用即可

如需自定义支付相关功能,只需以下步骤:

创建微信支付服务类,继承Yuyue8\TpWechat\service\WechatPayService类或者Yuyue8\TpWechat\interfaces\WechatPayInterface接口,并实现相关方法 在provider.php文件中绑定微信支付服务类到接口

例如: 创建的微信支付服务类为app\service\PayWechat,在provider.php文件中添加

更新微信支付平台证书

Yuyue8\TpWechat\service\WechatPayService类中的updatePlatformCerts方法可以更新微信支付平台证书,请每个商户号每天执行一次

警告

考虑到效率和多商户的情况,Yuyue8\TpWechat\service\WechatService类和Yuyue8\TpWechat\service\WechatPayService类中使用了单例且属性值为数组,所以在修改了tp_wechat配置文件或更新平台证书后,一定要重启或重置以下类,否则修改的配置和平台证书将不会生效

Yuyue8\TpWechat\service\WechatService类、Yuyue8\TpWechat\service\WechatPayService类和Yuyue8\TpWechat\interfaces\WechatPayInterface接口

例如:


All versions of tp-wechat with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.2
topthink/framework Version ^6.0 | ^8.0
w7corp/easywechat Version ^6.7
yuyue8/tp_queue Version ^1.0
yuyue8/tp_driver Version ^1.0
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 yuyue8/tp-wechat contains the following files

Loading the files please wait ...