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 payment method should be 'scheme'? #66

Open
JustinElst opened this issue Oct 23, 2024 · 3 comments · May be fixed by #65
Open

Card payment method should be 'scheme'? #66

JustinElst opened this issue Oct 23, 2024 · 3 comments · May be fixed by #65
Assignees

Comments

@JustinElst
Copy link
Contributor

Describe the bug
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.

To Reproduce
Steps to reproduce the behavior:

  1. Add credit-cards in your Adyen customer center
  2. Open hyca checkout
  3. No credit-card payment method

Expected behavior
Have a credit-card payment method

Magento version
2.4.7-p3

Plugin version
adyen/module-hyva-checkout 1.2.1
adyen/module-payment 9.9.1
adyen/php-api-library 19.1.0

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser chrome
  • Version latest

Additional context
This was with the test-environment of Adyen.

Pull-request
I created a pull-request fixing the issue for me.

@candemiralp candemiralp linked a pull request Nov 4, 2024 that will close this issue
@candemiralp
Copy link
Member

Hello @JustinElst,

Thank you for creating this issue and providing a potential solution with your contribution.

However, we are trying to understand the root cause of the issue on your end as we can't reproduce this behaviour and indeed successfully see card payment component on Hyvä checkout. I've already left some comments on the PR. I believe those changes shouldn't affect your implementation unless you have a customisation on Adyen_Payment module.

Screenshot 2024-11-04 at 13 49 40

For further diagnostic of the issue on your end, I would recommend checking the output of this return value. Basically, it returns an array with payment method adapter interfaces. It should have a value for AdyenCc payment method instance.

Best Regards,
Can

@candemiralp candemiralp self-assigned this Nov 4, 2024
@JustinElst
Copy link
Contributor Author

Hi thanks for your reply. So I tried to debug this line. And I got this result:
Screenshot from 2024-11-06 09-28-05
The first block is with my patch of AdyenConfigured the second one is with the master code.

I checked what the response was for the /paymentMethods api:
Screenshot from 2024-11-06 09-23-19
And that clearly shows the "type": "scheme" for the card methods.

Could you explain why the Adyen_Payment module has this map, but this module does not? Because i am just 'mapping' the 'scheme' type payment method to 'adyen_cc' just as in Adyen_Payment. I don't know what the original 'card' type meant, but i can't reproduce getting that method type from the /paymentMethods api.

@candemiralp
Copy link
Member

Hello @JustinElst,

Thank you for your response and again for your contribution.

This mapping is used to filter out Magento payment methods which are not available in the /paymentMethods response from the checkout page. Most of the payment methods has a direct naming convention of adyen_PAYMENTMETHODTYPE like ideal and adyen_ideal in Magento payment method definitions. Whereas, for card payments internal name of the payment method is adyen_cc. This is required to compare scheme payment method type with adyen_cc type. The logic behind, if ideal type is not available in /paymentMethods API response, this class removes adyen_ideal Magento payment method from the checkout. This shouldn't be mixed with the array in Hyvä compatibility module, they serve for different purposes.

As you've shared on the first screenshot, adyen_cc payment method adapter can be seen in the available payment methods array. However, if you debug $configuredKeys, you will see card payment method is represented as card. I understand that creates a confusion and we can definitely refactor this method in Adyen_Payment module to use scheme or cc array key instead of card in $paymentMethodsExtraDetails array eventually (most probably on V10).

Currently, we need to stick to card key as paymentMethodsExtraDetails array has been used to determine the available payment methods and their relevant configurations on Hyvä compatibility module.

Best Regards,
Can

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 a pull request may close this issue.

2 participants