Transfer.php 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\Kernel\Messages;
  11. /**
  12. * Class Transfer.
  13. *
  14. * @property string $to
  15. * @property string $account
  16. */
  17. class Transfer extends Message
  18. {
  19. /**
  20. * Messages type.
  21. *
  22. * @var string
  23. */
  24. protected $type = 'transfer_customer_service';
  25. /**
  26. * Properties.
  27. *
  28. * @var array
  29. */
  30. protected $properties = [
  31. 'account',
  32. ];
  33. /**
  34. * Transfer constructor.
  35. *
  36. * @param string|null $account
  37. */
  38. public function __construct(string $account = null)
  39. {
  40. parent::__construct(compact('account'));
  41. }
  42. public function toXmlArray()
  43. {
  44. return empty($this->get('account')) ? [] : [
  45. 'TransInfo' => [
  46. 'KfAccount' => $this->get('account'),
  47. ],
  48. ];
  49. }
  50. }