You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
903 B
Go
34 lines
903 B
Go
5 years ago
|
/***************************************************
|
||
|
** @Desc : 注册上游支付接口
|
||
|
** @Time : 2019/10/28 14:48
|
||
|
** @Author : yuebin
|
||
|
** @File : init
|
||
|
** @Last Modified by : yuebin
|
||
|
** @Last Modified time: 2019/10/28 14:48
|
||
|
** @Software: GoLand
|
||
|
****************************************************/
|
||
|
package controller
|
||
|
|
||
|
import (
|
||
4 years ago
|
"github.com/beego/beego/v2/core/logs"
|
||
|
"microservice/common"
|
||
|
_ "microservice/models"
|
||
5 years ago
|
)
|
||
|
|
||
|
var registerSupplier = make(map[string]PayInterface)
|
||
|
|
||
|
//注册各种上游的支付接口
|
||
|
|
||
4 years ago
|
func init() {
|
||
5 years ago
|
registerSupplier["KF"] = new(KuaiFuImpl)
|
||
|
logs.Notice(common.CheckSupplierByCode("KF"))
|
||
|
registerSupplier["WEIXIN"] = new(WeiXinImpl)
|
||
|
logs.Notice(common.CheckSupplierByCode("WEIXIN"))
|
||
|
registerSupplier["ALIPAY"] = new(AlipayImpl)
|
||
|
logs.Notice(common.CheckSupplierByCode("ALIPAY"))
|
||
|
}
|
||
|
|
||
|
func GetPaySupplierByCode(code string) PayInterface {
|
||
|
return registerSupplier[code]
|
||
|
}
|