Download the PHP package phpwxpay/payment without Composer

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

php微信支付企业付款、发送现金红包封装类,可适用于 微擎(we7),thinkphp,原生php应用等框架

在做一个微擎项目时发现微擎没有封装好的企业付款到零钱和发送现金红包等方法函数,于是自己动手封装了一个。

Composer安装

安装最新的版本

不使用Composer

git clone 获取代码到本地

拷贝文件Phpwxpay.php到项目目录并引入

$payConfig (Array) 支付配置参数:

参数 类型 必填 描述
appid string 应用appid (商户号绑定的appid)
mchid string 微信支付商户号
apikey string 商户支付密钥
spbill_create_ip string 商户平台设置的IP白名单,如果不传值,自动获取服务器ip
cert_pem string 商户支付证书(apiclient_cert.pem),绝对路径
key_pem string 支付证书私钥(apiclient_key.pem),绝对路径

示例代码

企业付款到零钱:

$data(Array) 参数:

参数 类型 必填 描述
openid string 要给付款的用户openid
amount float 付款金额(如0.5元)
desc string 付款备注信息

企业付款到零钱成功返回信息(Array)

参数 类型 必填 示例值 描述
mch_appid string wx8888888888888888 商户appid
mchid string 1234567890 商户号
device_info string 013467007045764 微信支付分配的终端设备号
nonce_str string 5K8264ILTKCH16CQ2502SI8ZNMTM67VS 随机字符串
result_code string SUCCESS 业务结果SUCCESS/FAIL
partner_trade_no string 10000098201411111234567890 商户订单号
payment_no string 1007752501201407033233368018 企业付款成功,返回的微信付款单号
payment_time string 2015-05-19 15:26:59 企业付款成功时间
return_code string SUCCESS 返回状态码SUCCESS/FAIL(此字段是通信标识,非交易标识)

微信现金红包

$data 参数(Array):

参数 类型 必填 描述
openid string 接收红包用户的openid
amount float 红包金额(如0.3元)
send_name string 红包发送者名称(不能超过10个汉字)
wishing string 红包祝福语(不能超过42个汉字)
act_name string 活动名称(不能超过10个汉字)
send_name string 红包发送者名称(不能超过10个汉字)
desc string 红包备注信息

微信现金红包成功返回信息(Array)

参数 类型 必填 示例值 描述
wxappid string wx8888888888888888 商户appid
mch_id string 1234567890 商户号
send_listid string 100000000020150520314766074200 红包订单的微信单号
nonce_str string 5K8264ILTKCH16CQ2502SI8ZNMTM67VS 随机字符串
result_code string SUCCESS 业务结果SUCCESS/FAIL
mch_billno string 10000098201411111234567890 商户订单号
re_openid string oxTWIuGaIt6gTKsQRLau2M0yL16E 接受收红包的用户在wxappid下的openid
return_code string SUCCESS 返回状态码SUCCESS/FAIL(此字段是通信标识,非交易标识)

All versions of payment with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 phpwxpay/payment contains the following files

Loading the files please wait ....