コード例 #1
0
ファイル: Reply.php プロジェクト: cjango/wechat
 /**
  * 回复消息
  * @param  [type] $content [description]
  * @param  string $type    [description]
  * @return [type]          [description]
  */
 public static function response($content, $type = 'text')
 {
     self::$response = ['ToUserName' => self::$request['fromusername'], 'FromUserName' => self::$request['tousername'], 'CreateTime' => time(), 'MsgType' => $type];
     self::$type($content);
     $response = Utils::array2xml(self::$response);
     exit($response);
 }
コード例 #2
0
ファイル: Pay.php プロジェクト: cjango/wechat
 /**
  * 支付结果通知
  * @param  [type] $code 支付结果
  * @param  [type] $msg  返回信息
  * @return xml
  */
 public static function returnNotify($msg = true)
 {
     if ($msg === true) {
         $params = ['return_code' => 'SUCCESS', 'return_msg' => ''];
     } else {
         $params = ['return_code' => 'FAIL', 'return_msg' => $msg];
     }
     exit(Utils::array2xml($params));
 }