(ctx context.Context, b *ledgerforgeInstance, txn *model.Transaction, err error)
| 158 | } |
| 159 | |
| 160 | func handleTransactionRejection(ctx context.Context, b *ledgerforgeInstance, txn *model.Transaction, err error) error { |
| 161 | _, rejectErr := b.ledgerforge.RejectTransaction(ctx, txn, err.Error()) |
| 162 | if rejectErr != nil { |
| 163 | return rejectErr |
| 164 | } |
| 165 | |
| 166 | webhookErr := b.ledgerforge.SendWebhook(ledgerforge.NewWebhook{ |
| 167 | Event: "transaction.rejected", |
| 168 | Payload: *txn, |
| 169 | }) |
| 170 | return webhookErr |
| 171 | } |
| 172 | |
| 173 | func hasReachedMaxRetryAttempt(cfg *config.Configuration, retryCount int) bool { |
| 174 | if cfg == nil || cfg.Queue.MaxRetryAttempts <= 0 { |
no test coverage detected