PHP code example of superzc / qqconnect

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

    

superzc / qqconnect example snippets


return [
    'appid' => 'xxx',
    'appkey' => 'xxx',
    'callback' => 'https://example.com/qc_redirect.html',
];

use Superzc\QQConnect\QQConnect;
use Superzc\QQConnect\Exceptions\DefaultException as QCException;

try {
    $qqconnect = new QQConnect();
    $qqconnect->init($openid, $access_token);
    $result = $qqconnect->doSomething();
} catch (MPDefaultException $e) {
    return response()->json([
        'ret' => $e->getCode(),
        'msg' => $e->getMessage(),
    ]);
}

use Superzc\QQConnect\Facades\QQConnect;

try {
    QQConnect::init($openid, $access_token);
    $result = QQConnect::doSomething();
} catch (QCException $e) {
    return response()->json([
        'ret' => $e->getCode(),
        'msg' => $e->getMessage(),
    ]);
}