Download the PHP package wechatpay/wechatpay-guzzle-middleware without Composer

On this page you can find all versions of the php package wechatpay/wechatpay-guzzle-middleware. 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 wechatpay-guzzle-middleware

wechatpay-guzzle-middleware

概览

微信支付API v3Guzzle HttpClient中间件Middleware,实现了请求签名的生成和应答签名的验证。

如果你是使用Guzzle的商户开发者,可以在构造GuzzleHttp\Client时将WechatPayGuzzleMiddleware传入,得到的GuzzleHttp\Client实例在执行请求时将自动携带身份认证信息,并检查应答的微信支付签名。

项目状态

当前版本为0.2.0测试版本。请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。

本项目处于维护状态,我们推荐所有的开发者优先使用微信支付新的 PHP 开发库 wechatpay-php

环境要求

我们开发和测试使用的环境如下:

备注:不支持 guzzle7 的具体原因可以见 #54讨论。依赖 guzzle7 的开发者请使用 wechatpay-php

安装

可以使用PHP包管理工具composer引入SDK到项目中:

Composer

方式一:在项目目录中,通过composer命令行添加:

方式二:在项目的composer.json中加入以下配置:

添加配置后,执行安装

开始

首先,通过WechatPayMiddlewareBuilder构建一个WechatPayMiddleware,然后将其加入GuzzleHttp\ClientHandlerStack中。我们提供相应的方法,可以方便的传入商户私钥和微信支付平台证书等信息。

上传媒体文件

敏感信息加/解密

定制

当默认的本地签名和验签方式不适合你的系统时,你可以通过实现Signer或者Verifier来定制签名和验签。比如,你的系统把商户私钥集中存储,业务系统需通过远程调用进行签名,你可以这样做。

常见问题

如何下载平台证书?

使用WechatPayMiddlewareBuilder需要调用withWechatpay设置微信支付平台证书,而平台证书又只能通过调用获取平台证书接口下载。为了解开"死循环",你可以在第一次下载平台证书时,按照下述方法临时"跳过”应答签名的验证。

注意:业务请求请使用标准的初始化流程,务必验证应答签名。

证书和回调解密需要的AesGcm解密在哪里?

请参考AesUtil.php。

配合swoole使用时,上传文件接口报错

建议升级至swoole 4.6+,swoole在 4.6.0 中增加了native-curl(swoole/swoole-src#3863)支持,我们测试能正常使用了。 更详细的信息,请参考#36

联系我们

如果你发现了BUG或者有任何疑问、建议,请通过issue进行反馈。

也欢迎访问我们的开发者社区


All versions of wechatpay-guzzle-middleware with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
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 wechatpay/wechatpay-guzzle-middleware contains the following files

Loading the files please wait ....