PHP code example of fengkui / xcx

1. Go to this page and download the library: Download fengkui/xcx 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/ */

    

fengkui / xcx example snippets


# 微信小程序配置
$wechatConfig = [
    'appid' => '',
    'secret' => '',
];
# QQ小程序配置
$qqConfig = [
    'appid' => '',
    'secret' => '',
];
# 百度小程序配置
$baiduConfig = [
    'appid' => '',
    'appkey' => '',
    'secret' => '',
];
# 字节跳动小程序配置
$bytedanceConfig = [
    'appid' => '',
    'secret' => '',
];
# 钉钉小程序配置
$dingtalkConfig = [
    'agentid'   => '', // agentid
    'appkey'    => '', // appkey
    'secret'    => '', // secret
    'robot_appkey'    => '', // robot_appkey
    'robot_secret'    => '', // robot_secret
];
# 支付宝小程序配置
$alipayConfig = [
    'app_id' => '', // 支付宝分配给开发者的应用ID
    'public_key' => '', // 请填写支付宝公钥
    'private_key' => '', // 请填写开发者私钥去头去尾去回车
];

$xcx = new \fengkui\Xcx\Wechat($wechatConfig); // 微信
$xcx = new \fengkui\Xcx\Qq($qqConfig); // QQ
$xcx = new \fengkui\Xcx\Baidu($baiduConfig); // 百度
$xcx = new \fengkui\Xcx\Bytedance($bytedanceConfig); // 字节跳动
$xcx = new \fengkui\Xcx\Dingtalk($dingtalkConfig); // 钉钉
$xcx = new \fengkui\Xcx\Alipay($alipayConfig); // 支付宝