complete MECE request

This commit is contained in:
Stephan D
2026-02-24 18:33:12 +01:00
parent 4c5677202a
commit a998b59072
34 changed files with 957 additions and 156 deletions

View File

@@ -30,6 +30,15 @@ const (
SettlementModeFixReceived SettlementMode = "fix_received"
)
// FeeTreatment defines who covers fees in settlement math.
type FeeTreatment string
const (
FeeTreatmentUnspecified FeeTreatment = "unspecified"
FeeTreatmentAddToSource FeeTreatment = "add_to_source"
FeeTreatmentDeductFromDestination FeeTreatment = "deduct_from_destination"
)
// CommitPolicy controls when a step is committed during orchestration.
type CommitPolicy string
@@ -233,6 +242,7 @@ type PaymentIntent struct {
FX *FXIntent `bson:"fx,omitempty" json:"fx,omitempty"`
FeePolicy *paymenttypes.FeePolicy `bson:"feePolicy,omitempty" json:"feePolicy,omitempty"`
SettlementMode SettlementMode `bson:"settlementMode,omitempty" json:"settlementMode,omitempty"`
FeeTreatment FeeTreatment `bson:"feeTreatment,omitempty" json:"feeTreatment,omitempty"`
SettlementCurrency string `bson:"settlementCurrency,omitempty" json:"settlementCurrency,omitempty"`
Attributes map[string]string `bson:"attributes,omitempty" json:"attributes,omitempty"`
Customer *Customer `bson:"customer,omitempty" json:"customer,omitempty"`
@@ -413,6 +423,7 @@ func (p *Payment) Normalize() {
p.Intent.Attributes[k] = strings.TrimSpace(v)
}
}
p.Intent.FeeTreatment = FeeTreatment(strings.TrimSpace(string(p.Intent.FeeTreatment)))
p.Intent.SettlementCurrency = strings.TrimSpace(p.Intent.SettlementCurrency)
if p.Intent.Customer != nil {
p.Intent.Customer.ID = strings.TrimSpace(p.Intent.Customer.ID)