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

RecurringApi::deleteTokenForStoredPaymentDetails call fails even though the request is correctly performed and successfully finished #579

Closed
vasilake-v opened this issue Oct 25, 2023 · 4 comments · Fixed by #581

Comments

@vasilake-v
Copy link

Describe the bug
Call to \Adyen\Service\Checkout\RecurringApi::deleteTokenForStoredPaymentDetails fails with TypeError: Return value must be of type array, string returned, although the request is finished successful

Delete payment method returns empty response with 204 code. That means, the same empty result is returned by Adyen\HttpClient\CurlClient::requestHttp() (empty string or null depending on outputType in config).

Because Adyen\Service::requestHttp() directly returns result of previously mentioned method, it fails because Adyen\Service::requestHttp(): array (has a strict return type array)

To Reproduce
Steps to reproduce the behavior:

  1. Perform a call to \Adyen\Service\Checkout\RecurringApi::deleteTokenForStoredPaymentDetails with usual arguments

Expected behavior
Either return empty array, success result dto, or at least no error :)

Additional context
Add any other context about the problem here.
Currently we are at package version: v15.4.0. Although there is a newer version the package, the requestHttp() method is similar

@michaelpaul
Copy link
Contributor

Hello @vasilake-v, thanks for reporting this issue! A fix shall be released soon on our next major.

@vasilake-v
Copy link
Author

@michaelpaul thanks for taking care about this. Do you think we could replicate/have similar fix for previous major version ?
So we also allow other package users (still using lower version) to benefit from functionality, while still following their own timetable for smooth migration plan from Arrays -> DTOs ( instead of rushing and repriotize other things for upgrading to the new major version, only for this fix)

I can port the fix on the v15 and prepare a pull request

@michaelpaul
Copy link
Contributor

Hey @vasilake-v, we understand that upgrading to a major version can be complicated, so we've ported the fix to v15. Now you can find it on v15.5.1.

@vasilake-v
Copy link
Author

@michaelpaul Thank you! 👍

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