PHP code example of hxc / qt-pay

1. Go to this page and download the library: Download hxc/qt-pay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hxc / qt-pay example snippets


'env' => 'production' //值:dev,production;dev开发环境:不走微信/支付宝支付,直接支付成功;production线上环境:走微信/支付宝支付

protected function _initialize()
{
    $this->wx_config = [];//自定义微信支付所需参数,优先级高于配置文件
    $this->ali_config = [];//自定义支付宝所需参数,优先级高于配置文件
    $this->validate = '';  //自定义验证器,需填写完整类名
    $this->getConfig();//读取配置
}

php >= 7.0.0
ThinkPHP 5.0.*