• 0
Sign in to follow this  
leandrotyl

PHP Sdk: access_token nunca llega

Question

Hola gente,

 

Estoy probando el SDK de php con un WAMP en Windows7. Hasta ahora pude probar la parte del login pero nunca obtengo el access_token.

 

Este es el resultado que tengo....

 

Array
(
[access_token] =>
[expires_in] => 1472248264
[refresh_token] =>
)

 

 

 

Lo probe desde postman

;

 

 

(remuevo el https de la URL para que no lo formatee el editor...)

 

_hh://api.mercadolibre.com/oauth/token?grant_type=authorization_code&client_id=xxxxxxxxxxxxxxxxx&client_secret=8888888888888888888888888&code=TG-XXXXXXX&redirect_uri=http://localhost/login.php

 

 

Y si obtengo la respuesta de la API.....

 

 

Me estoy perdiendo de algo de PHP que no funciona?? 

 

Agrege la opcion de SSL a CURL

 

   public static $CURL_OPTS = array(
        CURLOPT_USERAGENT => "MELI-PHP-SDK-1.1.0", 
        CURLOPT_SSL_VERIFYPEER => true,
        CURLOPT_CONNECTTIMEOUT => 10, 
        CURLOPT_RETURNTRANSFER => 1, 
        CURLOPT_TIMEOUT => 60,
        CURLOPT_SSLVERSION => 3
    );

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Solucionado: Despues de instalar Https en Localhost con WAMP y bajar un certificado de cacert.crt (sin agregar nada de configuracion en el el codigo de la API) y configurando el php.ini con:  

 
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "D:\wamp64\bin\php\php5.5.12\cacert.crt"
 
Me ha funcionado todo de maravilla!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this