SilverStripe\Omnipay\GatewayFieldsFactory
Helper for generating gateway fields, based on best practices.
Synopsis
class GatewayFieldsFactory
{
- // members
- protected array $fieldgroups = ;
- protected $gateway;
- protected boolean $groupdatefields = true;
- protected array $renamemap = ;
- private static array $whitelist = ;
- // methods
- public void __construct()
- public $this setFieldGroups()
- public $this setGateway()
- public FieldList getFields()
- public FieldList getCardFields()
- public array getCardTypes()
- public FieldList getBillingFields()
- public FieldList getShippingFields()
- public FieldList getEmailFields()
- public FieldList getCompanyFields()
- protected void cullForGateway()
- public string|array getFieldName()
- public array getFieldNames()
- public array normalizeFormData()
- private bool|string getGlobalFieldName()
- private bool|string getGatewayFieldName()
- private void buildRenameMap()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
Members
private
- $whitelist — array
protected
- $fieldgroups
- $gateway
- $groupdatefields — boolean
- $renamemap — array
Methods
private
- buildRenameMap() — Builds the rename map which is used as a lookup table for normalizeFieldData()
- getGatewayFieldName() — Fetches custom name for a gateway field from the rename map, or returns false
- getGlobalFieldName() — Fetches custom name from the rename map, or returns false
protected
- cullForGateway() — Clear all fields that are not required by the gateway. Does nothing if gateway is null
public
- __construct() — GatewayFieldsFactory constructor.
- getBillingFields() — Get billing address fields
- getCardFields() — Get Credit-Card fields
- getCardTypes() — Get a list of supported credit-card brands.
- getCompanyFields() — Get company fields
- getEmailFields() — Get email fields.
- getFieldName() — Attempts to find a custom field name and/or prefix defined in rename.yml, otherwise returns the same input that it was given
- getFieldNames() — Batch support for getFieldName()
- getFields() — Get all the fields from the defined Field-Groups (via constructor or @see setFieldGroups)
- getShippingFields() — Get shipping address fields.
- normalizeFormData() — Normalizes form data keys to map to their respective Omnipay parameters (in other words: reverses the effects from the custom field name support)
- setFieldGroups() — The field groups to create.
- setGateway() — Set the gateway to create fields for.