Skip to content

[Bug]: Using deprecated function in PHP 8.5 #918

Description

@HowardHow

Description

Using deprecated curl_close function in PHP 8.5

Steps to reproduce

  1. Install Magento2
  2. Install adyen/module-payment and it automatically requires this library with version 28
  3. Setup payment configurations
  4. When proceed to payment stage, it showed the deprecated functionality error

Actual behavior

It showed this error
Deprecated Functionality: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 in vendor/adyen/php-api-library/src/Adyen/HttpClient/CurlClient.php on line 356

Expected behavior

It should proceed the checkout flow without issue

Code snippet or screenshots (if applicable)

vendor/adyen/php-api-library/src/Adyen/HttpClient/CurlClient.php line 150 and 356

// requestPost method in line 150
// Execute the request
[$result, $httpStatus] = $this->curlRequest($ch);

// Get errors
[$errno] = $this->curlError($ch);

curl_close($ch);

$resultOKHttpStatusCodes = array(200, 201, 202, 204);
// requestHttp method in line 356
// Execute the request
[$result, $httpStatus] = $this->curlRequest($ch);

// Get errors
[$errno] = $this->curlError($ch);

curl_close($ch);

$hasFailed = !in_array($httpStatus, array(200, 201, 202, 204));

Adyen PHP API Library version

v28.3.0

PHP version

8.5

Operating System

Linux

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions