mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
* Auto-refund * Add missing template * Notification for requested refund * Model-level tests * Add front-end tests * Default to notify
60 lines
1.6 KiB
Python
60 lines
1.6 KiB
Python
import logging
|
|
|
|
from django.http import HttpRequest
|
|
|
|
from pretix.base.models import OrderPayment, OrderRefund
|
|
from pretix.base.payment import BasePaymentProvider
|
|
|
|
logger = logging.getLogger('tests.testdummy.ticketoutput')
|
|
|
|
|
|
class DummyPaymentProvider(BasePaymentProvider):
|
|
identifier = 'testdummy'
|
|
verbose_name = 'Test dummy'
|
|
abort_pending_allowed = False
|
|
|
|
def payment_is_valid_session(self, request: HttpRequest) -> bool:
|
|
pass
|
|
|
|
def checkout_confirm_render(self, request) -> str:
|
|
pass
|
|
|
|
|
|
class DummyFullRefundablePaymentProvider(BasePaymentProvider):
|
|
identifier = 'testdummy_fullrefund'
|
|
verbose_name = 'Test dummy'
|
|
abort_pending_allowed = False
|
|
|
|
def execute_refund(self, refund: OrderRefund):
|
|
refund.done()
|
|
|
|
def payment_is_valid_session(self, request: HttpRequest) -> bool:
|
|
pass
|
|
|
|
def checkout_confirm_render(self, request) -> str:
|
|
pass
|
|
|
|
def payment_refund_supported(self, payment: OrderPayment) -> bool:
|
|
return True
|
|
|
|
|
|
class DummyPartialRefundablePaymentProvider(BasePaymentProvider):
|
|
identifier = 'testdummy_partialrefund'
|
|
verbose_name = 'Test dummy'
|
|
abort_pending_allowed = False
|
|
|
|
def execute_refund(self, refund: OrderRefund):
|
|
refund.done()
|
|
|
|
def payment_is_valid_session(self, request: HttpRequest) -> bool:
|
|
pass
|
|
|
|
def checkout_confirm_render(self, request) -> str:
|
|
pass
|
|
|
|
def payment_refund_supported(self, payment: OrderPayment) -> bool:
|
|
return True
|
|
|
|
def payment_partial_refund_supported(self, payment: OrderPayment) -> bool:
|
|
return True
|