const.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package pay
  2. import "fmt"
  3. const (
  4. // cloud用户数据库名
  5. CLOUD_USER_DB_NAME string = "usercenter"
  6. PACK_PAY_NAME string = "pay"
  7. // 支付点
  8. PayPointListApi = "pay.point.list"
  9. PayPointDetailApi = "pay.point.detail"
  10. PayPointAmountApi = "pay.point.amount"
  11. PayOrderCreateApi = "pay.order.create"
  12. PayOrderDetailApi = "pay.order.detail"
  13. PayOrderUpdateApi = "pay.order.update"
  14. // 退款申请 api
  15. PayRefundCreateApi = "pay.refund.create"
  16. PayRefundDetailApi = "pay.refund.detail"
  17. PayRefundUpdateApi = "pay.refund.update"
  18. // 支付二维码
  19. PaySingleQrApi = "pay.single.crateQr"
  20. // 支付方式
  21. PayModAliPay = 0
  22. PayModWechtPay = 1
  23. // 支付项目
  24. PayProjectQueenShow = "queenshow"
  25. PayProjectQueenShowTrade = "QS"
  26. // TODO
  27. PaySingleRefundApi = "pay.single.refund"
  28. PaySingleRefundQueryApi = "pay.single.refundQuery"
  29. PaySingleCloseOrderApi = "pay.single.closeOrder"
  30. PayMultiQrApi = "pay.multi.crateQr"
  31. PayMultiRefundApi = "pay.multi.refund"
  32. // 退款状态
  33. REFUND_PROCESSING = iota // 0 退款处理中
  34. REFUND_SUCCESS // 1 退款成功
  35. REFUND_CLOSED // 2 退款关闭
  36. REFUND_ABNORMAL // 3 退款异常
  37. )
  38. func NewAppPaySuccSubject(app string) string {
  39. return fmt.Sprintf("%s-pay-succ#%s.paysucc#%s-paysucc-queue", app, app, app)
  40. }
  41. func NewAppPayFailSubject(app string) string {
  42. return fmt.Sprintf("%s-pay-fail#%s.payfail#%s-payfail-queue", app, app, app)
  43. }
  44. var (
  45. // 支付订单状态
  46. // 待付款
  47. WaitPay int32 = 0
  48. // 待发货
  49. WaitDeliver int32 = 1
  50. // 交易完成
  51. Transacted int32 = 2
  52. // 取消
  53. Canceled int32 = 3
  54. )