Adobe Commerce FAQ

Get answers to common questions about your Adobe Commerce integration with Affirm.

How does the Chrome SameSite cookie policy impact my Adobe Commerce integration?

With the recent release of Google Chrome's SameSite cookie policy, the newest version of Chrome updated how it handles cookies. As a result, we’ve seen an increase in loan authorization failures for Adobe Commerce merchants integrated with Affirm. See our guide for more information on this issue and how to resolve it.


How do I modify the monthly payment messaging placement on the product detail or cart page?

To place monthly payment messaging on the product detail:

  1. From the Adobe Commerce admin page, go to Stores > Configuration > General > Affirm Promos.
  2. In the As Low As Additional Developer Settings section, set PDP Placement options for As low as to one of these options:
  • After Price (selected by default)
  • Before Price
  • End of Product Info
2266

This integration uses the Affirm/Block/Promotion/ProductPage/Aslowas block and the Affirm/view/frontend/templates/promotion/aslowasPDP.phtml template.

To include this block in a specific location on the product or cart page, you will need to select the appropriate handle (the default product page in Adobe Commerce is catalog_product_view.xml) and parent block or container, which will render the as low as block (using <referenceBlock name="parent_block_name"> structure or <referenceContainer name="test_content">), where parent_block_name - name parent block in the layout.


What should I do if I see an "Invalid header line detected" error message when placing an order with Affirm?

This error is caused by an upgrade to our load balancers from AWS Classic ELB to AWS Application Load Balancer and the new ALB supports both HTTP/1.1 and HTTP/2. As a result, clients that support HTTP/2 will auto upgrade. It is likely that cURL also auto upgrades to HTTP/2, transparently i.e., it sends HTTP/2 request with a HTTP/2 response, on the wire.

We use Adobe Commerce's core Zend Framework library for cURL request and it does not support HTTP/2. We have plans to switch to another library or Adobe Commerce's cURL in the future. In the meantime, you can follow the instructions below to apply a patch to add HTTP/2 support to ZF1 library.

// Modify the following file path around line 185:
File path : <magento root>/vendor/magento/zendframework1/library/Zend/Http/Response.php 
// From:
        if (! preg_match('|^\d\.\d$|', $version)) {
// To:
        if (! preg_match('|^\d\.\d$|', $version) && ($version != 2)) { // Hot fix by Affirm
 
// Modify the following file path around line 517:
File path : <magento root>/vendor/magento/zendframework1/library/Zend/Http/Response.php

// From:
        if ($index === 0 && preg_match('#^HTTP/\d+(?:\.\d+) [1-5]\d+#', $line)) {
            // Status line; ignore
            continue;
        }
// To:
        if ($index === 0 && preg_match('#^HTTP/\d+(?:\.\d+) [1-5]\d+#', $line)) {
            // Status line; ignore
            continue;
        }
        // Hot fix by Affirm
        if ($index === 0 && preg_match('#^HTTP/2 200#', $line)) {
            // Status line; ignore
            continue;
        }

How do I get Affirm checkout to work with Magento 2.2 or lower?

You can use release 2.1.5 for Magento 2.2 and lower.

Use the command below for the Composer installation:

composer require affirm/magento2:2.1.5
composer update
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Does Affirm support multishipping checkout?

No, Affirm does not support multishipping checkout as we use the customer's shipping and billing addresses in our underwriting process to validate fraud.

Apply Gzip Patch

Create a gzip.patch in Magento Root Directory with the following code

diff --git a/vendor/affirm/magento2/Gateway/Http/Client/ClientService.php b/Gateway/Http/Client/ClientService.php
index 415efcc..2242dcd 100644
--- a/vendor/affirm/magento2/Gateway/Http/Client/ClientService.php
+++ b/vendor/affirm/magento2/Gateway/Http/Client/ClientService.php
@@ -135,7 +135,7 @@ class ClientService implements ClientInterface
                 $client->setRawData($data, 'application/json');
             }
             $response = $client->request($transferObject->getMethod());
-            $rawResponse = $response->getRawBody();
+            $rawResponse = $response->getBody();
             $response = $this->converter->convert($rawResponse);
         } catch (\Exception $e) {
             $log['error'] = $e->getMessage();

In the command-line interface, run the following commands according to the patch extension:

patch < gzip.patch

If prompted to enter File to patch enter

vendor/affirm/magento2/Gateway/Http/Client/ClientService.php