Skip to content

Conversation

@hamplr
Copy link

@hamplr hamplr commented Jul 29, 2025

Merge Request Description

Issue Description

This merge request addresses an issue in the Adyen payment method filtering for Hyvä Checkout. In the original implementation, the credit card payment method (adyen_cc) was incorrectly mapped to "card" when checking against available payment methods from Adyen's API. However, Adyen's API expects this payment method to be identified as "scheme" rather than "card".

Fix Implementation

The fix changes the return value in the collectMethodCodeWithoutPrefix method from "card" to "scheme" when handling the credit card payment method. This ensures proper mapping between Magento's payment method codes and Adyen's API expectations.

private function collectMethodCodeWithoutPrefix($methodCode): string
{
    if ($methodCode == CreditCard::METHOD_CC) {
-        return 'card';
+        return "scheme";
    }

    return substr(
        $methodCode,
        strpos($methodCode, ProcessingMetadataInterface::METHOD_ADYEN_PREFIX) + 
        strlen(ProcessingMetadataInterface::METHOD_ADYEN_PREFIX)
    );
}

Steps to Reproduce the Issue

  1. Configure Adyen payment methods in Magento admin
  2. Navigate to checkout with Hyvä Checkout enabled
  3. Observe that credit card payment method is not available, despite being configured in Adyen

Expected Behavior

Credit card payment method should be available at checkout when properly configured in Adyen.

Root Cause

The mismatch between the identifier used in the code ("card") and the one expected by Adyen's API ("scheme") caused the credit card payment method to be incorrectly filtered out, even when it was properly configured.

This fix ensures that the correct identifier is used when checking if the credit card payment method is available according to Adyen's configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant