diff --git a/src/pretix/plugins/paypal2/views.py b/src/pretix/plugins/paypal2/views.py index 3bc450942c..26bad8b091 100644 --- a/src/pretix/plugins/paypal2/views.py +++ b/src/pretix/plugins/paypal2/views.py @@ -149,19 +149,27 @@ class XHRView(View): else: cart_total = get_cart_total(request) cart_payments = cart_session(request).get('payments', []) - for fee in get_fees(request.event, request, cart_total, None, cart_payments, get_cart(request)): + multi_use_cart_payments = [p for p in cart_payments if p.get('multi_use_supported')] + simulated_payments = multi_use_cart_payments + [{ + 'provider': 'paypal', + 'multi_use_supported': False, + 'min_value': None, + 'max_value': None, + 'info_data': {}, + }] + + for fee in get_fees(request.event, request, cart_total, None, simulated_payments, get_cart(request)): cart_total += fee.value total_remaining = cart_total - for p in cart_session(request).get('payments', []): - if p['provider'] != 'paypal': - if p.get('min_value') and total_remaining < Decimal(p['min_value']): - continue + for p in multi_use_cart_payments: + if p.get('min_value') and total_remaining < Decimal(p['min_value']): + continue - to_pay = total_remaining - if p.get('max_value') and to_pay > Decimal(p['max_value']): - to_pay = min(to_pay, Decimal(p['max_value'])) - total_remaining -= to_pay + to_pay = total_remaining + if p.get('max_value') and to_pay > Decimal(p['max_value']): + to_pay = min(to_pay, Decimal(p['max_value'])) + total_remaining -= to_pay cart_total = total_remaining