Merge pull request 'extended logging' (#452) from mntx-452 into main
All checks were successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
All checks were successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
Reviewed-on: #452
This commit was merged in pull request #452.
This commit is contained in:
@@ -38,7 +38,9 @@ func toOpStatus(t *model.CardPayout) rail.OperationResult {
|
||||
|
||||
func (p *cardPayoutProcessor) updatePayoutStatus(ctx context.Context, state *model.CardPayout) error {
|
||||
if err := p.store.Payouts().Upsert(ctx, state); err != nil {
|
||||
p.logger.Warn("Failed to update transfer status", zap.String("transfer_ref", state.PayoutID), zap.String("status", string(state.Status)), zap.Error(err))
|
||||
p.logger.Warn("Failed to update transfer status", zap.Error(err), mzap.ObjRef("payout_ref", state.ID),
|
||||
zap.String("transfer_ref", state.PayoutID), zap.String("status", string(state.Status)),
|
||||
)
|
||||
}
|
||||
if isFinalStatus(state) {
|
||||
p.emitTransferStatusEvent(state)
|
||||
|
||||
@@ -69,6 +69,7 @@ func (p *Payouts) FindByPaymentID(ctx context.Context, paymentID string) (*model
|
||||
|
||||
func (p *Payouts) Upsert(ctx context.Context, record *model.CardPayout) error {
|
||||
if record == nil {
|
||||
p.logger.Warn("Invalid argument provided: nil record")
|
||||
return merrors.InvalidArgument("payout record is nil", "record")
|
||||
}
|
||||
|
||||
@@ -79,6 +80,7 @@ func (p *Payouts) Upsert(ctx context.Context, record *model.CardPayout) error {
|
||||
record.ProviderPaymentID = strings.TrimSpace(record.ProviderPaymentID)
|
||||
|
||||
if record.OperationRef == "" {
|
||||
p.logger.Warn("Invalid argument provided: operation reference missing")
|
||||
return merrors.InvalidArgument("operation ref is required", "operation_ref")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user