forked from CGM_Public/pretix_original
Add BasePaymentProvider.refund_matching_id
This commit is contained in:
@@ -132,6 +132,8 @@ The provider class
|
|||||||
|
|
||||||
.. automethod:: matching_id
|
.. automethod:: matching_id
|
||||||
|
|
||||||
|
.. automethod:: refund_matching_id
|
||||||
|
|
||||||
.. automethod:: shred_payment_info
|
.. automethod:: shred_payment_info
|
||||||
|
|
||||||
.. automethod:: cancel_payment
|
.. automethod:: cancel_payment
|
||||||
|
|||||||
@@ -957,6 +957,16 @@ class BasePaymentProvider:
|
|||||||
"""
|
"""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def refund_matching_id(self, refund: OrderRefund):
|
||||||
|
"""
|
||||||
|
Will be called to get an ID for matching this refund when comparing pretix records with records of an external
|
||||||
|
source. This should return the main transaction ID for your API.
|
||||||
|
|
||||||
|
:param refund: The refund in question.
|
||||||
|
:return: A string or None
|
||||||
|
"""
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class PaymentException(Exception):
|
class PaymentException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -557,6 +557,9 @@ class StripeMethod(BasePaymentProvider):
|
|||||||
def matching_id(self, payment: OrderPayment):
|
def matching_id(self, payment: OrderPayment):
|
||||||
return payment.info_data.get("id", None)
|
return payment.info_data.get("id", None)
|
||||||
|
|
||||||
|
def refund_matching_id(self, refund: OrderRefund):
|
||||||
|
return refund.info_data.get('id', None)
|
||||||
|
|
||||||
def api_payment_details(self, payment: OrderPayment):
|
def api_payment_details(self, payment: OrderPayment):
|
||||||
return {
|
return {
|
||||||
"id": payment.info_data.get("id", None),
|
"id": payment.info_data.get("id", None),
|
||||||
|
|||||||
Reference in New Issue
Block a user