Payment providers: Add priority flag

This commit is contained in:
Raphael Michel
2019-11-15 09:29:38 +01:00
parent ac2ff6c2aa
commit 00798d9207
3 changed files with 14 additions and 1 deletions
+9
View File
@@ -83,6 +83,14 @@ class BasePaymentProvider:
"""
return False
@property
def priority(self) -> int:
"""
Returns a priority that is used for sorting payment providers. Higher priority means higher up in the list.
Default to 100. Providers with same priority are sorted alphabetically.
"""
return 100
@property
def is_enabled(self) -> bool:
"""
@@ -925,6 +933,7 @@ class OffsettingProvider(BasePaymentProvider):
class GiftCardPayment(BasePaymentProvider):
identifier = "giftcard"
verbose_name = _("Gift card")
priority = 10
@property
def settings_form_fields(self):