\BraintreePaymentCheckoutComponent
This replaces the default OnsitePaymentCheckoutComponent and uses braintree's dropin UI, returning only a nonce to the server.
NOTE: This handles ALL javascript setup so you don't need to do anything. By default it
will replace OnsitePaymentCheckoutComponent via the injector in either single page or
multi-step checkout.
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class BraintreePaymentCheckoutComponent
extends OnsitePaymentCheckoutComponent
{
- // members
- private static array $callbacks = ;
- protected $jsCallbacks;
- protected bool $isBraintree;
- protected Gateway $gateway;
- // methods
- 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
Extends
- OnsitePaymentCheckoutComponent
Members
private
- $callbacks — array
protected
- $gateway — \Omnipay\Common\AbstractGateway|\Omnipay\Braintree\Gateway
- $isBraintree — bool
- $jsCallbacks — array
Methods
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?