接入顺成支付并优化配置列表
This commit is contained in:
@@ -62,12 +62,29 @@ func (r *Repository) validateCreateRequest(req CreateRequest) error {
|
||||
return ErrTermNoRequired
|
||||
}
|
||||
}
|
||||
if req.Provider == "shuncheng" {
|
||||
if req.GatewayURL == "" {
|
||||
return ErrGatewayURLRequired
|
||||
}
|
||||
if req.SignKey == "" {
|
||||
return ErrSignKeyRequired
|
||||
}
|
||||
if req.NotifyKey == "" {
|
||||
return ErrNotifyKeyRequired
|
||||
}
|
||||
if req.NotifyURL == "" {
|
||||
return ErrNotifyURLRequired
|
||||
}
|
||||
if extraString(req.ExtraConfig, "secret_id") == "" {
|
||||
return ErrSecretIDRequired
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func isValidProvider(value string) bool {
|
||||
return value == "leshua" || value == "lakala" || value == "mock"
|
||||
return value == "leshua" || value == "lakala" || value == "shuncheng" || value == "mock"
|
||||
}
|
||||
|
||||
func isValidSignType(value string) bool {
|
||||
|
||||
Reference in New Issue
Block a user