12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace App\Repositories\Contracts;
- /**
- *
- * @author lilin
- *
- */
- interface WxServicesInterface
- {
- const TYPENAME = '微信公众号 ';
-
- /**
- * 购买成功通知
- * @var string
- */
- const TPL_ID_1 = '-B-JBCrJfBV-usheph5OuG6fTTXHydTyNEo-sw5mvao';
-
- const URL_ACCESS_TOKEN = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET';
- const URL_USER_INFO = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN';
- const URL_JSAPI_TICKET = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi';
- const URL_SEND_TPL_MSG = 'https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN';
- const URL_SEND_MESSAGE = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN';
- const URL_SEND_CREATE_MENU = 'https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN';
-
- /**
- * 获取用户ACCESS_TOKEN
- *
- */
- public function getAccessToken();
-
- /**
- * 获取用户基本信息
- *
- * @param string $openid
- */
- public function getUserInfo(string $openid);
-
- /**
- * 验证消息的确来自微信服务器
- *
- * @param string $signature
- * @param string $echostr 验证通过原样返回
- * @param string $timestamp
- * @param string $nonce
- */
- public function checkSignature(string $signature, string $echostr, string $timestamp, string $nonce);
-
- /**
- * jsapi_ticket是公众号用于调用微信JS接口的临时票据
- *
- */
- public function getJsapiTicket();
-
- /**
- * jsapi获取签名
- *
- * @param string $url 当前url
- */
- public function getJsapiSign(string $url);
-
- /**
- * 发送模板信息
- *
- * @param string $touser
- * @param string $templateId
- * @param string $jumpUrl
- * @param array $data
- */
- public function sendTplMsg(string $touser, string $templateId, string $jumpUrl, array $data);
-
- /**
- * 客服接口-发消息
- *
- * @param string $toUser
- * @param string $msgType
- * @param array $msg
- */
- public function sendMessage(string $toUser, string $msgType, array $msg);
-
- /**
- * 创建菜单
- *
- * @param array $menu
- */
- public function createMenu(array $menu);
- }
|