rollbackBatchTransactions performs a rollback of transactions in a batch Returns the action performed (voided/refunded) and any error that occurred
(ctx context.Context, batchID string, isInflight bool)
| 2402 | // rollbackBatchTransactions performs a rollback of transactions in a batch |
| 2403 | // Returns the action performed (voided/refunded) and any error that occurred |
| 2404 | func (l *LedgerForge) rollbackBatchTransactions(ctx context.Context, batchID string, isInflight bool) (string, error) { |
| 2405 | var action string |
| 2406 | var rollbackErr error |
| 2407 | |
| 2408 | if isInflight { |
| 2409 | action, rollbackErr = l.voidInflightBatchTransactions(ctx, batchID) |
| 2410 | } else { |
| 2411 | action, rollbackErr = l.refundNonInflightBatchTransactions(ctx, batchID) |
| 2412 | } |
| 2413 | |
| 2414 | l.logRollbackResult(batchID, action, rollbackErr) |
| 2415 | return action, rollbackErr |
| 2416 | } |
| 2417 | |
| 2418 | // voidInflightBatchTransactions voids all inflight transactions in a batch |
| 2419 | func (l *LedgerForge) voidInflightBatchTransactions(ctx context.Context, batchID string) (string, error) { |
no test coverage detected