diff --git a/liberapay/payin/common.py b/liberapay/payin/common.py index 1eb35d88d..f727f26ac 100644 --- a/liberapay/payin/common.py +++ b/liberapay/payin/common.py @@ -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") + currency = available_amount.currency zero = Money.ZEROS[currency] inf = Money('inf', currency) diff --git a/www/%username/giving/pay/stripe/%payin_id.spt b/www/%username/giving/pay/stripe/%payin_id.spt index 9ed8d036c..59097965c 100644 --- a/www/%username/giving/pay/stripe/%payin_id.spt +++ b/www/%username/giving/pay/stripe/%payin_id.spt @@ -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: