Giter Site home page Giter Site logo

thinkphp5-wxpay's Introduction

ThinkPHP5 微信支付扩展库(2017年9月24日)

此项目已停止维护,如果有需要类似SDK的,可以去 https://github.com/zoujingli/pay-php-sdk 看一看

使用说明

  • 在默认配置情况下,将文件夹拷贝到根目录即可, 其中extend目录为扩展目录
  • 需要在配置文件extend/wxpay/lib/WxPayConfig.php中填写必要的参数
  • 如有退款操作, 请将证书放到extend/wxpay/cert/目录中
  • application/index/Example.php为示例代码

注意

  • 错误采用抛出异常的方式, 可根据自己的业务在统一接口extend/wxpay/lib/WxPayException.php中修改
  • 上线后, 请务必将配置中的WXPAY_DEBUG改为false
  • 公众号支付、wap支付, 由于我们公司是在小程序上开通的微信支付, 无法完美的测试, 只能采用模拟数据形式, 如有问题, 请提交issue

用法

扫码支付

调用\wxpay\NativePay::getPayImage($params)即可

小程序支付(流程讲解)

调用\wxpay\JsapiPay::getPayParams($params, $code)即可

调用\wxpay\JsapiPay::getParams($params, $openId)即可

公众号支付

调用\wxpay\JsapiPay::getPayParams($params)即可

H5支付(wap支付)

调用\wxpay\WapPay::getPayUrl($params, $redirect_url)即可

订单查询

调用\wxpay\Query::exec($query_no)即可

下载对账单

调用\wxpay\DownloadBill::exec($date, $type)即可

退款(需证书)

调用\wxpay\Refund::exec($params)即可

退款查询

调用\wxpay\RefundQuery::exec($query_no)即可

异步通知处理类(通知详解)

$notify = new \wxpay\Notify();
$notify->Handle();

thinkphp5-wxpay's People

Contributors

dream2023 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.