TG settlement service
This commit is contained in:
24
api/gateway/tgsettle/storage/storage.go
Normal file
24
api/gateway/tgsettle/storage/storage.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/tech/sendico/gateway/tgsettle/storage/model"
|
||||
)
|
||||
|
||||
var ErrDuplicate = errors.New("payment gateway storage: duplicate record")
|
||||
|
||||
type Repository interface {
|
||||
Payments() PaymentsStore
|
||||
TelegramConfirmations() TelegramConfirmationsStore
|
||||
}
|
||||
|
||||
type PaymentsStore interface {
|
||||
FindByIdempotencyKey(ctx context.Context, key string) (*model.PaymentExecution, error)
|
||||
InsertExecution(ctx context.Context, exec *model.PaymentExecution) error
|
||||
}
|
||||
|
||||
type TelegramConfirmationsStore interface {
|
||||
Upsert(ctx context.Context, record *model.TelegramConfirmation) error
|
||||
}
|
||||
Reference in New Issue
Block a user