mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-29 14:46:38 +08:00
21 lines
425 B
Go
21 lines
425 B
Go
package payment
|
|
|
|
import (
|
|
"one-api/payment/gateway/epay"
|
|
"one-api/payment/types"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type PaymentProcessor interface {
|
|
Name() string
|
|
Pay(config *types.PayConfig, gatewayConfig string) (*types.PayRequest, error)
|
|
HandleCallback(c *gin.Context, gatewayConfig string) (*types.PayNotify, error)
|
|
}
|
|
|
|
var Gateways = make(map[string]PaymentProcessor)
|
|
|
|
func init() {
|
|
Gateways["epay"] = &epay.Epay{}
|
|
}
|