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).

Comments

rszrama created an issue. See original summary.

rszrama’s picture

In fact, instead of using a simple textarea, let's make this a text_format to permit the use of WYSIWYG in the message preparation if desired.

rszrama’s picture

Status: Active » Needs review
StatusFileSize
new142.94 KB
new142.14 KB
new4.16 KB

I'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.

rszrama’s picture

Status: Needs review » Fixed

Reviewed by jsacksick, committing. Will also open relevant Commerce Core issues.

  • rszrama committed ee262325 on 2.x
    Issue #3536819 by rszrama: Show a configurable message to customers when...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.