constant.go 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. const (
  21. // EnvProduction 环境 0-正式环境 1-沙箱环境
  22. EnvProduction Env = 0
  23. // EnvSandbox 环境 0-正式环境 1-沙箱环境
  24. EnvSandbox Env = 1
  25. )
  26. const (
  27. // Success 错误码 0、成功
  28. Success ErrCode = 0
  29. // SystemError 错误码 -1、系统错误
  30. SystemError ErrCode = -1
  31. // OpenIDError 错误码 268490001、openid 错误
  32. OpenIDError ErrCode = 268490001
  33. // RequestParamError 错误码 268490002、请求参数字段错误,具体看 errmsg
  34. RequestParamError ErrCode = 268490002
  35. // SignError 错误码 268490003、签名错误
  36. SignError ErrCode = 268490003
  37. // RepeatOperationError 错误码 268490004、重复操作(赠送和代币支付相关接口会返回,表示之前的操作已经成功)
  38. RepeatOperationError ErrCode = 268490004
  39. // OrderRefundedError 错误码 268490005、订单已经通过 cancel_currency_pay 接口退款,不支持再退款
  40. OrderRefundedError ErrCode = 268490005
  41. // InsufficientBalanceError 错误码 268490006、代币的退款/支付操作金额不足
  42. InsufficientBalanceError ErrCode = 268490006
  43. // SensitiveContentError 错误码 268490007、图片或文字存在敏感内容,禁止使用
  44. SensitiveContentError ErrCode = 268490007
  45. // TokenNotPublishedError 错误码 268490008、代币未发布,不允许进行代币操作
  46. TokenNotPublishedError ErrCode = 268490008
  47. // SessionKeyExpiredError 错误码 268490009、用户 session_key 不存在或已过期,请重新登录
  48. SessionKeyExpiredError ErrCode = 268490009
  49. // BillGeneratingError 错误码 268490011、账单数据生成中,请稍后调用本接口获取
  50. BillGeneratingError ErrCode = 268490011
  51. // BatchTaskRunningError 错误码 268490012、批量任务运行中,请等待完成后才能再次运行
  52. BatchTaskRunningError ErrCode = 268490012
  53. // RefundVerifiedOrderError 错误码 268490013、禁止对核销状态的单进行退款
  54. RefundVerifiedOrderError ErrCode = 268490013
  55. // RefundInProgressError 错误码 268490014、退款操作进行中,稍后可以使用相同参数重试
  56. RefundInProgressError ErrCode = 268490014
  57. // FrequencyLimitError 错误码 268490015、频率限制
  58. FrequencyLimitError ErrCode = 268490015
  59. // RefundLeftFeeMismatchError 错误码 268490016、退款的 left_fee 字段与实际不符
  60. RefundLeftFeeMismatchError ErrCode = 268490016
  61. // AdFundIndustryMismatchError 错误码 268490018、广告金充值帐户行业 id 不匹配
  62. AdFundIndustryMismatchError ErrCode = 268490018
  63. // AdFundAccountBoundError 错误码 268490019、广告金充值帐户 id 已绑定其他 appid
  64. AdFundAccountBoundError ErrCode = 268490019
  65. // AdFundAccountNameError 错误码 268490020、广告金充值帐户主体名称错误
  66. AdFundAccountNameError ErrCode = 268490020
  67. // AccountNotVerifiedError 错误码 268490021、账户未完成进件
  68. AccountNotVerifiedError ErrCode = 268490021
  69. // AdFundAccountInvalidError 错误码 268490022、广告金充值账户无效
  70. AdFundAccountInvalidError ErrCode = 268490022
  71. // AdFundInsufficientError 错误码 268490023、广告金余额不足
  72. AdFundInsufficientError ErrCode = 268490023
  73. // AdFundAmountMustPositiveError 错误码 268490024、广告金充值金额必须大于 0
  74. AdFundAmountMustPositiveError ErrCode = 268490024
  75. )
  76. const (
  77. // OrderStatusInit 订单状态 当前状态 0-订单初始化(未创建成功,不可用于支付)
  78. OrderStatusInit OrderStatus = 0
  79. // OrderStatusCreated 订单状态 当前状态 1-订单创建成功
  80. OrderStatusCreated OrderStatus = 1
  81. // OrderStatusPaid 订单状态 当前状态 2-订单已经支付,待发货
  82. OrderStatusPaid OrderStatus = 2
  83. // OrderStatusDelivering 订单状态 当前状态 3-订单发货中
  84. OrderStatusDelivering OrderStatus = 3
  85. // OrderStatusDelivered 订单状态 当前状态 4-订单已发货
  86. OrderStatusDelivered OrderStatus = 4
  87. // OrderStatusRefunded 订单状态 当前状态 5-订单已经退款
  88. OrderStatusRefunded OrderStatus = 5
  89. // OrderStatusClosed 订单状态 当前状态 6-订单已经关闭(不可再使用)
  90. OrderStatusClosed OrderStatus = 6
  91. // OrderStatusRefundFailed 订单状态 当前状态 7-订单退款失败
  92. OrderStatusRefundFailed OrderStatus = 7
  93. )
  94. const (
  95. // baseSite 基础网址
  96. baseSite = "https://api.weixin.qq.com"
  97. // queryUserBalance 查询虚拟支付余额
  98. queryUserBalance = "/xpay/query_user_balance"
  99. // currencyPay 扣减代币(一般用于代币支付)
  100. currencyPay = "/xpay/currency_pay"
  101. // queryOrder 查询创建的订单(现金单,非代币单)
  102. queryOrder = "/xpay/query_order"
  103. // cancelCurrencyPay 代币支付退款 (currency_pay 接口的逆操作)
  104. cancelCurrencyPay = "/xpay/cancel_currency_pay"
  105. // notifyProvideGoods 通知已经发货完成(只能通知现金单),正常通过 xpay_goods_deliver_notify 消息推送返回成功就不需要调用这个 api 接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态
  106. notifyProvideGoods = "/xpay/notify_provide_goods"
  107. // presentCurrency 代币赠送接口,由于目前不支付按单号查赠送单的功能,所以当需要赠送的时候可以一直重试到返回 0 或者返回 268490004(重复操作)为止
  108. presentCurrency = "/xpay/present_currency"
  109. // downloadBill 下载账单
  110. downloadBill = "/xpay/download_bill"
  111. // refundOrder 退款 对使用 jsapi 接口下的单进行退款
  112. refundOrder = "/xpay/refund_order"
  113. // createWithdrawOrder 创建提现单
  114. createWithdrawOrder = "/xpay/create_withdraw_order"
  115. // queryWithdrawOrder 查询提现单
  116. queryWithdrawOrder = "/xpay/query_withdraw_order"
  117. // startUploadGoods 启动批量上传道具任务
  118. startUploadGoods = "/xpay/start_upload_goods"
  119. // queryUploadGoods 查询批量上传道具任务状态
  120. queryUploadGoods = "/xpay/query_upload_goods"
  121. // startPublishGoods 启动批量发布道具任务
  122. startPublishGoods = "/xpay/start_publish_goods"
  123. // queryPublishGoods 查询批量发布道具任务状态
  124. queryPublishGoods = "/xpay/query_publish_goods"
  125. // startDownloadOrder 发起下载小程序订单明细任务
  126. startDownloadOrder = "/xpay/start_download_order"
  127. // queryDownloadOrder 查询下载订单任务结果
  128. queryDownloadOrder = "/xpay/query_download_order"
  129. // queryBizBalance 查询商家账户可提现余额
  130. queryBizBalance = "/xpay/query_biz_balance"
  131. // queryTransferAccount 查询广告金充值账户
  132. queryTransferAccount = "/xpay/query_transfer_account"
  133. // queryAdverFunds 查询广告金发放记录
  134. queryAdverFunds = "/xpay/query_adver_funds"
  135. // createFundsBill 充值广告金
  136. createFundsBill = "/xpay/create_funds_bill"
  137. // bindTransferAccount 绑定广告金充值账户
  138. bindTransferAccount = "/xpay/bind_transfer_accout"
  139. // queryFundsBill 查询广告金充值记录
  140. queryFundsBill = "/xpay/query_funds_bill"
  141. // queryRecoverBill 查询广告金回收记录
  142. queryRecoverBill = "/xpay/query_recover_bill"
  143. // downloadAdverFundsOrder 下载广告金对应的商户订单信息
  144. downloadAdverFundsOrder = "/xpay/download_adverfunds_order"
  145. // getComplaintList 获取投诉列表
  146. getComplaintList = "/xpay/get_complaint_list"
  147. // getComplaintDetail 获取投诉详情
  148. getComplaintDetail = "/xpay/get_complaint_detail"
  149. // getNegotiationHistory 获取协商历史
  150. getNegotiationHistory = "/xpay/get_negotiation_history"
  151. // responseComplaint 回复用户
  152. responseComplaint = "/xpay/response_complaint"
  153. // completeComplaint 完成投诉处理
  154. completeComplaint = "/xpay/complete_complaint"
  155. // uploadVPFile 上传媒体文件
  156. uploadVPFile = "/xpay/upload_vp_file"
  157. // getUploadFileSign 获取微信支付反馈投诉图片的签名头部
  158. getUploadFileSign = "/xpay/get_upload_file_sign"
  159. )
  160. const (
  161. // signature user mode signature
  162. signature = "signature"
  163. // paySignature payment signature
  164. paySignature = "pay_sig"
  165. // accessToken access_token authorization tokens
  166. accessToken = "access_token"
  167. // EmptyString empty string
  168. EmptyString = ""
  169. )