2017 © Pedro Peláez
 

library wechat

wechat for frame Yii2 and Thinkphp5

image

sunnnnn/wechat

wechat for frame Yii2 and Thinkphp5

  • Friday, July 14, 2017
  • by sunnnnn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

微信借口开发,集成主流框架(thinkphp5、yii2)

配置

tp5 中config.php中放入配置信息: 'wechat' => [ 'app_id' => '', //app id 'app_secret' => '', //app secret 'mch_id' => '', //商户号 'mch_key' => '', //商户 key 'cert_path' => '', //证书路径 ], 'wxpay' => [ 'app_id' => '', //app id 'app_secret' => '', //app secret 'mch_id' => '', //商户号 'mch_key' => '', //商户 key 'cert_path' => '', //证书路径 'key_path' => '', //证书路径 ],, (*1)

controller: $wechat = new WechatTp();, (*2)

扫码支付

$wxPay = new WxPayTp(); $src = $wxPay->native([ body=>商品描述, attach=>附加数据, outTradeOn=>商户订单号, fee=>费用, tag=>商品标记, notify=>回掉地址, productId=>商品ID ]);, (*3)

echo "";, (*4)

js支付

$jsApiParameters = $wxPay->jsApi([ body=>商品描述, attach=>附加数据, outTradeOn=>商户订单号, fee=>费用, tag=>商品标记, notify=>回掉地址, productId=>商品ID ]);, (*5)

jsApiParameters为生成的用于调用微信支付接口的配置数据,用法查阅微信支付文档, (*6)

```, (*7)

yii2配置: 'components' => [ 'wechat' => [ 'class' => 'sunnnnn\wechat\mp\Wechat', 'config' => [ 'app_id' => '', //app id 'app_secret' => '', //app secret 'mch_id' => '', //商户号 'mch_key' => '', //商户 key 'cert_path' => '', //证书路径 ] ], 'wxpay' => [ 'class' => 'sunnnnn\wechat\pay\WxPay', 'config' => [ 'app_id' => '', //app id 'app_secret' => '', //app secret 'mch_id' => '', //商户号 'mch_key' => '', //商户 key 'cert_path' => '', //证书路径 'key_path' => '', //证书路径 ] ], ],, (*8)

controller:, (*9)

扫码支付

$src = Yii::$app->wxpay->native([ body=>商品描述, attach=>附加数据, outTradeOn=>商户订单号, fee=>费用, tag=>商品标记, notify=>回掉地址, productId=>商品ID ]);, (*10)

echo "";, (*11)

js支付

$jsApiParameters = Yii::$app->wxpay->jsApi([ body=>商品描述, attach=>附加数据, outTradeOn=>商户订单号, fee=>费用, tag=>商品标记, notify=>回掉地址, productId=>商品ID ]);, (*12)

jsApiParameters为生成的用于调用微信支付接口的配置数据,用法查阅微信支付文档, (*13)

The Versions

14/07 2017

dev-master

9999999-dev

wechat for frame Yii2 and Thinkphp5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar sunnnnn

12/05 2017

v1.1.0

1.1.0.0

wechat for frame Yii2 and Thinkphp5

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar sunnnnn

28/12 2016

1.0.0

1.0.0.0

wechat for frame (tp5)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar sunnnnn