wechat_rsp.go 12 KB

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