wechat_rsp.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. package gopay
  2. type WeChatUnifiedOrderResponse struct {
  3. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  4. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  5. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  6. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  7. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  8. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  9. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  10. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  11. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  12. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  13. TradeType string `xml:"trade_type,omitempty" json:"trade_type,omitempty"`
  14. PrepayId string `xml:"prepay_id,omitempty" json:"prepay_id,omitempty"`
  15. CodeUrl string `xml:"code_url,omitempty" json:"code_url,omitempty"`
  16. MwebUrl string `xml:"mweb_url,omitempty" json:"mweb_url,omitempty"`
  17. }
  18. type WeChatQueryOrderResponse struct {
  19. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  20. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  21. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  22. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  23. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  24. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  25. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  26. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  27. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  28. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  29. Openid string `xml:"openid,omitempty" json:"openid,omitempty"`
  30. IsSubscribe string `xml:"is_subscribe,omitempty" json:"is_subscribe,omitempty"`
  31. TradeType string `xml:"trade_type,omitempty" json:"trade_type,omitempty"`
  32. TradeState string `xml:"trade_state,omitempty" json:"trade_state,omitempty"`
  33. BankType string `xml:"bank_type,omitempty" json:"bank_type,omitempty"`
  34. TotalFee int `xml:"total_fee,omitempty" json:"total_fee,omitempty"`
  35. SettlementTotalFee int `xml:"settlement_total_fee,omitempty" json:"settlement_total_fee,omitempty"`
  36. FeeType string `xml:"fee_type,omitempty" json:"fee_type,omitempty"`
  37. CashFee int `xml:"cash_fee,omitempty" json:"cash_fee,omitempty"`
  38. CashFeeType string `xml:"cash_fee_type,omitempty" json:"cash_fee_type,omitempty"`
  39. CouponFee int `xml:"coupon_fee,omitempty" json:"coupon_fee,omitempty"`
  40. CouponCount int `xml:"coupon_count,omitempty" json:"coupon_count,omitempty"`
  41. CouponType0 string `xml:"coupon_type_0,omitempty" json:"coupon_type_0,omitempty"`
  42. CouponType1 string `xml:"coupon_type_1,omitempty" json:"coupon_type_1,omitempty"`
  43. CouponId0 string `xml:"coupon_id_0,omitempty" json:"coupon_id_0,omitempty"`
  44. CouponId1 string `xml:"coupon_id_1,omitempty" json:"coupon_id_1,omitempty"`
  45. CouponFee0 int `xml:"coupon_fee_0,omitempty" json:"coupon_fee_0,omitempty"`
  46. CouponFee1 int `xml:"coupon_fee_1,omitempty" json:"coupon_fee_1,omitempty"`
  47. TransactionId string `xml:"transaction_id,omitempty" json:"transaction_id,omitempty"`
  48. OutTradeNo string `xml:"out_trade_no,omitempty" json:"out_trade_no,omitempty"`
  49. Attach string `xml:"attach,omitempty" json:"attach,omitempty"`
  50. TimeEnd string `xml:"time_end,omitempty" json:"time_end,omitempty"`
  51. TradeStateDesc string `xml:"trade_state_desc,omitempty" json:"trade_state_desc,omitempty"`
  52. }
  53. type WeChatCloseOrderResponse struct {
  54. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  55. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  56. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  57. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  58. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  59. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  60. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  61. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  62. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  63. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  64. }
  65. type WeChatReverseResponse struct {
  66. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  67. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  68. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  69. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  70. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  71. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  72. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  73. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  74. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  75. Recall string `xml:"recall,omitempty" json:"recall,omitempty"`
  76. }
  77. type WeChatRefundResponse struct {
  78. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  79. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  80. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  81. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  82. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  83. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  84. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  85. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  86. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  87. TransactionId string `xml:"transaction_id,omitempty" json:"transaction_id,omitempty"`
  88. OutTradeNo string `xml:"out_trade_no,omitempty" json:"out_trade_no,omitempty"`
  89. OutRefundNo string `xml:"out_refund_no,omitempty" json:"out_refund_no,omitempty"`
  90. RefundId string `xml:"refund_id,omitempty" json:"refund_id,omitempty"`
  91. RefundFee int `xml:"refund_fee,omitempty" json:"refund_fee,omitempty"`
  92. SettlementRefundFee int `xml:"settlement_refund_fee,omitempty" json:"settlement_refund_fee,omitempty"`
  93. TotalFee int `xml:"total_fee,omitempty" json:"total_fee,omitempty"`
  94. SettlementTotalFee int `xml:"settlement_total_fee,omitempty" json:"settlement_total_fee,omitempty"`
  95. FeeType string `xml:"fee_type,omitempty" json:"fee_type,omitempty"`
  96. CashFee int `xml:"cash_fee,omitempty" json:"cash_fee,omitempty"`
  97. CashFeeType string `xml:"cash_fee_type,omitempty" json:"cash_fee_type,omitempty"`
  98. CashRefundFee int `xml:"cash_refund_fee,omitempty" json:"cash_refund_fee,omitempty"`
  99. CouponType0 string `xml:"coupon_type_0,omitempty" json:"coupon_type_0,omitempty"`
  100. CouponType1 string `xml:"coupon_type_1,omitempty" json:"coupon_type_1,omitempty"`
  101. CouponRefundFee int `xml:"coupon_refund_fee,omitempty" json:"coupon_refund_fee,omitempty"`
  102. CouponRefundFee0 int `xml:"coupon_refund_fee_0,omitempty" json:"coupon_refund_fee_0,omitempty"`
  103. CouponRefundFee1 int `xml:"coupon_refund_fee_1,omitempty" json:"coupon_refund_fee_1,omitempty"`
  104. CouponRefundCount int `xml:"coupon_refund_count,omitempty" json:"coupon_refund_count,omitempty"`
  105. CouponRefundId0 string `xml:"coupon_refund_id_0,omitempty" json:"coupon_refund_id_0,omitempty"`
  106. CouponRefundId1 string `xml:"coupon_refund_id_1,omitempty" json:"coupon_refund_id_1,omitempty"`
  107. }
  108. type WeChatQueryRefundResponse struct {
  109. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  110. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  111. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  112. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  113. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  114. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  115. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  116. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  117. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  118. TotalRefundCount int `xml:"total_refund_count,omitempty" json:"total_refund_count,omitempty"`
  119. TransactionId string `xml:"transaction_id,omitempty" json:"transaction_id,omitempty"`
  120. OutTradeNo string `xml:"out_trade_no,omitempty" json:"out_trade_no,omitempty"`
  121. TotalFee int `xml:"total_fee,omitempty" json:"total_fee,omitempty"`
  122. SettlementTotalFee int `xml:"settlement_total_fee,omitempty" json:"settlement_total_fee,omitempty"`
  123. FeeType string `xml:"fee_type,omitempty" json:"fee_type,omitempty"`
  124. CashFee int `xml:"cash_fee,omitempty" json:"cash_fee,omitempty"`
  125. RefundCount int `xml:"refund_count,omitempty" json:"refund_count,omitempty"`
  126. OutRefundNo0 string `xml:"out_refund_no_0,omitempty" json:"out_refund_no_0,omitempty"`
  127. OutRefundNo1 string `xml:"out_refund_no_1,omitempty" json:"out_refund_no_1,omitempty"`
  128. RefundId0 string `xml:"refund_id_0,omitempty" json:"refund_id_0,omitempty"`
  129. RefundId1 string `xml:"refund_id_1,omitempty" json:"refund_id_1,omitempty"`
  130. RefundChannel0 string `xml:"refund_channel_0,omitempty" json:"refund_channel_0,omitempty"`
  131. RefundChannel1 string `xml:"refund_channel_1,omitempty" json:"refund_channel_1,omitempty"`
  132. RefundFee int `xml:"refund_fee,omitempty" json:"refund_fee,omitempty"`
  133. RefundFee0 int `xml:"refund_fee_0,omitempty" json:"refund_fee_0,omitempty"`
  134. RefundFee1 int `xml:"refund_fee_1,omitempty" json:"refund_fee_1,omitempty"`
  135. SettlementRefundFee0 int `xml:"settlement_refund_fee_0,omitempty" json:"settlement_refund_fee_0,omitempty"`
  136. SettlementRefundFee1 int `xml:"settlement_refund_fee_1,omitempty" json:"settlement_refund_fee_1,omitempty"`
  137. CouponType00 string `xml:"coupon_type_0_0,omitempty" json:"coupon_type_0_0,omitempty"`
  138. CouponType01 string `xml:"coupon_type_0_1,omitempty" json:"coupon_type_0_1,omitempty"`
  139. CouponType10 string `xml:"coupon_type_1_0,omitempty" json:"coupon_type_1_0,omitempty"`
  140. CouponType11 string `xml:"coupon_type_1_1,omitempty" json:"coupon_type_1_1,omitempty"`
  141. CouponRefundFee0 int `xml:"coupon_refund_fee_0,omitempty" json:"coupon_refund_fee_0,omitempty"`
  142. CouponRefundFee1 int `xml:"coupon_refund_fee_1,omitempty" json:"coupon_refund_fee_1,omitempty"`
  143. CouponRefundCount0 int `xml:"coupon_refund_count_0,omitempty" json:"coupon_refund_count_0,omitempty"`
  144. CouponRefundCount1 int `xml:"coupon_refund_count_1,omitempty" json:"coupon_refund_count_1,omitempty"`
  145. CouponRefundId00 string `xml:"coupon_refund_id_0_0,omitempty" json:"coupon_refund_id_0_0,omitempty"`
  146. CouponRefundId01 string `xml:"coupon_refund_id_0_1,omitempty" json:"coupon_refund_id_0_1,omitempty"`
  147. CouponRefundId10 string `xml:"coupon_refund_id_1_0,omitempty" json:"coupon_refund_id_1_0,omitempty"`
  148. CouponRefundId11 string `xml:"coupon_refund_id_1_1,omitempty" json:"coupon_refund_id_1_1,omitempty"`
  149. CouponRefundFee00 int `xml:"coupon_refund_fee_0_0,omitempty" json:"coupon_refund_fee_0_0,omitempty"`
  150. CouponRefundFee01 int `xml:"coupon_refund_fee_0_1,omitempty" json:"coupon_refund_fee_0_1,omitempty"`
  151. CouponRefundFee10 int `xml:"coupon_refund_fee_1_0,omitempty" json:"coupon_refund_fee_1_0,omitempty"`
  152. CouponRefundFee11 int `xml:"coupon_refund_fee_1_1,omitempty" json:"coupon_refund_fee_1_1,omitempty"`
  153. RefundStatus0 string `xml:"refund_status_0,omitempty" json:"refund_status_0,omitempty"`
  154. RefundStatus1 string `xml:"refund_status_1,omitempty" json:"refund_status_1,omitempty"`
  155. RefundAccount0 string `xml:"refund_account_0,omitempty" json:"refund_account_0,omitempty"`
  156. RefundAccount1 string `xml:"refund_account_1,omitempty" json:"refund_account_1,omitempty"`
  157. RefundRecvAccout0 string `xml:"refund_recv_accout_0,omitempty" json:"refund_recv_accout_0,omitempty"`
  158. RefundRecvAccout1 string `xml:"refund_recv_accout_1,omitempty" json:"refund_recv_accout_1,omitempty"`
  159. RefundSuccessTime0 string `xml:"refund_success_time_0,omitempty" json:"refund_success_time_0,omitempty"`
  160. RefundSuccessTime1 string `xml:"refund_success_time_1,omitempty" json:"refund_success_time_1,omitempty"`
  161. }
  162. type WeChatMicropayResponse struct {
  163. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  164. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  165. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  166. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  167. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  168. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  169. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  170. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  171. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  172. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  173. Openid string `xml:"openid,omitempty" json:"openid,omitempty"`
  174. IsSubscribe string `xml:"is_subscribe,omitempty" json:"is_subscribe,omitempty"`
  175. TradeType string `xml:"trade_type,omitempty" json:"trade_type,omitempty"`
  176. BankType string `xml:"bank_type,omitempty" json:"bank_type,omitempty"`
  177. FeeType string `xml:"fee_type,omitempty" json:"fee_type,omitempty"`
  178. TotalFee int `xml:"total_fee,omitempty" json:"total_fee,omitempty"`
  179. SettlementTotalFee int `xml:"settlement_total_fee,omitempty" json:"settlement_total_fee,omitempty"`
  180. CouponFee int `xml:"coupon_fee,omitempty" json:"coupon_fee,omitempty"`
  181. CashFeeType string `xml:"cash_fee_type,omitempty" json:"cash_fee_type,omitempty"`
  182. CashFee int `xml:"cash_fee,omitempty" json:"cash_fee,omitempty"`
  183. TransactionId string `xml:"transaction_id,omitempty" json:"transaction_id,omitempty"`
  184. OutTradeNo string `xml:"out_trade_no,omitempty" json:"out_trade_no,omitempty"`
  185. Attach string `xml:"attach,omitempty" json:"attach,omitempty"`
  186. TimeEnd string `xml:"time_end,omitempty" json:"time_end,omitempty"`
  187. PromotionDetail string `xml:"promotion_detail,omitempty" json:"promotion_detail,omitempty"`
  188. }
  189. type WeChatTransfersResponse struct {
  190. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  191. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  192. MchAppid string `xml:"mch_appid,omitempty" json:"mch_appid,omitempty"`
  193. Mchid string `xml:"mchid,omitempty" json:"mchid,omitempty"`
  194. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  195. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  196. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  197. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  198. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  199. PartnerTradeNo string `xml:"partner_trade_no,omitempty" json:"partner_trade_no,omitempty"`
  200. PaymentNo string `xml:"payment_no,omitempty" json:"payment_no,omitempty"`
  201. PaymentTime string `xml:"payment_time,omitempty" json:"payment_time,omitempty"`
  202. }
  203. type getSignKeyResponse struct {
  204. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  205. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  206. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  207. SandboxSignkey string `xml:"sandbox_signkey,omitempty" json:"sandbox_signkey,omitempty"`
  208. }
  209. type WeChatNotifyRequest struct {
  210. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  211. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  212. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  213. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  214. ErrCodeDes string `xml:"err_code_des,omitempty" json:"err_code_des,omitempty"`
  215. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  216. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  217. DeviceInfo string `xml:"device_info,omitempty" json:"device_info,omitempty"`
  218. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  219. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  220. SignType string `xml:"sign_type,omitempty" json:"sign_type,omitempty"`
  221. Openid string `xml:"openid,omitempty" json:"openid,omitempty"`
  222. IsSubscribe string `xml:"is_subscribe,omitempty" json:"is_subscribe,omitempty"`
  223. TradeType string `xml:"trade_type,omitempty" json:"trade_type,omitempty"`
  224. BankType string `xml:"bank_type,omitempty" json:"bank_type,omitempty"`
  225. TotalFee int `xml:"total_fee,omitempty" json:"total_fee,omitempty"`
  226. SettlementTotalFee int `xml:"settlement_total_fee,omitempty" json:"settlement_total_fee,omitempty"`
  227. FeeType string `xml:"fee_type,omitempty" json:"fee_type,omitempty"`
  228. CashFee int `xml:"cash_fee,omitempty" json:"cash_fee,omitempty"`
  229. CashFeeType string `xml:"cash_fee_type,omitempty" json:"cash_fee_type,omitempty"`
  230. CouponFee int `xml:"coupon_fee,omitempty" json:"coupon_fee,omitempty"`
  231. CouponCount int `xml:"coupon_count,omitempty" json:"coupon_count,omitempty"`
  232. CouponType0 string `xml:"coupon_type_0,omitempty" json:"coupon_type_0,omitempty"`
  233. CouponType1 string `xml:"coupon_type_1,omitempty" json:"coupon_type_1,omitempty"`
  234. CouponId0 string `xml:"coupon_id_0,omitempty" json:"coupon_id_0,omitempty"`
  235. CouponId1 string `xml:"coupon_id_1,omitempty" json:"coupon_id_1,omitempty"`
  236. CouponFee0 int `xml:"coupon_fee_0,omitempty" json:"coupon_fee_0,omitempty"`
  237. CouponFee1 int `xml:"coupon_fee_1,omitempty" json:"coupon_fee_1,omitempty"`
  238. TransactionId string `xml:"transaction_id,omitempty" json:"transaction_id,omitempty"`
  239. OutTradeNo string `xml:"out_trade_no,omitempty" json:"out_trade_no,omitempty"`
  240. Attach string `xml:"attach,omitempty" json:"attach,omitempty"`
  241. TimeEnd string `xml:"time_end,omitempty" json:"time_end,omitempty"`
  242. }
  243. type Code2SessionRsp struct {
  244. SessionKey string `json:"session_key,omitempty"` //会话密钥
  245. ExpiresIn int `json:"expires_in,omitempty"` //SessionKey超时时间(秒)
  246. Openid string `json:"openid,omitempty"` //用户唯一标识
  247. Unionid string `json:"unionid,omitempty"` //用户在开放平台的唯一标识符
  248. Errcode int `json:"errcode,omitempty"` //错误码
  249. Errmsg string `json:"errmsg,omitempty"` //错误信息
  250. }
  251. type PaidUnionId struct {
  252. Unionid string `json:"unionid,omitempty"` //用户在开放平台的唯一标识符
  253. Errcode int `json:"errcode,omitempty"` //错误码
  254. Errmsg string `json:"errmsg,omitempty"` //错误信息
  255. }
  256. type AccessToken struct {
  257. AccessToken string `json:"access_token,omitempty"` //获取到的凭证
  258. ExpiresIn int `json:"expires_in,omitempty"` //SessionKey超时时间(秒)
  259. Errcode int `json:"errcode,omitempty"` //错误码
  260. Errmsg string `json:"errmsg,omitempty"` //错误信息
  261. }
  262. type WeChatUserInfo struct {
  263. Subscribe int `json:"subscribe,omitempty"` //用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。
  264. Openid string `json:"openid,omitempty"` //用户唯一标识
  265. Nickname string `json:"nickname,omitempty"` //用户的昵称
  266. Sex int `json:"sex,omitempty"` //用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
  267. Language string `json:"language,omitempty"` //用户的语言,简体中文为zh_CN
  268. City string `json:"city,omitempty"` //用户所在城市
  269. Province string `json:"province,omitempty"` //用户所在省份
  270. Country string `json:"country,omitempty"` //用户所在国家
  271. Headimgurl string `json:"headimgurl,omitempty"` //用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。若用户更换头像,原有头像URL将失效。
  272. SubscribeTime int `json:"subscribe_time,omitempty"` //用户关注时间,为时间戳。如果用户曾多次关注,则取最后关注时间
  273. Unionid string `json:"unionid,omitempty"` //只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。
  274. Remark string `json:"remark,omitempty"` //公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注
  275. Groupid int `json:"groupid,omitempty"` //用户所在的分组ID(兼容旧的用户分组接口)
  276. TagidList []int `json:"tagid_list,omitempty"` //用户被打上的标签ID列表
  277. SubscribeScene string `json:"subscribe_scene,omitempty"` //返回用户关注的渠道来源,ADD_SCENE_SEARCH 公众号搜索,ADD_SCENE_ACCOUNT_MIGRATION 公众号迁移,ADD_SCENE_PROFILE_CARD 名片分享,ADD_SCENE_QR_CODE 扫描二维码,ADD_SCENEPROFILE LINK 图文页内名称点击,ADD_SCENE_PROFILE_ITEM 图文页右上角菜单,ADD_SCENE_PAID 支付后关注,ADD_SCENE_OTHERS 其他
  278. QrScene int `json:"qr_scene,omitempty"` //二维码扫码场景(开发者自定义)
  279. QrSceneStr string `json:"qr_scene_str,omitempty"` //二维码扫码场景描述(开发者自定义)
  280. Errcode int `json:"errcode,omitempty"` //错误码
  281. Errmsg string `json:"errmsg,omitempty"` //错误信息
  282. }
  283. type WeChatUserPhone struct {
  284. PhoneNumber string `json:"phoneNumber,omitempty"`
  285. PurePhoneNumber string `json:"purePhoneNumber,omitempty"`
  286. CountryCode string `json:"countryCode,omitempty"`
  287. Watermark watermarkInfo `json:"watermark,omitempty"`
  288. }
  289. type watermarkInfo struct {
  290. Appid string `json:"appid,omitempty"`
  291. Timestamp int `json:"timestamp,omitempty"`
  292. }
  293. type OpenIdByAuthCodeRsp struct {
  294. ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"`
  295. ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"`
  296. Appid string `xml:"appid,omitempty" json:"appid,omitempty"`
  297. MchId string `xml:"mch_id,omitempty" json:"mch_id,omitempty"`
  298. NonceStr string `xml:"nonce_str,omitempty" json:"nonce_str,omitempty"`
  299. Sign string `xml:"sign,omitempty" json:"sign,omitempty"`
  300. ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"`
  301. ErrCode string `xml:"err_code,omitempty" json:"err_code,omitempty"`
  302. Openid string `xml:"openid,omitempty" json:"openid,omitempty"` //用户唯一标识
  303. }