Check for valid callback source address
This commit is contained in:
@@ -7,6 +7,8 @@ type YooKassa struct {
|
||||
Timeout time.Duration
|
||||
Test bool
|
||||
|
||||
AllowedCallbackSubnets []string
|
||||
|
||||
ApiBaseKey string
|
||||
ApiBaseSecret string
|
||||
ApiPaymentKey string
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"payouts/internal/config"
|
||||
"payouts/internal/models"
|
||||
"payouts/internal/service/database/orm"
|
||||
yookassaConf "payouts/internal/service/yookassa/config"
|
||||
)
|
||||
|
||||
var Module = fx.Options(
|
||||
@@ -27,6 +28,7 @@ func WithContext(ctx context.Context) Optional {
|
||||
|
||||
type Service interface {
|
||||
CreatePayout(models.PayoutReq, *orm.User, ...Optional)
|
||||
GetConfig() yookassaConf.YooKassa
|
||||
}
|
||||
|
||||
type Param struct {
|
||||
|
||||
@@ -65,3 +65,8 @@ func (y *yookassaService) CreatePayout(req models.PayoutReq, userSession *orm.Us
|
||||
|
||||
y.payClient.PayoutsPost(params.ctx, &gen.PayoutRequest{}, gen.PayoutsPostParams{})
|
||||
}
|
||||
|
||||
// GetConfig implements [Service].
|
||||
func (y *yookassaService) GetConfig() config.YooKassa {
|
||||
return y.conf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user