mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +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:
@@ -36,6 +36,18 @@ class Paypal(BasePaymentProvider):
|
||||
super().__init__(event)
|
||||
self.settings = SettingsSandbox('payment', 'paypal', event)
|
||||
|
||||
@property
|
||||
def test_mode_message(self):
|
||||
if self.settings.connect_client_id and not self.settings.secret:
|
||||
# in OAuth mode, sandbox mode needs to be set global
|
||||
is_sandbox = self.settings.connect_endpoint == 'sandbox'
|
||||
else:
|
||||
is_sandbox = self.settings.get('endpoint') == 'sandbox'
|
||||
if is_sandbox:
|
||||
return _('The PayPal sandbox is being used, you can test without actually sending money but you will need a '
|
||||
'PayPal sandbox user to log in.')
|
||||
return None
|
||||
|
||||
@property
|
||||
def settings_form_fields(self):
|
||||
if self.settings.connect_client_id and not self.settings.secret:
|
||||
|
||||
Reference in New Issue
Block a user