Show a configurable message to customers when Affirm is selected in checkout

Created on 18 July 2025, 7 days ago

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

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rszrama
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    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.

  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    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.

  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    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...
Production build 0.71.5 2024