78 lines
2.5 KiB
Go
78 lines
2.5 KiB
Go
package common
|
||
|
||
const (
|
||
TOKEN_PRE = "player_token_"
|
||
TOKEN_Admin = "Admin_token_"
|
||
ADMIN_V1 = "/pay/admin/api/v1"
|
||
FRONT_V1 = "/pay/front/api/v1"
|
||
|
||
WXCodeRedirectAddress = FRONT_V1 + "/wx/payurl" // 微信支付,授权code后 重定向地址
|
||
|
||
// 支付渠道枚举,1微信JSAPI,2微信H5,3微信app,4微信Native,5微信小程序,6支付宝网页&移动应用,7支付宝小程序,8支付宝JSAPI
|
||
PAY_CHANNEL_UNKNOWN = 0
|
||
PAY_CHANNEL_WECHAT_JSAPI = 1
|
||
PAY_CHANNEL_WECHAT_H5 = 2
|
||
PAY_CHANNEL_WECHAT_APP = 3
|
||
PAY_CHANNEL_WECHAT_NATIVE = 4
|
||
PAY_CHANNEL_WECHAT_MINI = 5
|
||
PAY_CHANNEL_ALIPAY_WEB = 6
|
||
PAY_CHANNEL_ALIPAY_MINI = 7
|
||
PAY_CHANNEL_ALIPAY_JSAPI = 8
|
||
|
||
// 统一登陆信息
|
||
ADMIN_USER_ID = "User-Id"
|
||
ADMIN_USER_NAME = "User-Name"
|
||
ADMIN_USER_INCLUDEUSERS = "Include-Users"
|
||
|
||
// '订单状态: 1待支付、2支付中、3支付成功、4支付失败、5订单关闭
|
||
ORDER_STATUS_WAITPAY = 1
|
||
ORDER_STATUS_PAYING = 2
|
||
ORDER_STATUS_PAYED = 3
|
||
ORDER_STATUS_FAILED = 4
|
||
ORDER_STATUS_CLOSE = 5
|
||
|
||
// 订单类型,1支付,2退款
|
||
ORDER_TYPE_PAY = 1
|
||
ORDER_TYPE_REFUND = 2
|
||
|
||
STATUS_ENABLE = 1
|
||
STATUS_DISABLED = 2
|
||
|
||
PAY_CHANNLE_TYPE_WECHAT = 1 // 支付类型: 微信
|
||
PAY_CHANNLE_TYPE_ZFB = 2 // 支付类型:支付宝
|
||
|
||
THIRD_ORDER_TYPE_PAY = 1 // 发起支付
|
||
THIRD_ORDER_TYPE_ORDER_QUERY = 2 // 查询订单
|
||
THIRD_ORDER_TYPE_REFUND = 3 // 发起退款
|
||
THIRD_ORDER_TYPE_REFUND_QUERY = 4 // 退款查询
|
||
THIRD_ORDER_TYPE_CLOSE = 5 // 关闭订单
|
||
THIRD_ORDER_TYPE_CALL_BACK = 6 // 支付回调
|
||
|
||
THIRD_ORDER_LOG_STATUS_COMMON = 0 // 第三方日志状态 未知
|
||
THIRD_ORDER_LOG_STATUS_FAIL = 1 // 第三方日志状态 失败
|
||
THIRD_ORDER_LOG_STATUS_SUCCESS = 2 // 第三方日志状态 成功
|
||
)
|
||
|
||
var PayChannelList = map[int]string{
|
||
PAY_CHANNEL_WECHAT_JSAPI: "微信JSAPI",
|
||
PAY_CHANNEL_WECHAT_H5: "微信H5",
|
||
PAY_CHANNEL_WECHAT_APP: "微信app",
|
||
PAY_CHANNEL_WECHAT_NATIVE: "微信Native",
|
||
PAY_CHANNEL_WECHAT_MINI: "微信小程序",
|
||
PAY_CHANNEL_ALIPAY_WEB: "支付宝网页&移动应用",
|
||
PAY_CHANNEL_ALIPAY_MINI: "支付宝小程序",
|
||
PAY_CHANNEL_ALIPAY_JSAPI: "支付宝JSAPI",
|
||
}
|
||
|
||
var OrderTypeList = map[int]string{
|
||
ORDER_TYPE_PAY: "付款",
|
||
ORDER_TYPE_REFUND: "退款",
|
||
}
|
||
var OrderStatusMap = map[int]string{
|
||
ORDER_STATUS_WAITPAY: "等待执行",
|
||
ORDER_STATUS_PAYING: "执行中",
|
||
ORDER_STATUS_PAYED: "执行成功",
|
||
ORDER_STATUS_FAILED: "执行失败",
|
||
ORDER_STATUS_CLOSE: "订单关闭",
|
||
}
|