Skip to content

Commit

Permalink
Merge pull request #2128 from guardian/product-move-zero-amount
Browse files Browse the repository at this point in the history
Don't try to adjust an invoice which already has a balance of zero
  • Loading branch information
rupertbates authored Dec 11, 2023
2 parents d0c3e65 + 66c66ca commit 96e9bb6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ object RecurringContributionToSupporterPlus {
charge of 50 cents. Instead we write-off the invoices in the `adjustNonCollectedInvoices` function.
*/
paidAmount <-
// not clear why we would want to create a negative payment, but this logic was already in place
if (invoiceBalance < 0 || invoiceBalance >= 0.5) {
if (invoiceBalance == 0) {
ZIO.succeed(BigDecimal(0))
} else if (invoiceBalance < 0 || invoiceBalance >= 0.5) {
// not clear why we would want to create a negative payment, but this logic was already in place
import account._
CreatePayment
.create(
Expand Down

0 comments on commit 96e9bb6

Please sign in to comment.