Download the PHP package dvsa/mot-cpms-forms without Composer
On this page you can find all versions of the php package dvsa/mot-cpms-forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dvsa/mot-cpms-forms
More information about dvsa/mot-cpms-forms
Files in dvsa/mot-cpms-forms
Package mot-cpms-forms
Short Description Module that provides re-usable HTML Forms that can be used by scheme to process payments.
License proprietary
Informations about the package mot-cpms-forms
CPMS Forms
Introduction
A module to provide re-usable HTML Forms that can be used by scheme to process payments.
Installation
Main Setup
With composer
The recommended way to install is through Composer.
Post installation
-
Enable it in your application.config.php file.
- Copy configuration file to your autoload config folder (optional)
Usage
For payment form generation please use controller plugin:
The plugin takes one argument, which must be an object that implements one of the following interfaces:
- CpmsForms\Payment\CardPaymentInterface
- CpmsForms\Payment\StoredCardPaymentInterface
- CpmsForms\Payment\DirectDebitPaymentInterface
- CpmsForms\Payment\CashPaymentInterface
- CpmsForms\Payment\ChequePaymentInterface
- CpmsForms\Payment\ChipPinPaymentInterface
- CpmsForms\Payment\PostalOrderPaymentInterface
As it might be obvious, payment interface determines required data, that needs to be provided by scheme and tells Form Factory Service to build specific for that interface form.
Each payment type always requires common information (amount, user id, etc.), so it's convenient to use CpmsForms\Payment\BasePaymentTrait
trait in your payment classes.
The cpms-forms plugin validates post data and redirects to cpms-forms controller for processing. In regard to redirection, the proper usage should be:
The form should be passed to ViewModel and be rendered via view cpms-forms helper plugin:
Configuration
View scripts
If custom view script is needed to render payment form, please add this in your configuration file:
It's also possible to provide view script for specific payment type:
Form customization
Custom form class can be provided for specific payment type. This class must extends CpmsForms\Form\PaymentForm
class to be considered as a valid.
See example:
Form elements can be also customized. The following example sets html class of mandate_collection_day
element and adds e-mail field:
For more options, payment types and form elements please see config/module.config.php
Contributing
Please refer to our Contribution Guide.
TO DO
- Check if client is authorized to use a payment type
- Implement event manager for pre and post payment actions
- Integrate CPMS Miscellaneous Payments Module
All versions of mot-cpms-forms with dependencies
dvsa/mot-cpms-client Version ^3.1.0
laminas/laminas-session Version ^2.11
laminas/laminas-http Version ^2.14
laminas/laminas-mvc Version ^3.3.0
laminas/laminas-inputfilter Version ^2.13
laminas/laminas-validator Version ^2.14
laminas/laminas-json Version ^3.3
laminas/laminas-router Version ^3.4
laminas/laminas-math Version ^3.3
laminas/laminas-hydrator Version ^4.2
laminas/laminas-dependency-plugin Version ^2.6.0
laminas/laminas-i18n Version ^2.9
laminas/laminas-cache-storage-adapter-apcu Version ^2.0