Add "is_implicit" attribute to payment providers

This commit is contained in:
Raphael Michel
2018-02-04 23:14:18 +01:00
parent 4ccf33af03
commit da32621c55
2 changed files with 21 additions and 3 deletions

View File

@@ -50,6 +50,16 @@ class BasePaymentProvider:
def __str__(self):
return self.identifier
@property
def is_implicit(self) -> bool:
"""
Returns whether or whether not this payment provider is an "implicit" payment provider that will
*always* and unconditionally be used if is_allowed() returns True and does not require any input.
This is intended to be used by the FreePaymentProvider, which skips the payment choice page.
By default, this returns ``False``. Please do not set this if you don't know exactly what you are doing.
"""
return False
@property
def is_meta(self) -> bool:
"""
@@ -552,6 +562,10 @@ class PaymentException(Exception):
class FreeOrderProvider(BasePaymentProvider):
@property
def is_implicit(self) -> bool:
return True
@property
def is_enabled(self) -> bool:
return True