Payment Form Models
The payment form model is a special model used to validate payment parameters and pass them on to a payment gateway in a way it expects.
When returning after a validation error, a
paymentForm variable will be available to the template and set to an instance of BasePaymentForm.
Each gateway can use its own payment form, however it must extend BasePaymentForm. There are generic models available for use, specifically for gateways passing around credit card information, but you should refer to the documentation of the plugin providing the gateway to see whether it uses its own model.
Generally, you shouldn’t be concerned with the specific type of payment form model being used, as it’s provided by the gateway and doesn’t need to be configured.
# Model Attributes
The following payment form model attributes exist for gateways handling credit card information:
| ||not validated||If a token is found on the payment form, no validation of other fields is performed and the data is ignored.|
| ||required||The first name on the customer’s credit card.|
| ||required||The last name of the customer’s credit card.|
| ||required, min: ||Integer representing the month of credit card expiry.|
| ||required, min: current year, max: current year + 12||Integer representing the year of credit card expiry.|
| ||minLength: 3, maxLength: 4||Integer found on the back of the card for security.|
| ||Luhn algorithm||The credit card number itself.|
| ||not validated||A flag indicating whether 3D Secure authentication is being performed for the transaction.|