mirror of
https://github.com/pretix/pretix.git
synced 2026-08-27 13:24:41 +00:00
Add a simple test mode (#1181)
- [x] Provide data model and configuration toggle - [x] Allow to delete individual test orders - [x] Add tests - [x] Add a prominent warning message to the backend if test mode orders exist (even though test mode is off), as this leads to wrong statistics - [x] Decide if and how to generate invoices for test orders as invoice numbers cannot be repeated or should not have gaps. - [x] Decide if and how we expose test orders through the API, since our difference pull mechanism relies on the fact that orders cannot be deleted. - [x] Decide if and how we want to couple test modes of payment providers? - [ ] pretix.eu: Ignore test orders for billing - [ ] Adjust payment providers: Mollie, bitpay, cash, fakepayment, sepadebit 
This commit is contained in:
@@ -88,6 +88,18 @@ class BasePaymentProvider:
|
||||
"""
|
||||
return self.settings.get('_enabled', as_type=bool)
|
||||
|
||||
@property
|
||||
def test_mode_message(self) -> str:
|
||||
"""
|
||||
If this property is set to a string, this will be displayed when this payment provider is selected
|
||||
while the event is in test mode. You should use it to explain to your user how your plugin behaves,
|
||||
e.g. if it falls back to a test mode automatically as well or if actual payments will be performed.
|
||||
|
||||
If you do not set this (or, return ``None``), pretix will show a default message warning the user
|
||||
that this plugin does not support test mode payments.
|
||||
"""
|
||||
return None
|
||||
|
||||
def calculate_fee(self, price: Decimal) -> Decimal:
|
||||
"""
|
||||
Calculate the fee for this payment provider which will be added to
|
||||
@@ -713,6 +725,11 @@ class ManualPayment(BasePaymentProvider):
|
||||
identifier = 'manual'
|
||||
verbose_name = _('Manual payment')
|
||||
|
||||
@property
|
||||
def test_mode_message(self):
|
||||
return _('In test mode, you can just manually mark this order as paid in the backend after it has been '
|
||||
'created.')
|
||||
|
||||
@property
|
||||
def is_implicit(self):
|
||||
return 'pretix.plugins.manualpayment' not in self.event.plugins
|
||||
|
||||
Reference in New Issue
Block a user