\BraintreeHostedFieldsCheckoutComponent
This replaces the default OnsitePaymentCheckoutComponent and uses braintree's javascript and hosted fields, returning only a nonce to the server.
This requires more thought and work to get going but allows more flexibility and styling and behaviour.
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class BraintreeHostedFieldsCheckoutComponent
extends BraintreePaymentCheckoutComponent
{
- // members
- private static bool $use_placeholders = true;
- private static array $field_styles = ;
- protected $fieldStyles;
- // Inherited members from BraintreePaymentCheckoutComponent
- protected $jsCallbacks;
- protected bool $isBraintree;
- protected Gateway $gateway;
- // methods
- public array getFieldStyles()
- public $this setFieldStyles()
- public FieldList getFormFields()
- private string getFieldConfig()
- // Inherited methods from BraintreePaymentCheckoutComponent
- protected Gateway getGateway()
- public $this setGateway()
- public FieldList getFormFields()
- protected string injectCallbacks()
- public array getRequiredFields()
- public boolean validateData()
- public array getData()
- public Order setData()
- public array getJsCallbacks()
- public $this setJsCallbacks()
Hierarchy
Members
private
- $field_styles — array
- $use_placeholders — bool
protected
- $fieldStyles — array
- $gateway — \Omnipay\Common\AbstractGateway|\Omnipay\Braintree\Gateway
- $isBraintree — bool
- $jsCallbacks — array
Methods
private
- getFieldConfig() — Converts the braintree fields in this fieldlist into configuration format
public
- getFieldStyles() — This controls the field styling. It's basically CSS converted to php arrays or yml.
- getFormFields() — Get form fields for manipulating the current order, according to the responsibilty of this component.
- setFieldStyles()
Inherited from BraintreePaymentCheckoutComponent
protected
- getGateway()
- injectCallbacks() — Takes the basic json config and manually adds any callbacks requested.
public
- getData() — Get required data out of the model.
- getFormFields() — Get form fields for manipulating the current order, according to the responsibility of this component.
- getJsCallbacks() — This controls the field styling. It's basically CSS converted to php arrays or yml.
- getRequiredFields() — Get the data fields that are required for the component.
- setData() — Set the model data for this component.
- setGateway()
- setJsCallbacks() — This completely overrides anything set in the config. It does not merge the keys at all.
- validateData() — Is this data valid for saving into an order?