Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 1.05 KB

3.0-VALIDATE-URL.md

File metadata and controls

23 lines (20 loc) · 1.05 KB

数据回调和指令回调URL验证

企业微信: 应用授权->配置开发信息文档

<?php
use Zwei\WorkWechat\Events\AppEvent;
use Zwei\WorkWechat\Events\AppEventResult;
use Zwei\WorkWechat\Events\Receives\StandardEventReceive;
use Zwei\WorkWechat\Events\Receives\SuiteEventReceive;

$token                  = 'svSLryqHx';
$encodingAesKey         = 'VC2cNUGdzb2YLkVcWSXe0xII3qKabdAWAB1yBwc2Sod';
$suiteEventReceive      = new SuiteEventReceive();// 设置suite事件接收类
$standardEventReceive   = new StandardEventReceive();// 设置普通事件接收类
$isProcessEvent         = true;
// 处理回调url验证
// 处理企业微信推送事件
$obj = new AppEvent($suiteEventReceive, $standardEventReceive, $isProcessEvent);
/* @var $appEventResult AppEventResult */
$appEventResult = $obj->processCallback($token, $encodingAesKey);
echo $appEventResult->getEchoString();// 数据回调和指令回调URL验证返回的是解密后的字符串, 事件返回的是"success"字符串