domain.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. /*
  2. * Copyright silenceper/wechat Author(https://silenceper.com/wechat/). All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. * You can obtain one at https://github.com/silenceper/wechat.
  17. *
  18. */
  19. package virtualpayment
  20. import (
  21. "github.com/silenceper/wechat/v2/miniprogram/context"
  22. "github.com/silenceper/wechat/v2/util"
  23. )
  24. // VirtualPayment mini program virtual payment
  25. // https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html#_2-3-%E6%9C%8D%E5%8A%A1%E5%99%A8API
  26. type VirtualPayment struct {
  27. ctx *context.Context
  28. sessionKey string
  29. }
  30. // Env Environment 0 - Production environment 1 - Sandbox environment
  31. type Env int
  32. // ErrCode error code
  33. type ErrCode int
  34. // OrderStatus 订单状态
  35. type OrderStatus int
  36. // CommonRequest common request parameters
  37. type CommonRequest struct {
  38. OpenID string `json:"openid"` // The user's openID
  39. Env Env `json:"env"` // Environment 0 - Production environment 1 - Sandbox environment
  40. }
  41. // PaymentRequest payment request parameters
  42. type PaymentRequest struct {
  43. SignData string `json:"sign_data"` // 具体支付参数见 signData, 该参数需以 string 形式传递,例如 signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}'
  44. Mode string `json:"mode"` // 支付模式,枚举值:short_series_goods: 道具直购,short_series_coin: 代币充值
  45. PaySig string `json:"pay_sig"` // 支付签名,具体生成方式见下方说明
  46. Signature string `json:"signature"` // 用户态签名,具体生成方式见下方说明
  47. }
  48. // SignData 签名数据
  49. type SignData struct {
  50. OfferID string `json:"offerId"` // 在米大师侧申请的应用 id, mp-支付基础配置中的 offerid
  51. BuyQuantity int `json:"buyQuantity"` // 购买数量
  52. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  53. CurrencyType string `json:"currencyType"` // 币种 默认值:CNY 人民币
  54. Platform string `json:"platform,omitempty"` // 申请接入时的平台,platform 与应用 id 有关 默认值:android 安卓平台
  55. ProductID string `json:"productId,omitempty"` // 道具 ID, **该字段仅 mode=short_series_goods 时可用**
  56. GoodsPrice int `json:"goodsPrice"` // 道具单价 (分), **该字段仅 mode=short_series_goods 时可用**, 用来校验价格与后台道具价格是否一致,避免用户在业务商城页看到的价格与实际价格不一致导致投诉
  57. OutTradeNo string `json:"outTradeNo"` // 业务订单号,每个订单号只能使用一次,重复使用会失败 (极端情况不保证唯一,不建议业务强依赖唯一性). 要求 8-32 个字符内,只能是数字、大小写字母、符号 _-|*@组成,不能以下划线 (_) 开头
  58. Attach string `json:"attach"` // 透传数据,发货通知时会透传给开发者
  59. }
  60. // QueryUserBalanceRequest 查询用户代币余额,请求参数
  61. // 1. 需要用户态签名与支付签名
  62. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  63. type QueryUserBalanceRequest struct {
  64. CommonRequest
  65. UserIP string `json:"user_ip"` // 用户 ip,例如:1.1.1.1
  66. }
  67. // QueryUserBalanceResponse 查询虚拟支付余额 响应参数
  68. type QueryUserBalanceResponse struct {
  69. util.CommonError
  70. Balance int `json:"balance"` // 代币总余额,包括有价和赠送部分
  71. PresentBalance int `json:"present_balance"` // 赠送账户的代币余额
  72. SumSave int `json:"sum_save"` // 累计有价货币充值数量
  73. SumPresent int `json:"sum_present"` // 累计赠送无价货币数量
  74. SumBalance int `json:"sum_balance"` // 历史总增加的代币金额
  75. SumCost int `json:"sum_cost"` // 历史总消耗代币金额
  76. FirstSaveFlag int `json:"first_save_flag"` // 是否满足首充活动标记。0:不满足。1:满足
  77. }
  78. // CurrencyPayRequest 扣减代币(一般用于代币支付)
  79. // 1. 需要用户态签名与支付签名
  80. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  81. type CurrencyPayRequest struct {
  82. CommonRequest
  83. UserIP string `json:"user_ip"` // 用户 ip,例如:1.1.1.1
  84. Amount int `json:"amount"` // 支付的代币数量
  85. OrderID string `json:"order_id"` // 商户订单号,需要保证唯一性
  86. PayItem string `json:"payitem"` // 物品信息。记录到账户流水中。如:[{"productid":"物品 id", "unit_price": 单价,"quantity": 数量}]
  87. Remark string `json:"remark"` // 备注信息。需要在账单中展示
  88. DeviceType string `json:"device_type"` // 平台类型 1-安卓 2-苹果
  89. }
  90. // PayItem 物品信息
  91. type PayItem struct {
  92. ProductID string `json:"productid"` // 物品 id
  93. UnitPrice int `json:"unit_price"` // 单价
  94. Quantity int `json:"quantity"` // 数量
  95. }
  96. // CurrencyPayResponse 扣减代币(一般用于代币支付)响应参数
  97. type CurrencyPayResponse struct {
  98. util.CommonError
  99. OrderID string `json:"order_id"` // 商户订单号
  100. Balance int `json:"balance"` // 总余额,包括有价和赠送部分
  101. UsedPresentAmount int `json:"used_present_amount"` // 使用赠送部分的代币数量
  102. }
  103. // QueryOrderRequest 查询创建的订单(现金单,非代币单),请求参数
  104. // 1. 使用支付签名
  105. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  106. type QueryOrderRequest struct {
  107. CommonRequest
  108. OrderID string `json:"order_id,omitempty"` // 商户订单号 创建的订单号
  109. WxOrderID string `json:"wx_order_id,omitempty"` // 微信内部单号 (与 order_id 二选一)
  110. }
  111. // OrderItem 订单信息
  112. type OrderItem struct {
  113. OrderID string `json:"order_id"` // 商户订单号
  114. CreateTime int64 `json:"create_time"` // 订单创建时间
  115. UpdateTime int64 `json:"update_time"` // 订单更新时间
  116. Status OrderStatus `json:"status"` // 订单状态 当前状态 0-订单初始化(未创建成功,不可用于支付)1-订单创建成功 2-订单已经支付,待发货 3-订单发货中 4-订单已发货 5-订单已经退款 6-订单已经关闭(不可再使用)7-订单退款失败
  117. BizType int `json:"biz_type"` // 业务类型 0-短剧
  118. OrderFee int `json:"order_fee"` // 订单金额,单位:分
  119. CouponFee int `json:"coupon_fee"` // 优惠金额,单位:分
  120. PaidFee int `json:"paid_fee"` // 用户支付金额,单位:分
  121. OrderType int `json:"order_type"` // 订单类型 0-支付单 1-退款单
  122. RefundFee int `json:"refund_fee"` // 当类型为退款单时表示退款金额,单位分
  123. PaidTime int64 `json:"paid_time"` // 支付/退款时间,unix秒级时间戳
  124. ProvideTime int64 `json:"provide_time"` // 发货时间,unix 秒级时间戳
  125. BizMeta string `json:"biz_meta"` // 业务自定义数据 订单创建时传的信息
  126. EnvType int `json:"env_type"` // 环境类型 1-现网 2-沙箱
  127. Token string `json:"token"` // 下单时米大师返回的 token
  128. LeftFee int `json:"left_fee"` // 支付单类型时表示此单经过退款还剩余的金额,单位:分
  129. WxOrderID string `json:"wx_order_id"` // 微信内部单号
  130. ChannelOrderID string `json:"channel_order_id"` // 渠道订单号,为用户微信支付详情页面上的商户单号
  131. WxPayOrderID string `json:"wxpay_order_id"` // 微信支付交易单号,为用户微信支付详情页面上的交易单号
  132. }
  133. // QueryOrderResponse 查询创建的订单(现金单,非代币单)响应参数
  134. type QueryOrderResponse struct {
  135. util.CommonError
  136. Order *OrderItem `json:"order"` // 订单信息
  137. }
  138. // CancelCurrencyPayRequest 取消订单(现金单,非代币单),请求参数
  139. // 1. 使用支付签名
  140. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  141. type CancelCurrencyPayRequest struct {
  142. CommonRequest
  143. UserIP string `json:"user_ip"` // 用户 ip,例如:1.1.1.1
  144. PayOrderID string `json:"pay_order_id"` // 支付单号 代币支付 (调用 currency_pay 接口时) 时传的 order_id
  145. OrderID string `json:"order_id"` // 本次退款单的单号
  146. Amount int `json:"amount"` // 退款金额
  147. DeviceType int `json:"device_type"` // 平台类型 1-安卓 2-苹果
  148. }
  149. // CancelCurrencyPayResponse 取消订单(现金单,非代币单)响应参数
  150. type CancelCurrencyPayResponse struct {
  151. util.CommonError
  152. OrderID string `json:"order_id"` // 退款订单号
  153. }
  154. // NotifyProvideGoodsRequest 通知发货,请求参数
  155. // 通知已经发货完成(只能通知现金单),正常通过 xpay_goods_deliver_notify 消息推送返回成功就不需要调用这个 api 接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态
  156. // 1. 使用支付签名
  157. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  158. type NotifyProvideGoodsRequest struct {
  159. OrderID string `json:"order_id,omitempty"` // 商户订单号 下单时传的单号
  160. WxOrderID string `json:"wx_order_id,omitempty"` // 微信内部单号 (与 order_id 二选一)
  161. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  162. }
  163. // NotifyProvideGoodsResponse 通知发货响应参数
  164. type NotifyProvideGoodsResponse struct {
  165. util.CommonError
  166. }
  167. // PresentCurrencyRequest 赠送代币,请求参数
  168. // 代币赠送接口,由于目前不支付按单号查赠送单的功能,所以当需要赠送的时候可以一直重试到返回 0 或者返回 268490004(重复操作)为止
  169. // 1. 需要用户态签名与支付签名
  170. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  171. type PresentCurrencyRequest struct {
  172. CommonRequest
  173. OrderID string `json:"order_id"` // 赠送单号,商户订单号,需要保证唯一性
  174. Amount int `json:"amount"` // 赠送的代币数量
  175. DeviceType string `json:"device_type"` // 平台类型 1-安卓 2-苹果
  176. }
  177. // PresentCurrencyResponse 赠送代币响应参数
  178. type PresentCurrencyResponse struct {
  179. util.CommonError
  180. Balance int `json:"balance"` // 赠送后用户的代币余额
  181. OrderID string `json:"order_id"` // 赠送单号
  182. PresentBalance int `json:"present_balance"` // 用户收到的总赠送金额
  183. }
  184. // DownloadBillRequest 下载账单,请求参数
  185. // 用于下载小程序账单,第一次调用触发生成下载 url,可以间隔轮训来获取最终生成的下载 url。账单中金额相关字段是以分为单位。
  186. // 1. 使用支付签名
  187. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  188. type DownloadBillRequest struct {
  189. BeginDs string `json:"begin_ds"` // 账单开始日期,格式为 yyyymmdd 起始时间(如 20230801)
  190. EndDs string `json:"end_ds"` // 账单结束日期,格式为 yyyymmdd 结束时间(如 20230801)
  191. }
  192. // DownloadBillResponse 下载账单响应参数
  193. type DownloadBillResponse struct {
  194. util.CommonError
  195. URL string `json:"url"` // 账单下载地址
  196. }
  197. // RefundOrderRequest 退款,请求参数
  198. // 对使用 jsapi 接口下的单进行退款
  199. // 1. 使用支付签名
  200. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  201. type RefundOrderRequest struct {
  202. CommonRequest
  203. OrderID string `json:"order_id"` // 商户订单号,需要保证唯一性
  204. WxOrderID string `json:"wx_order_id"` // 微信内部单号 (与 order_id 二选一)
  205. RefundOrderID string `json:"refund_order_id"` // 退款单号,本次退款时需要传的单号,长度为 [8,32],字符只允许使用字母、数字、'_'、'-'
  206. LeftFee int `json:"left_fee"` // 退款金额,单位:分 当前单剩余可退金额,单位分,可以通过调用 query_order 接口查到
  207. RefundFee int `json:"refund_fee"` // 退款金额,单位:分 需要 (0,left_fee] 之间
  208. BizMeta string `json:"biz_meta"` // 商家自定义数据,传入后可在 query_order 接口查询时原样返回,长度需要 [0,1024]
  209. RefundReason string `json:"refund_reason"` // 退款原因,当前仅支持以下值 0-暂无描述 1-产品问题,影响使用或效果不佳 2-售后问题,无法满足需求 3-意愿问题,用户主动退款 4-价格问题 5:其他原因
  210. ReqFrom string `json:"req_from"` // 退款来源,当前仅支持以下值 1-人工客服退款,即用户电话给客服,由客服发起退款流程 2-用户自己发起退款流程 3-其它
  211. }
  212. // RefundOrderResponse 退款响应参数
  213. type RefundOrderResponse struct {
  214. util.CommonError
  215. RefundOrderID string `json:"refund_order_id"` // 退款单号
  216. RefundWxOrderID string `json:"refund_wx_order_id"` // 退款单的微信侧单号
  217. PayOrderID string `json:"pay_order_id"` // 该退款单对应的支付单单号
  218. PayWxOrderID string `json:"pay_wx_order_id"` // 该退款单对应的支付单微信侧单号
  219. }
  220. // CreateWithdrawOrderRequest 创建提现单,请求参数
  221. // 1. 使用支付签名
  222. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  223. type CreateWithdrawOrderRequest struct {
  224. WithdrawNO string `json:"withdraw_no"` // 提现单单号,长度为 [8,32],字符只允许使用字母、数字、'_'、'-'
  225. WithdrawAmount string `json:"withdraw_amount"` // 提现的金额,单位元,例如提现 1 分钱请使用 0.01
  226. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  227. }
  228. // CreateWithdrawOrderResponse 创建提现单响应参数
  229. type CreateWithdrawOrderResponse struct {
  230. util.CommonError
  231. WithdrawNO string `json:"withdraw_no"` // 提现单单号
  232. WxWithdrawNO string `json:"wx_withdraw_no"` // 提现单的微信侧单号
  233. }
  234. // QueryWithdrawOrderRequest 查询提现单,请求参数
  235. // 1. 使用支付签名
  236. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  237. type QueryWithdrawOrderRequest struct {
  238. WithdrawNO string `json:"withdraw_no"` // 提现单单号,长度为 [8,32],字符只允许使用字母、数字、'_'、'-' (与 wx_withdraw_no 二选一)
  239. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  240. }
  241. // QueryWithdrawOrderResponse 查询提现单响应参数
  242. type QueryWithdrawOrderResponse struct {
  243. util.CommonError
  244. WithdrawNO string `json:"withdraw_no"` // 提现单单号
  245. Status int `json:"status"` // 提现单的微信侧单号 1-创建成功,提现中 2-提现成功 3-提现失败
  246. WithdrawAmount string `json:"withdraw_amount"` // 提现的金额,单位元,例如提现 1 分钱请使用 0.01
  247. WxWithdrawNo string `json:"wx_withdraw_no"` // 提现单的微信侧单号
  248. WithdrawSuccessTimestamp int64 `json:"withdraw_success_timestamp"` // 提现单成功的秒级时间戳,unix 秒级时间戳
  249. CreateTime string `json:"create_time"` // 提现单创建时间
  250. FailReason string `json:"failReason"` // 提现失败的原因
  251. }
  252. // StartUploadGoodsRequest 启动批量上传道具任务,请求参数
  253. // 1. 使用支付签名
  254. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  255. type StartUploadGoodsRequest struct {
  256. UploadItem []*UploadItem `json:"upload_item"` // 道具信息
  257. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  258. }
  259. // UploadItem 道具信息
  260. type UploadItem struct {
  261. ID string `json:"id"` // 道具 id,长度 (0,64],字符只允许使用字母、数字、'_'、'-'
  262. Name string `json:"name"` // 道具名称,长度 (0,1024]
  263. Price int `json:"price"` // 道具单价,单位分,需要大于 0
  264. Remark string `json:"remark"` // 道具备注,长度 (0,1024]
  265. ItemURL string `json:"item_url"` // 道具图片的 url 地址,当前仅支持 jpg,png 等格式
  266. UploadStatus int `json:"upload_status,omitempty"` // 上传状态 0-上传中 1-id 已经存在 2-上传成功 3-上传失败
  267. ErrMsg string `json:"errmsg,omitempty"` // 上传失败的原因
  268. }
  269. // StartUploadGoodsResponse 启动批量上传道具任务响应参数
  270. type StartUploadGoodsResponse struct {
  271. util.CommonError
  272. }
  273. // QueryUploadGoodsRequest 查询批量上传道具任务,请求参数
  274. // 1. 使用支付签名
  275. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  276. type QueryUploadGoodsRequest struct {
  277. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  278. }
  279. // QueryUploadGoodsResponse 查询批量上传道具任务响应参数
  280. type QueryUploadGoodsResponse struct {
  281. util.CommonError
  282. UploadItem []*UploadItem `json:"upload_item"` // 道具信息列表
  283. Status int `json:"status"` // 任务状态 0-无任务在运行 1-任务运行中 2-上传失败或部分失败(上传任务已经完成)3-上传成功
  284. }
  285. // StartPublishGoodsRequest 启动批量发布道具任务,请求参数
  286. // 1. 使用支付签名
  287. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  288. type StartPublishGoodsRequest struct {
  289. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  290. PublishItem []*PublishItem `json:"publish_item"` // 道具信息 发布的商品列表
  291. }
  292. // PublishItem 道具信息
  293. type PublishItem struct {
  294. ID string `json:"id"` // 道具 id,添加到开发环境时传的道具 id,长度 (0,64],字符只允许使用字母、数字、'_'、'-'
  295. PublishStatus int `json:"publish_status,omitempty"` // 发布状态 0-上传中 1-id 已经存在 2-发布成功 3-发布失败
  296. ErrMsg string `json:"errmsg,omitempty"` // 发布失败的原因
  297. }
  298. // StartPublishGoodsResponse 启动批量发布道具任务响应参数
  299. type StartPublishGoodsResponse struct {
  300. util.CommonError
  301. }
  302. // QueryPublishGoodsRequest 查询批量发布道具任务,请求参数
  303. // 1. 使用支付签名
  304. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  305. type QueryPublishGoodsRequest struct {
  306. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  307. }
  308. // QueryPublishGoodsResponse 查询批量发布道具任务响应参数
  309. type QueryPublishGoodsResponse struct {
  310. util.CommonError
  311. PublishItem []*PublishItem `json:"publish_item"` // 道具信息列表
  312. Status int `json:"status"` // 任务状态 0-无任务在运行 1-任务运行中 2-上传失败或部分失败(上传任务已经完成)3-上传成功
  313. }
  314. // AsyncXPayGoodsDeliverNotifyRequest 异步通知发货,请求参数
  315. // 1. 使用支付签名
  316. // POST,请求参数为 json 字符串,Content-Type 为 application/json
  317. type AsyncXPayGoodsDeliverNotifyRequest struct {
  318. ToUserName string `json:"ToUserName"` // 小程序的原始 ID
  319. FromUserName string `json:"FromUserName"` // 发送方帐号(一个 OpenID)该事件消息的 openid,道具发货场景固定为微信官方的 openid
  320. CreateTime int `json:"CreateTime"` // 消息发送时间(整型)
  321. MsgType string `json:"MsgType"` // 消息类型,此时固定为:event
  322. Event string `json:"Event"` // 事件类型,此时固定为:xpay_goods_deliver_notify
  323. Openid string `json:"openid"` // 用户 openid
  324. OutTradeNo string `json:"OutTradeNo"` // 业务订单号
  325. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  326. WechatPayInfo *WeChatPayInfo `json:"WechatPayInfo"` // 微信支付订单信息
  327. GoodsInfo *GoodsInfo `json:"GoodsInfo"` // 道具信息
  328. }
  329. // WeChatPayInfo 微信支付信息 非微信支付渠道可能没有
  330. type WeChatPayInfo struct {
  331. MchOrderNo string `json:"MchOrderNo"` // 商户订单号
  332. TransactionID string `json:"TransactionId"` // 微信支付订单号
  333. }
  334. // GoodsInfo 道具参数信息
  335. type GoodsInfo struct {
  336. ProductID string `json:"ProductId"` // 道具 ID
  337. Quantity int `json:"Quantity"` // 数量
  338. OrigPrice int `json:"OrigPrice"` // 物品原始价格(单位:分)
  339. ActualPrice int `json:"ActualPrice"` // 物品实际支付价格(单位:分)
  340. Attach string `json:"Attach"` // 透传信息
  341. }
  342. // AsyncXPayGoodsDeliverNotifyResponse 异步通知发货响应参数
  343. type AsyncXPayGoodsDeliverNotifyResponse struct {
  344. util.CommonError
  345. }
  346. // AsyncXPayCoinPayNotifyRequest 异步通知代币支付推送,请求参数
  347. type AsyncXPayCoinPayNotifyRequest struct {
  348. ToUserName string `json:"ToUserName"` // 小程序的原始 ID
  349. FromUserName string `json:"FromUserName"` // 发送方帐号(一个 OpenID)该事件消息的 openid,道具发货场景固定为微信官方的 openid
  350. CreateTime int `json:"CreateTime"` // 消息发送时间(整型)
  351. MsgType string `json:"MsgType"` // 消息类型,此时固定为:event
  352. Event string `json:"Event"` // 事件类型,此时固定为:xpay_goods_deliver_notify
  353. Openid string `json:"openid"` // 用户 openid
  354. OutTradeNo string `json:"OutTradeNo"` // 业务订单号
  355. Env Env `json:"env"` // 环境 0-正式环境 1-沙箱环境
  356. WechatPayInfo *WeChatPayInfo `json:"WechatPayInfo"` // 微信支付订单信息
  357. CoinInfo *CoinInfo `json:"GoodsInfo"` // 道具信息
  358. }
  359. // CoinInfo 代币信息
  360. type CoinInfo struct {
  361. Quantity int `json:"Quantity"` // 数量
  362. OrigPrice int `json:"OrigPrice"` // 物品原始价格(单位:分)
  363. ActualPrice int `json:"ActualPrice"` // 物品实际支付价格(单位:分)
  364. Attach string `json:"Attach"` // 透传信息
  365. }
  366. // AsyncXPayCoinPayNotifyResponse 异步通知代币支付推送响应参数
  367. type AsyncXPayCoinPayNotifyResponse struct {
  368. util.CommonError
  369. }
  370. // URLParams url parameter
  371. type URLParams struct {
  372. Path string `json:"path"`
  373. AccessToken string `json:"access_token"`
  374. PaySign string `json:"paySign"`
  375. Signature string `json:"signature"`
  376. Content string `json:"content"`
  377. }