unified gateway interfaces

This commit is contained in:
Stephan D
2026-01-04 12:47:43 +01:00
parent 743f683d92
commit 59c83e414a
41 changed files with 927 additions and 186 deletions

View File

@@ -1,19 +1,22 @@
package srequest
import (
"strings"
"github.com/tech/sendico/pkg/merrors"
"github.com/tech/sendico/pkg/model"
)
type PaymentIntent struct {
Kind PaymentKind `json:"kind,omitempty"`
Source *Endpoint `json:"source,omitempty"`
Destination *Endpoint `json:"destination,omitempty"`
Amount *model.Money `json:"amount,omitempty"`
FX *FXIntent `json:"fx,omitempty"`
SettlementMode SettlementMode `json:"settlement_mode,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
Customer *Customer `json:"customer,omitempty"`
Kind PaymentKind `json:"kind,omitempty"`
Source *Endpoint `json:"source,omitempty"`
Destination *Endpoint `json:"destination,omitempty"`
Amount *model.Money `json:"amount,omitempty"`
FX *FXIntent `json:"fx,omitempty"`
SettlementMode SettlementMode `json:"settlement_mode,omitempty"`
SettlementCurrency string `json:"settlement_currency,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
Customer *Customer `json:"customer,omitempty"`
}
type AssetResolverStub struct{}
@@ -51,5 +54,11 @@ func (p *PaymentIntent) Validate() error {
}
}
if strings.TrimSpace(p.SettlementCurrency) != "" {
if err := ValidateCurrency(p.SettlementCurrency, &AssetResolverStub{}); err != nil {
return err
}
}
return nil
}