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 · 1 comment

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?

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

1 participant