extended fields

This commit is contained in:
Stephan D
2026-02-05 19:03:35 +01:00
parent 5984f2c2f7
commit 49b0b63f55
2 changed files with 47 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package sresponse
import (
"net/http"
"time"
"github.com/tech/sendico/pkg/api/http/response"
"github.com/tech/sendico/pkg/mlogger"
@@ -57,12 +58,14 @@ type PaymentQuotes struct {
}
type Payment struct {
PaymentRef string `json:"paymentRef,omitempty"`
IdempotencyKey string `json:"idempotencyKey,omitempty"`
State string `json:"state,omitempty"`
FailureCode string `json:"failureCode,omitempty"`
FailureReason string `json:"failureReason,omitempty"`
LastQuote *PaymentQuote `json:"lastQuote,omitempty"`
PaymentRef string `json:"paymentRef,omitempty"`
IdempotencyKey string `json:"idempotencyKey,omitempty"`
State string `json:"state,omitempty"`
FailureCode string `json:"failureCode,omitempty"`
FailureReason string `json:"failureReason,omitempty"`
LastQuote *PaymentQuote `json:"lastQuote,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
}
type paymentQuoteResponse struct {
@@ -251,5 +254,7 @@ func toPayment(p *orchestratorv1.Payment) *Payment {
FailureCode: p.GetFailureCode().String(),
FailureReason: p.GetFailureReason(),
LastQuote: toPaymentQuote(p.GetLastQuote()),
CreatedAt: p.GetCreatedAt().AsTime(),
Meta: p.GetMetadata(),
}
}