In certain cases, Affirm may ask merchants to show a configurable message when Affirm is selected as the payment method during checkout. For example, products that don't ship immediately may still require payment upon checkout completion, such as customized products with lead time for manufacturing.
We cannot rely on the payment method add form to appear in the payment checkout pane, because the Redirect class does not implement the SupportsCreatingPaymentMethodsInterface as an offsite payment gateway plugin.
We will instead need a new "Checkout instructions" setting on the payment gateway configuration form that is rendered into the checkout form via a form alter into a similarly marked up div on the checkout page (so it can capture the styling typically used for the payment method add form).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3536819-3.affirm_checkout_instructions.patch | 4.16 KB | rszrama |
Comments
Comment #2
rszrama commentedIn fact, instead of using a simple
textarea, let's make this atext_formatto permit the use of WYSIWYG in the message preparation if desired.Comment #3
rszrama commentedI've implemented this as described and included a container div in the checkout form to make it easier for specific targeting, as the payment method add form doesn't actually wrap everything in its own container.
Settings form:
Front-end instructions:
The only oddity in the current approach is that we don't have weights on elements of this form, so it's hard to position things appropriately. I'll ask jsacksick re: revising the checkout pane in core to at least ship some default weights.
Comment #4
rszrama commentedReviewed by jsacksick, committing. Will also open relevant Commerce Core issues.