new payment methods service

This commit is contained in:
Stephan D
2026-02-12 21:10:33 +01:00
parent b80dca0ce9
commit a862e27087
106 changed files with 3262 additions and 414 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/tech/sendico/payments/storage"
"github.com/tech/sendico/payments/storage/model"
quotestorage "github.com/tech/sendico/payments/storage/quote"
"github.com/tech/sendico/pkg/api/routers/gsresponse"
"github.com/tech/sendico/pkg/merrors"
"github.com/tech/sendico/pkg/mlogger"
@@ -72,7 +73,7 @@ func ensurePaymentsStore(repo storage.Repository) (storage.PaymentsStore, error)
return store, nil
}
func ensureQuotesStore(repo storage.Repository) (storage.QuotesStore, error) {
func ensureQuotesStore(repo storage.Repository) (quotestorage.QuotesStore, error) {
if repo == nil {
return nil, errStorageUnavailable
}

View File

@@ -8,6 +8,7 @@ import (
ledgerclient "github.com/tech/sendico/ledger/client"
"github.com/tech/sendico/payments/storage"
"github.com/tech/sendico/payments/storage/model"
quotestorage "github.com/tech/sendico/payments/storage/quote"
clockpkg "github.com/tech/sendico/pkg/clock"
mloggerfactory "github.com/tech/sendico/pkg/mlogger/factory"
"github.com/tech/sendico/pkg/model/account_role"
@@ -380,7 +381,7 @@ func TestInitiatePaymentByQuoteRef(t *testing.T) {
type stubRepo struct {
payments storage.PaymentsStore
quotes storage.QuotesStore
quotes quotestorage.QuotesStore
routes storage.RoutesStore
plans storage.PlanTemplatesStore
pingErr error
@@ -388,8 +389,11 @@ type stubRepo struct {
func (s stubRepo) Ping(context.Context) error { return s.pingErr }
func (s stubRepo) Payments() storage.PaymentsStore { return s.payments }
func (s stubRepo) Quotes() storage.QuotesStore { return s.quotes }
func (s stubRepo) Routes() storage.RoutesStore { return s.routes }
func (s stubRepo) PaymentMethods() storage.PaymentMethodsStore {
return nil
}
func (s stubRepo) Quotes() quotestorage.QuotesStore { return s.quotes }
func (s stubRepo) Routes() storage.RoutesStore { return s.routes }
func (s stubRepo) PlanTemplates() storage.PlanTemplatesStore {
if s.plans != nil {
return s.plans

View File

@@ -10,6 +10,7 @@ import (
ledgerclient "github.com/tech/sendico/ledger/client"
"github.com/tech/sendico/payments/storage"
"github.com/tech/sendico/payments/storage/model"
quotestorage "github.com/tech/sendico/payments/storage/quote"
"github.com/tech/sendico/pkg/api/routers/gsresponse"
"github.com/tech/sendico/pkg/merrors"
mo "github.com/tech/sendico/pkg/model"
@@ -399,14 +400,17 @@ func TestProcessDepositObservedHandler_MatchesPayment(t *testing.T) {
type stubRepository struct {
store *stubPaymentsStore
quotes storage.QuotesStore
quotes quotestorage.QuotesStore
routes storage.RoutesStore
plans storage.PlanTemplatesStore
}
func (r *stubRepository) Ping(context.Context) error { return nil }
func (r *stubRepository) Payments() storage.PaymentsStore { return r.store }
func (r *stubRepository) Quotes() storage.QuotesStore {
func (r *stubRepository) PaymentMethods() storage.PaymentMethodsStore {
return nil
}
func (r *stubRepository) Quotes() quotestorage.QuotesStore {
if r.quotes != nil {
return r.quotes
}