PHP code example of firstphp / hyperf-wechat

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

    

firstphp / hyperf-wechat example snippets


WECHAT_APPID=wxba34db123lafdu811
WECHAT_APPSECRET=a09dfwlf9df90b74g4a8l9ca8d67bu7o0
WECHAT_KEY=qpy1DkAVBAZD2L5rs0uiKeoWa62wLumjqCXG9HifL3n
WECHAT_URL=https://api.weixin.qq.com/
AES_KEY=AQm3DkAVBAZD2L1rsOWaKeoRda62wLumjqD9G9HifA1a

use Firstphp\FirstphpWechat\WechatInterface;

......

/**
 * @Inject
 * @var WechatInterface
 */
protected $wechatInterface;

public function test() {
    $res = $this->wechatInterface->getAccessToken();
    var_dump($res);
}