Skip to content

Commit

Permalink
fix Stripe payment page for minimum donations
Browse files Browse the repository at this point in the history
fixes LIBERAPAYCOM-27B
  • Loading branch information
Changaco committed Nov 2, 2024
1 parent e769505 commit 9c20fa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions liberapay/payin/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ def resolve_amounts(
Returns a copy of `base_amounts` with updated values.
"""
if available_amount < (minimum_amount or 0):
raise ValueError("available_amount can't be less than minimum_amount or 0")

Check warning on line 562 in liberapay/payin/common.py

View check run for this annotation

Codecov / codecov/patch

liberapay/payin/common.py#L562

Added line #L562 was not covered by tests

currency = available_amount.currency
zero = Money.ZEROS[currency]
inf = Money('inf', currency)
Expand Down
2 changes: 1 addition & 1 deletion www/%username/giving/pay/stripe/%payin_id.spt
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ if tippees:
if len(tips) == 1:
proto_transfers = resolve_tip(
website.db, tips[0], tips[0].tippee_p, 'stripe', payer, payer.guessed_country,
tips[0].periodic_amount
tips[0].amount * 52
)
if len(proto_transfers) == 1:
if proto_transfers[0].destination.country not in constants.SEPA:
Expand Down

0 comments on commit 9c20fa2

Please sign in to comment.