package pay

import "fmt"

const (
	// cloud用户数据库名
	CLOUD_USER_DB_NAME string = "usercenter"
	PACK_PAY_NAME      string = "pay"

	// 支付点
	PayPointListApi   = "pay.point.list"
	PayPointDetailApi = "pay.point.detail"
	PayPointAmountApi = "pay.point.amount"
	PayOrderCreateApi = "pay.order.create"
	PayOrderDetailApi = "pay.order.detail"
	PayOrderUpdateApi = "pay.order.update"

	// 退款申请 api
	PayRefundCreateApi = "pay.refund.create"
	PayRefundDetailApi = "pay.refund.detail"
	PayRefundUpdateApi = "pay.refund.update"

	// 支付二维码
	PaySingleQrApi = "pay.single.crateQr"

	// 支付方式
	PayModAliPay   = 0
	PayModWechtPay = 1

	// 支付项目
	PayProjectQueenShow      = "queenshow"
	PayProjectQueenShowTrade = "QS"

	// TODO
	PaySingleRefundApi      = "pay.single.refund"
	PaySingleRefundQueryApi = "pay.single.refundQuery"
	PaySingleCloseOrderApi  = "pay.single.closeOrder"

	PayMultiQrApi     = "pay.multi.crateQr"
	PayMultiRefundApi = "pay.multi.refund"

	// 退款状态
	REFUND_PROCESSING = iota // 0 退款处理中
	REFUND_SUCCESS           // 1 退款成功
	REFUND_CLOSED            // 2 退款关闭
	REFUND_ABNORMAL          // 3 退款异常
)

func NewAppPaySuccSubject(app string) string {
	return fmt.Sprintf("%s-pay-succ#%s.paysucc#%s-paysucc-queue", app, app, app)
}
func NewAppPayFailSubject(app string) string {
	return fmt.Sprintf("%s-pay-fail#%s.payfail#%s-payfail-queue", app, app, app)
}

var (
	// 支付订单状态
	// 待付款
	WaitPay int32 = 0
	// 待发货
	WaitDeliver int32 = 1
	// 交易完成
	Transacted int32 = 2
	// 取消
	Canceled int32 = 3
)
