Forms

class polaris.integrations.TransactionForm[source]

Base class for collecting transaction information.

Developers must define subclasses to collect additional information and apply additional validation.

A subclass of this form should be returned by form_for_transaction() once for each interactive flow.

If the default UI is used, Polaris makes calls to the anchor’s /fee endpoint and displays the response value to the user. If your /fee endpoint requires a type parameter, add a TransactionForm.type attribute to the form. Polaris will detect the attribute’s presence on the form and include it in /fee requests.

The amount field is validated with the clean_amount() function, which ensures the amount is within the bounds for the asset type.

class polaris.integrations.CreditCardForm[source]

A generic form for collecting credit or debit card information.

Ensures card_number is valid, but does not validate the expiration or cvv. Subclass this form for additional validation.