OapiDingpayRedenvelopeSendRequest.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.dingpay.redenvelope.send request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2021.05.08
  7. */
  8. class OapiDingpayRedenvelopeSendRequest
  9. {
  10. /**
  11. * 群会话ID
  12. **/
  13. private $chatId;
  14. /**
  15. * 企业业务订单号(每个订单号必须唯一。取值范围:0~9,a~z,A~Z),接口根据企业订单号支持幂等,组成参考:corp_id+yyyymmdd+10位一天内不能重复的数字
  16. **/
  17. private $corpBizNo;
  18. /**
  19. * 额外参数
  20. **/
  21. private $extParams;
  22. /**
  23. * 红包祝福语
  24. **/
  25. private $greetings;
  26. /**
  27. * 群会话ID
  28. **/
  29. private $openConversationId;
  30. /**
  31. * 支付方式,WITHHOLD:代扣模式,目前只支持该方式
  32. **/
  33. private $payMethod;
  34. /**
  35. * 签名方式咨询技术支持
  36. **/
  37. private $paySign;
  38. /**
  39. * 接收人ID
  40. **/
  41. private $receiverId;
  42. /**
  43. * 发送人ID
  44. **/
  45. private $senderId;
  46. /**
  47. * 红包主题ID
  48. **/
  49. private $themeId;
  50. /**
  51. * 红包金额
  52. **/
  53. private $totalAmount;
  54. /**
  55. * 红包类型,目前支持:SINGLE_QUOTA,个人单聊红包
  56. **/
  57. private $type;
  58. private $apiParas = array();
  59. public function setChatId($chatId)
  60. {
  61. $this->chatId = $chatId;
  62. $this->apiParas["chat_id"] = $chatId;
  63. }
  64. public function getChatId()
  65. {
  66. return $this->chatId;
  67. }
  68. public function setCorpBizNo($corpBizNo)
  69. {
  70. $this->corpBizNo = $corpBizNo;
  71. $this->apiParas["corp_biz_no"] = $corpBizNo;
  72. }
  73. public function getCorpBizNo()
  74. {
  75. return $this->corpBizNo;
  76. }
  77. public function setExtParams($extParams)
  78. {
  79. $this->extParams = $extParams;
  80. $this->apiParas["ext_params"] = $extParams;
  81. }
  82. public function getExtParams()
  83. {
  84. return $this->extParams;
  85. }
  86. public function setGreetings($greetings)
  87. {
  88. $this->greetings = $greetings;
  89. $this->apiParas["greetings"] = $greetings;
  90. }
  91. public function getGreetings()
  92. {
  93. return $this->greetings;
  94. }
  95. public function setOpenConversationId($openConversationId)
  96. {
  97. $this->openConversationId = $openConversationId;
  98. $this->apiParas["open_conversation_id"] = $openConversationId;
  99. }
  100. public function getOpenConversationId()
  101. {
  102. return $this->openConversationId;
  103. }
  104. public function setPayMethod($payMethod)
  105. {
  106. $this->payMethod = $payMethod;
  107. $this->apiParas["pay_method"] = $payMethod;
  108. }
  109. public function getPayMethod()
  110. {
  111. return $this->payMethod;
  112. }
  113. public function setPaySign($paySign)
  114. {
  115. $this->paySign = $paySign;
  116. $this->apiParas["pay_sign"] = $paySign;
  117. }
  118. public function getPaySign()
  119. {
  120. return $this->paySign;
  121. }
  122. public function setReceiverId($receiverId)
  123. {
  124. $this->receiverId = $receiverId;
  125. $this->apiParas["receiver_id"] = $receiverId;
  126. }
  127. public function getReceiverId()
  128. {
  129. return $this->receiverId;
  130. }
  131. public function setSenderId($senderId)
  132. {
  133. $this->senderId = $senderId;
  134. $this->apiParas["sender_id"] = $senderId;
  135. }
  136. public function getSenderId()
  137. {
  138. return $this->senderId;
  139. }
  140. public function setThemeId($themeId)
  141. {
  142. $this->themeId = $themeId;
  143. $this->apiParas["theme_id"] = $themeId;
  144. }
  145. public function getThemeId()
  146. {
  147. return $this->themeId;
  148. }
  149. public function setTotalAmount($totalAmount)
  150. {
  151. $this->totalAmount = $totalAmount;
  152. $this->apiParas["total_amount"] = $totalAmount;
  153. }
  154. public function getTotalAmount()
  155. {
  156. return $this->totalAmount;
  157. }
  158. public function setType($type)
  159. {
  160. $this->type = $type;
  161. $this->apiParas["type"] = $type;
  162. }
  163. public function getType()
  164. {
  165. return $this->type;
  166. }
  167. public function getApiMethodName()
  168. {
  169. return "dingtalk.oapi.dingpay.redenvelope.send";
  170. }
  171. public function getApiParas()
  172. {
  173. return $this->apiParas;
  174. }
  175. public function check()
  176. {
  177. RequestCheckUtil::checkNotNull($this->corpBizNo,"corpBizNo");
  178. RequestCheckUtil::checkNotNull($this->payMethod,"payMethod");
  179. RequestCheckUtil::checkNotNull($this->paySign,"paySign");
  180. RequestCheckUtil::checkNotNull($this->receiverId,"receiverId");
  181. RequestCheckUtil::checkNotNull($this->totalAmount,"totalAmount");
  182. RequestCheckUtil::checkNotNull($this->type,"type");
  183. }
  184. public function putOtherTextParam($key, $value) {
  185. $this->apiParas[$key] = $value;
  186. $this->$key = $value;
  187. }
  188. }