GeneralCardClient.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace EasyWeChat\OfficialAccount\Card;
  11. /**
  12. * Class GeneralCardClient.
  13. *
  14. * @author overtrue <i@overtrue.me>
  15. */
  16. class GeneralCardClient extends Client
  17. {
  18. /**
  19. * 通用卡接口激活.
  20. *
  21. * @return mixed
  22. *
  23. * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
  24. * @throws \GuzzleHttp\Exception\GuzzleException
  25. */
  26. public function activate(array $info = [])
  27. {
  28. return $this->httpPostJson('card/generalcard/activate', $info);
  29. }
  30. /**
  31. * 通用卡撤销激活.
  32. *
  33. * @return mixed
  34. *
  35. * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
  36. * @throws \GuzzleHttp\Exception\GuzzleException
  37. */
  38. public function deactivate(string $cardId, string $code)
  39. {
  40. $params = [
  41. 'card_id' => $cardId,
  42. 'code' => $code,
  43. ];
  44. return $this->httpPostJson('card/generalcard/unactivate', $params);
  45. }
  46. /**
  47. * 更新会员信息.
  48. *
  49. * @return mixed
  50. *
  51. * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
  52. * @throws \GuzzleHttp\Exception\GuzzleException
  53. */
  54. public function updateUser(array $params = [])
  55. {
  56. return $this->httpPostJson('card/generalcard/updateuser', $params);
  57. }
  58. }