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

@@ -11,6 +11,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"
@@ -114,7 +115,7 @@ func (h *quotePaymentCommand) prepareQuoteCtx(req *quotationv1.QuotePaymentReque
func (h *quotePaymentCommand) quotePayment(
ctx context.Context,
quotesStore storage.QuotesStore,
quotesStore quotestorage.QuotesStore,
qc *quoteCtx,
req *quotationv1.QuotePaymentRequest,
) (*quotePaymentResult, error) {
@@ -415,7 +416,7 @@ func (h *quotePaymentsCommand) prepare(req *quotationv1.QuotePaymentsRequest) (*
func (h *quotePaymentsCommand) tryReuse(
ctx context.Context,
quotesStore storage.QuotesStore,
quotesStore quotestorage.QuotesStore,
qc *quotePaymentsCtx,
) (*model.PaymentQuoteRecord, bool, error) {
@@ -515,7 +516,7 @@ func (h *quotePaymentsCommand) aggregate(
func (h *quotePaymentsCommand) storeBatch(
ctx context.Context,
quotesStore storage.QuotesStore,
quotesStore quotestorage.QuotesStore,
qc *quotePaymentsCtx,
quoteRef string,
intents []*sharedv1.PaymentIntent,

View File

@@ -8,6 +8,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/merrors"
mloggerfactory "github.com/tech/sendico/pkg/mlogger/factory"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
@@ -155,14 +156,15 @@ func (e *quoteCommandTestEngine) ResolvePaymentQuote(context.Context, quoteResol
func (e *quoteCommandTestEngine) Repository() storage.Repository { return e.repo }
type quoteCommandTestRepo struct {
quotes storage.QuotesStore
quotes quotestorage.QuotesStore
}
func (r quoteCommandTestRepo) Ping(context.Context) error { return nil }
func (r quoteCommandTestRepo) Payments() storage.PaymentsStore { return nil }
func (r quoteCommandTestRepo) Quotes() storage.QuotesStore { return r.quotes }
func (r quoteCommandTestRepo) Routes() storage.RoutesStore { return nil }
func (r quoteCommandTestRepo) PlanTemplates() storage.PlanTemplatesStore { return nil }
func (r quoteCommandTestRepo) Ping(context.Context) error { return nil }
func (r quoteCommandTestRepo) Payments() storage.PaymentsStore { return nil }
func (r quoteCommandTestRepo) PaymentMethods() storage.PaymentMethodsStore { return nil }
func (r quoteCommandTestRepo) Quotes() quotestorage.QuotesStore { return r.quotes }
func (r quoteCommandTestRepo) Routes() storage.RoutesStore { return nil }
func (r quoteCommandTestRepo) PlanTemplates() storage.PlanTemplatesStore { return nil }
type quoteCommandTestQuotesStore struct {
byID map[string]*model.PaymentQuoteRecord

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/merrors"
quotationv1 "github.com/tech/sendico/pkg/proto/payments/quotation/v1"
sharedv1 "github.com/tech/sendico/pkg/proto/payments/shared/v1"
@@ -42,7 +43,7 @@ func requireNonNilIntent(intent *sharedv1.PaymentIntent) error {
return nil
}
func ensureQuotesStore(repo storage.Repository) (storage.QuotesStore, error) {
func ensureQuotesStore(repo storage.Repository) (quotestorage.QuotesStore, error) {
if repo == nil {
return nil, errStorageUnavailable
}