multiple quotes payment
This commit is contained in:
@@ -12,10 +12,12 @@ type PaymentQuoteRecord struct {
|
||||
storable.Base `bson:",inline" json:",inline"`
|
||||
model.OrganizationBoundBase `bson:",inline" json:",inline"`
|
||||
|
||||
QuoteRef string `bson:"quoteRef" json:"quoteRef"`
|
||||
Intent PaymentIntent `bson:"intent" json:"intent"`
|
||||
Quote *PaymentQuoteSnapshot `bson:"quote" json:"quote"`
|
||||
ExpiresAt time.Time `bson:"expiresAt" json:"expiresAt"`
|
||||
QuoteRef string `bson:"quoteRef" json:"quoteRef"`
|
||||
Intent PaymentIntent `bson:"intent,omitempty" json:"intent,omitempty"`
|
||||
Intents []PaymentIntent `bson:"intents,omitempty" json:"intents,omitempty"`
|
||||
Quote *PaymentQuoteSnapshot `bson:"quote,omitempty" json:"quote,omitempty"`
|
||||
Quotes []*PaymentQuoteSnapshot `bson:"quotes,omitempty" json:"quotes,omitempty"`
|
||||
ExpiresAt time.Time `bson:"expiresAt" json:"expiresAt"`
|
||||
}
|
||||
|
||||
// Collection implements storable.Storable.
|
||||
|
||||
@@ -73,6 +73,16 @@ func (q *Quotes) Create(ctx context.Context, quote *model.PaymentQuoteRecord) er
|
||||
quote.Intent.Attributes[k] = strings.TrimSpace(v)
|
||||
}
|
||||
}
|
||||
if len(quote.Intents) > 0 {
|
||||
for i := range quote.Intents {
|
||||
if quote.Intents[i].Attributes == nil {
|
||||
continue
|
||||
}
|
||||
for k, v := range quote.Intents[i].Attributes {
|
||||
quote.Intents[i].Attributes[k] = strings.TrimSpace(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
quote.Update()
|
||||
|
||||
filter := repository.OrgFilter(quote.OrganizationRef).And(
|
||||
|
||||
Reference in New Issue
Block a user