Skip to content

Commit

Permalink
fix(payment): fixed waiting for the invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordel committed Oct 4, 2023
1 parent 5d9bb73 commit 0b10de5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/payment/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,13 @@ export class PaymentService {
`Invoice has been rejected for provider ${agreement.provider.name}. Reason: ${reason.message}`,
);
}
this.agreementsDebitNotes.delete(invoice.agreementId);
this.agreementsToPay.delete(invoice.agreementId);
} catch (error) {
this.logger?.error(`Invoice failed from provider ${invoice.providerId}. ${error}`);
} finally {
// Until we implement a re-acceptance mechanism for unsuccessful acceptances,
// we no longer have to wait for the invoice during an unsuccessful attempt.
this.agreementsDebitNotes.delete(invoice.agreementId);
this.agreementsToPay.delete(invoice.agreementId);
}
}

Expand Down

0 comments on commit 0b10de5

Please sign in to comment.