mirror of
https://github.com/pretix/pretix.git
synced 2026-08-21 12:36:26 +00:00
Add BasePaymentProvider.payment_control_render_short and use it on refund page
This commit is contained in:
@@ -282,6 +282,19 @@ class BankTransfer(BasePaymentProvider):
|
||||
def payment_partial_refund_supported(self, payment: OrderPayment) -> bool:
|
||||
return self.payment_refund_supported(payment)
|
||||
|
||||
def payment_control_render_short(self, payment: OrderPayment) -> str:
|
||||
pi = payment.info_data or {}
|
||||
r = pi.get('payer', '')
|
||||
if pi.get('iban'):
|
||||
if r:
|
||||
r += ' / '
|
||||
r += pi.get('iban')
|
||||
if pi.get('bic'):
|
||||
if r:
|
||||
r += ' / '
|
||||
r += pi.get('bic')
|
||||
return r
|
||||
|
||||
def payment_presale_render(self, payment: OrderPayment) -> str:
|
||||
pi = payment.info_data or {}
|
||||
if self.payment_refund_supported(payment):
|
||||
|
||||
@@ -477,6 +477,9 @@ class Paypal(BasePaymentProvider):
|
||||
'payment_info': payment.info_data, 'order': payment.order, 'sale_id': sale_id}
|
||||
return template.render(ctx)
|
||||
|
||||
def payment_control_render_short(self, payment: OrderPayment) -> str:
|
||||
return payment.info_data.get('payer', {}).get('payer_info', {}).get('email', '')
|
||||
|
||||
def payment_partial_refund_supported(self, payment: OrderPayment):
|
||||
# Paypal refunds are possible for 180 days after purchase:
|
||||
# https://www.paypal.com/lc/smarthelp/article/how-do-i-issue-a-refund-faq780#:~:text=Refund%20after%20180%20days%20of,PayPal%20balance%20of%20the%20recipient.
|
||||
|
||||
Reference in New Issue
Block a user