Payment provider API: Add confirm_button_name

This commit is contained in:
Raphael Michel
2021-11-29 20:54:24 +01:00
parent 3117eceb72
commit 1f0f7b752f
3 changed files with 12 additions and 1 deletions

View File

@@ -62,6 +62,8 @@ The provider class
.. autoattribute:: public_name .. autoattribute:: public_name
.. autoattribute:: confirm_button_name
.. autoattribute:: is_enabled .. autoattribute:: is_enabled
.. autoattribute:: priority .. autoattribute:: priority

View File

@@ -191,6 +191,15 @@ class BasePaymentProvider:
""" """
return self.verbose_name return self.verbose_name
@property
def confirm_button_name(self) -> str:
"""
A label for the "confirm" button on the last page before a payment is started. This
is **not** used in the regular checkout flow, but only if the payment method is selected
for an existing order later on.
"""
return _("Pay now")
@property @property
def identifier(self) -> str: def identifier(self) -> str:
""" """

View File

@@ -42,7 +42,7 @@
</div> </div>
<div class="col-md-4 col-md-offset-4"> <div class="col-md-4 col-md-offset-4">
<button class="btn btn-block btn-primary btn-lg" type="submit"> <button class="btn btn-block btn-primary btn-lg" type="submit">
{% trans "Pay now" %} {{ payment_provider.confirm_button_name }}
</button> </button>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>