package api

import (
	"net/http"
	"time"
)

const (
	ALIPAY = iota
	WECHATPAY
	SINGLE = iota - 2
	MULTI
)

type OrderMsg struct {
	OrderId string
	PayMode int
	// 入队时间, 超过十分钟自动ack
	InTime time.Time
}

type PayCallback interface {
	CallBack(c *http.Request) (interface{}, error)
}

func PayMod(payType int, category int) PayCallback {
	if category == SINGLE {
		if payType == ALIPAY {
			return NewSingleAliPayCallback()
		} else {
			return NewSingleWechatPayCallback()
		}
	} else {
		if payType == ALIPAY {
			return NewMutliAliPayCallback()
		} else {
			return NewMutliWechatPayCallback()
		}
	}
}
