Adyen/adyen-php-api-library

Delete stored payment returns as error

gromez opened this issue · 1 comments

Calling deleteStoredPaymentMethods return a ConnectionException with message Probably your Web Service username and/or password is incorrect.

$resultOKHttpStatusCodes = array(200, 201, 202, 204);
if (!in_array($httpStatus, $resultOKHttpStatusCodes) && $result) {
$this->handleResultError($result, $logger);
} elseif (!$result) {
$this->handleCurlError($requestUrl, $errno, $message, $logger);
}

Maybe documentation about is wrong because I'm not getting a 200 HTTP status, but 204 with empty content, and the stored payment has been successfully deleted.
But, because result is empty, it raises error in handleCurlError.

Documentation reference: https://docs.adyen.com/api-explorer/Checkout/70/delete/storedPaymentMethods/_recurringId_

Hi @gromez,

Thanks a lot for reaching out to us and bringing this issue to our attention. We just added support for REST requests and did indeed not account for this empty response bodies for delete requests :) I opened a PR to fix this issue.

Best, Jilling
Adyen