Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card type should be called scheme #65

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

JustinElst
Copy link
Contributor

@JustinElst JustinElst commented Oct 23, 2024

Summary

The credit-card payment method did not show up for me. It seems like that is because the response from /paymentMethods gives the cards with the 'scheme' type payment method.

{
  "body": {
    "paymentMethods": [
      {
        "brands": [
          "mc",
          "visa",
          "amex"
        ],
        "name": "Credit en Debit card",
        "type": "scheme"
      }
    ]
  }
}

It seems that the adyen-magento2 module has a map for this case here.

I also noticed that the test had a key for paymentMethods return. But in my case it did not return the paymentMethods with a key...

Tested scenarios

Open checkout and see if the cards payment method shows up.
It didn't before now it does.

Fixes #66

Versions used

  • Magento 2.4.7-p3
  • adyen/module-hyva-checkout 1.2.1
  • adyen/module-payment 9.9.1
  • adyen/php-api-library 19.1.0

@@ -66,7 +66,7 @@ use Adyen\Hyva\Magewire\Payment\Method\CreditCard;
creditCardHandler.setCreditCardType(creditCardHandler.getCcCodeByAltCode(state.brand));
},
name: '<?= $escaper->escapeJs($magewire->getConfiguration()->getValue('adyenCc/title')) ?>',
type: "card",
type: "scheme",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is used for rendering Card Component and this type should be card. Please refer to configuration section v5.x.x or earlier on Card Component documentation.

@@ -74,7 +74,7 @@ private function isMethodAvailable($method, $configuredKeys): bool
private function collectMethodCodeWithoutPrefix($methodCode): string
{
if ($methodCode == CreditCard::METHOD_CC) {
return 'card';
return 'scheme';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As paymentMethodsExtraDetails value has been used on line 46 in the same file, this value should stay as card. Because paymentMethodsExtraDetails returns key card for scheme payments in the Adyen_Payment module here.

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.

Card payment method should be 'scheme'?
2 participants