From 234f9d43c5d44dea4063923681b8837a4b3af8fc Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 24 Jan 2023 19:28:34 +0100 Subject: [PATCH] PPv2: Improve visibility of last step in paying orders (#3046) Co-authored-by: Martin Gross --- src/pretix/plugins/paypal2/payment.py | 10 ++++++-- .../paypal2/checkout_payment_confirm.html | 25 +++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/pretix/plugins/paypal2/payment.py b/src/pretix/plugins/paypal2/payment.py index c1351b8757..20e3254e07 100644 --- a/src/pretix/plugins/paypal2/payment.py +++ b/src/pretix/plugins/paypal2/payment.py @@ -31,7 +31,7 @@ from django.contrib import messages from django.http import HttpRequest from django.template.loader import get_template from django.templatetags.static import static -from django.urls import reverse +from django.urls import resolve, reverse from django.utils.crypto import get_random_string from django.utils.safestring import mark_safe from django.utils.timezone import now @@ -583,7 +583,13 @@ class PaypalMethod(BasePaymentProvider): on the 'confirm order' page. """ template = get_template('pretixplugins/paypal2/checkout_payment_confirm.html') - ctx = {'request': request, 'event': self.event, 'settings': self.settings, 'method': self.method} + ctx = { + 'request': request, + 'url': resolve(request.path_info), + 'event': self.event, + 'settings': self.settings, + 'method': self.method + } return template.render(ctx) def execute_payment(self, request: HttpRequest, payment: OrderPayment): diff --git a/src/pretix/plugins/paypal2/templates/pretixplugins/paypal2/checkout_payment_confirm.html b/src/pretix/plugins/paypal2/templates/pretixplugins/paypal2/checkout_payment_confirm.html index 418f881a9f..cc068c984e 100644 --- a/src/pretix/plugins/paypal2/templates/pretixplugins/paypal2/checkout_payment_confirm.html +++ b/src/pretix/plugins/paypal2/templates/pretixplugins/paypal2/checkout_payment_confirm.html @@ -1,14 +1,29 @@ {% load i18n %} -

- {% if method == "wallet" %} +{% if method == "wallet" %} + {% if url.url_name == "event.order.pay.confirm" %} +

+

+ {% trans "Almost done …" %} +

+

+ {% trans 'Please click on the "Pay now" button below to confirm your payment.' %} +

+

+ {% trans "We will then charge your PayPal account and finalize the order." %} +

+ {% else %} {% blocktrans trimmed %} The total amount listed above will be withdrawn from your PayPal account after the confirmation of your purchase. {% endblocktrans %} - {% else %} + {% endif %} +{% else %} +

{% blocktrans trimmed %} After placing your order, you will be able to select your desired payment method, including PayPal. {% endblocktrans %} - {% endif %} -

+

+{% endif %}