Add refund details to API

This commit is contained in:
Raphael Michel
2022-11-15 18:10:19 +01:00
parent 3d82058269
commit 62a6a11836
3 changed files with 28 additions and 1 deletions

View File

@@ -877,6 +877,15 @@ class BasePaymentProvider:
"""
return {}
def api_refund_details(self, refund: OrderRefund):
"""
Will be called to populate the ``details`` parameter of the refund in the REST API.
:param refund: The refund in question.
:return: A serializable dictionary
"""
return {}
def matching_id(self, payment: OrderPayment):
"""
Will be called to get an ID for matching this payment when comparing pretix records with records of an external
@@ -959,6 +968,9 @@ class BoxOfficeProvider(BasePaymentProvider):
"payment_data": payment.info_data.get('payment_data', {}),
}
def api_refund_details(self, refund: OrderRefund):
return self.api_payment_details(refund)
def payment_control_render(self, request, payment) -> str:
if not payment.info:
return
@@ -1191,6 +1203,9 @@ class GiftCardPayment(BasePaymentProvider):
}
}
def api_refund_details(self, refund: OrderRefund):
return self.api_payment_details(refund)
def payment_partial_refund_supported(self, payment: OrderPayment) -> bool:
return True