Customizations

Last updated on
2 October 2018

Additional properties in the html markup

The properties in the Affirm monthly payment messaging widget html markup are described here. To add other properties to the markup thetheme/commerce-affirm-monthly-payment-message.html.twig template file needs to be overridden in the standard drupal way. To pass additional variables to the template file, a preprocess hook needs to be implemented.

Altering the checkout js object

The Affirm js checkout object contains the order data sent to Affirm. To alter it, subscribe to the AffirmEvents::AFFIRM_TRANSACTION_DATA_PRESEND event and call $event->setData($data) in the subscriber (where $data is a php array corresponding to the js checkout object).  This can be useful when you have your own logic to determine e.g. billing or shipping addresses.

Help improve this page

Page status: No known problems

You can: