Soter.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | WeChatDeveloper
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://think.ctolog.com
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | github开源项目:https://github.com/zoujingli/WeChatDeveloper
  12. // +----------------------------------------------------------------------
  13. namespace WeMini;
  14. use WeChat\Contracts\BasicWeChat;
  15. /**
  16. * 小程序生物认证
  17. * Class Soter
  18. * @package WeMini
  19. */
  20. class Soter extends BasicWeChat
  21. {
  22. /**
  23. * SOTER 生物认证秘钥签名验证
  24. * @param array $data
  25. * @return array
  26. * @throws \WeChat\Exceptions\InvalidResponseException
  27. * @throws \WeChat\Exceptions\LocalCacheException
  28. */
  29. public function verifySignature($data)
  30. {
  31. $url = 'https://api.weixin.qq.com/cgi-bin/soter/verify_signature?access_token=ACCESS_TOKEN';
  32. $this->registerApi($url, __FUNCTION__, func_get_args());
  33. return $this->callPostApi($url, $data, true);
  34. }
  35. }