How can I fix error with version of PHP on Mercado Libre API

1.6k Views Asked by At

I'm trying to integrate Mercado Pago to my project. In the back end the documentation says that we should put.

require_once 'vendor/autoload.php';
MercadoPago\SDK::setAccessToken("ENV_ACCESS_TOKEN"); 

But MercadoPago\SDK::setAccessToken("ENV_ACCESS_TOKEN"); gives me this error:

Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerFile() must be an instance of Doctrine\Common\Annotations\void, none returned in /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:75 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/mercadopago/dx-php/src/MercadoPago/MetaDataReader.php(27): Doctrine\Common\Annotations\AnnotationRegistry::registerFile('/Applications/X...') #1 /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/mercadopago/dx-php/src/MercadoPago/Manager.php(42): MercadoPago\MetaDataReader->__construct() #2 /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/mercadopago/dx-php/src/MercadoPago/SDK.php(34): MercadoPago\Manager->__construct(Object(MercadoPago\RestClient), Object(MercadoPago\Config)) #3 /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/mercadopago/dx-php/src/MercadoPago/SDK.php(43): MercadoPago\SDK::initialize() #4 in /Applications/XAMPP/xamppfiles/htdocs/tiendaFarias/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 75

It's important to say that I'm using php V 7.0.33

I hope someone can tell if I'm missing something.

0

There are 0 best solutions below