improved storing
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
const (
|
||||
payoutsCollection = "card_payouts"
|
||||
payoutIdemField = "idempotencyKey"
|
||||
payoutIdField = "payoutId"
|
||||
payoutIdField = "paymentRef"
|
||||
)
|
||||
|
||||
type Payouts struct {
|
||||
@@ -74,7 +74,7 @@ func (p *Payouts) Upsert(ctx context.Context, record *model.CardPayout) error {
|
||||
}
|
||||
|
||||
record.OperationRef = strings.TrimSpace(record.OperationRef)
|
||||
record.PayoutID = strings.TrimSpace(record.PayoutID)
|
||||
record.PaymentRef = strings.TrimSpace(record.PaymentRef)
|
||||
record.CustomerID = strings.TrimSpace(record.CustomerID)
|
||||
record.ProviderCode = strings.TrimSpace(record.ProviderCode)
|
||||
record.ProviderPaymentID = strings.TrimSpace(record.ProviderPaymentID)
|
||||
@@ -86,7 +86,7 @@ func (p *Payouts) Upsert(ctx context.Context, record *model.CardPayout) error {
|
||||
|
||||
if err := p.repository.Upsert(ctx, record); err != nil {
|
||||
p.logger.Warn("Failed to upsert payout record", zap.Error(err), mzap.ObjRef("payout_ref", record.ID),
|
||||
zap.String("operation_ref", record.OperationRef), zap.String("payment_ref", record.PayoutID))
|
||||
zap.String("operation_ref", record.OperationRef), zap.String("payment_ref", record.PaymentRef))
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user