WeChat enterprise account callback mode development Thinkphp
Wechat.class.rar
( 15.01 KB Download: 14 times )
In callback mode, enterprises can not only actively call the enterprise account interface, but also receive messages or events from members. The received information uses xm
Each Enterprise application has its own callback mode switch. The callback mode of this application will not take effect until the management side is turned on and relevant parameters are set.
Usage: $options = array(<br>
'token'=>'******', //Fill in the Token of the application interface<br>
'encodingaeskey'=>'******',//Fill in the EncodingAESKey for encryption<br>
'appid'=>'******', //Fill in the appid of the advanced calling function<br>
'debug'=>true,<br>
);<br>
$weObj = new OrgComWechat($options);<br>
$ret=$weObj->valid();<br>
If (!$ret) {<br>
var_dump($ret);<br>
}<br>
//Get the nickname of the user who sent the message<br>
$f = $weObj->getRev()->getRevFrom();<br>
//Get the message type sent<br>
$t = $weObj->getRevType();<br>
//Get the original message sent<br>
$d = $weObj->getRevData();<br>
$weObj->text("This is a text message")->reply();