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

Type error upon calling payment-methods store-api (headless) as PaymentMethodRouteResponseSubscriber sets an object for an expected array #531

Open
AndreasA opened this issue Aug 7, 2024 · 2 comments

Comments

@AndreasA
Copy link
Contributor

AndreasA commented Aug 7, 2024

Describe the bug
A clear and concise description of what the bug is.

Versions
Shopware version: 6.5.8.12
Plugin version: 3.16.0

To Reproduce
Steps to reproduce the behavior:

  1. Call store-api for payment methods (headless)

Expected behavior
No type error and correct response.

Code info
At https://github.com/Adyen/adyen-shopware6/blob/3.16.0/src/Subscriber/Response/PaymentMethodRouteResponseSubscriber.php#L163
you return now null or a PaymentMethod object. which is then set https://github.com/Adyen/adyen-shopware6/blob/3.16.0/src/Subscriber/Response/PaymentMethodRouteResponseSubscriber.php#L148C29-L148C51 to an array. this results in a type error.

potentialy solutions:

  • set the object and verify store-api correctly serializes it.
  • call ->toArray on the object
  • json_encode(json_decode on the object.
@AndreasA
Copy link
Contributor Author

any news regarding this?

@adyen-integrations-support
Copy link

adyen-integrations-support commented Nov 27, 2024

Hello @AndreasA ,

Thank you very much for all the required information.
Could you please update the plugin to the latest 3.16.3 and check if the issue still persists?
Additionally, our team will investigate this issue and keep you updated.

Best Regards.

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

No branches or pull requests

2 participants