Address 'setup_future_usage' issue for Klarna in Commerce Stripe module

Created on 2 August 2024, 5 months ago
Updated 13 August 2024, 4 months ago

Problem/Motivation

We recently activated the Klarna payment method on our Stripe account for use with Drupal Commerce. However, unlike other payment methods like Google Pay and Apple Pay, Klarna is not appearing as an available option on our website. We expected that it would automatically be visible in the payment options once activated in the Stripe Dashboard, as there are no additional configurations needed in the Drupal integration module.

Upon contacting Stripe support, we discovered that the issue arises due to the use of the "setup_future_usage" parameter in the payment initialization code. This parameter is not supported by Klarna, according to Stripe's and Klarna's documentation, which prevents Klarna from being correctly displayed.

Steps to reproduce

  1. Set up a Drupal Commerce site with the Commerce Stripe module installed and configured.
  2. Activate Klarna as a payment method in the Stripe Dashboard.
  3. Attempt to process a payment and observe that Klarna is not available as a payment option.

Environment Details:

  • Drupal Commerce version: ^9.3 || ^10
  • Stripe API version: 2024-06-20

Expected Result: Klarna should be available as a payment option.
Actual Result: Klarna does not appear as a payment option.

Proposed resolution

To resolve this issue, the code for initializing payment requests should be reviewed and modified to ensure compatibility with Klarna. Specifically, the "setup_future_usage" parameter should be removed or conditionally handled when Klarna is the selected payment method. The detailed changes necessary for this adjustment should be clearly documented for temporary workarounds. We suggest implementing a conditional check in the payment processing logic to exclude this parameter specifically for Klarna transactions.

The resolution remains open to further analysis, and community input is welcome to find the best possible solution.
Temporary manual code modifications should include exact details of the changes required.

Remaining tasks

  • Develop and test a patch that conditionally removes the "setup_future_usage" parameter for Klarna.
  • Review the patch or update for the "Commerce Stripe" module for correctness and potential impacts on other payment methods.
  • Update the module's documentation to include instructions on enabling Klarna without the conflicting parameter. and to reflect changes and new requirements

User interface changes

No user interface changes are expected. The modification will be backend and configuration-based, ensuring Klarna appears as a payment option without UI alterations.

API changes

This issue may involve changes in the API request structure for payment intents, specifically when Klarna is selected as the payment method. Developers should ensure that the API requests conform to Klarna's requirements by excluding unsupported parameters.

Data model changes

No changes to the data model are anticipated, as the issue pertains to the handling of API request parameters rather than database schema.

Release notes snippet

"Resolved an issue where Klarna was not available as a payment option due to the use of the unsupported 'setup_future_usage' parameter. The module now conditionally handles this parameter based on the selected payment method."

Original report by AleDDR & Stripe support

[AleDDR]
The original report highlighted the issue where Klarna was not appearing as a payment option on a Drupal Commerce site, despite being enabled in the Stripe Dashboard. The issue was traced back to the inclusion of an unsupported "setup_future_usage" parameter in the payment request initialization, as per Stripe support.

[Stripe support]
I have looked at how your third-party Drupal plugin handles the payment initiation code, specifically the req_S2fTHEteSfGSyQ and req_lheORIl2LGZGKt requests, and have identified an issue with a parameter that is causing incompatibility with Klarna.
The parameter in question is "setup_future_usage", which is used according to Stripe's documentation to save payment information for the future: https://docs.stripe.com/payments/payment-intents#future-usage.
However, Klarna does not support this parameter, which prevents it from displaying correctly.
According to Klarna's documentation (https://docs.stripe.com/payments/payment-methods/integration-options#additional-api-buy-now-pay-later), they do not support the use of this parameter in the integration.
Therefore, I would recommend contacting Drupal module support to handle this piece of code specifically and to adapt the integration to meet their requirements.
You may need to make changes to your plugin configuration to ensure proper compatibility with Klarna.

Feature request
Status

Closed: duplicate

Version

1.1

Component

Payment Element

Created by

🇮🇹Italy AleDDR

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024