forked from CGM_Public/pretix_original
Correct documentation for payment forms (#1209)
This commit is contained in:
committed by
Raphael Michel
parent
27990b3fbb
commit
8cfc8bc152
@@ -311,7 +311,7 @@ class BasePaymentProvider:
|
|||||||
@property
|
@property
|
||||||
def payment_form_fields(self) -> dict:
|
def payment_form_fields(self) -> dict:
|
||||||
"""
|
"""
|
||||||
This is used by the default implementation of :py:meth:`checkout_form`.
|
This is used by the default implementation of :py:meth:`payment_form`.
|
||||||
It should return an object similar to :py:attr:`settings_form_fields`.
|
It should return an object similar to :py:attr:`settings_form_fields`.
|
||||||
|
|
||||||
The default implementation returns an empty dictionary.
|
The default implementation returns an empty dictionary.
|
||||||
@@ -320,10 +320,10 @@ class BasePaymentProvider:
|
|||||||
|
|
||||||
def payment_form(self, request: HttpRequest) -> Form:
|
def payment_form(self, request: HttpRequest) -> Form:
|
||||||
"""
|
"""
|
||||||
This is called by the default implementation of :py:meth:`checkout_form_render`
|
This is called by the default implementation of :py:meth:`payment_form_render`
|
||||||
to obtain the form that is displayed to the user during the checkout
|
to obtain the form that is displayed to the user during the checkout
|
||||||
process. The default implementation constructs the form using
|
process. The default implementation constructs the form using
|
||||||
:py:attr:`checkout_form_fields` and sets appropriate prefixes for the form
|
:py:attr:`payment_form_fields` and sets appropriate prefixes for the form
|
||||||
and all fields and fills the form with data form the user's session.
|
and all fields and fills the form with data form the user's session.
|
||||||
|
|
||||||
If you overwrite this, we strongly suggest that you inherit from
|
If you overwrite this, we strongly suggest that you inherit from
|
||||||
@@ -437,7 +437,7 @@ class BasePaymentProvider:
|
|||||||
When the user selects this provider as their preferred payment method,
|
When the user selects this provider as their preferred payment method,
|
||||||
they will be shown the HTML you return from this method.
|
they will be shown the HTML you return from this method.
|
||||||
|
|
||||||
The default implementation will call :py:meth:`checkout_form`
|
The default implementation will call :py:meth:`payment_form`
|
||||||
and render the returned form. If your payment method doesn't require
|
and render the returned form. If your payment method doesn't require
|
||||||
the user to fill out form fields, you should just return a paragraph
|
the user to fill out form fields, you should just return a paragraph
|
||||||
of explanatory text.
|
of explanatory text.
|
||||||
|
|||||||
Reference in New Issue
Block a user