Support » Plugin: WooCommerce MercadoPago » Bug with Debug and MercadoPago v. 2.0.1

  • Resolved mark.gutierrez

    (@markgutierrez)


    Hi there,

    I came across this issue with the MercadoPago plugin and debug mode. When it’s disabled MercadoPago may have issues contacting the site. It will return a 500 error.

    Here’s the error that’s returned:

    PHP Fatal error: Call to a member function add() on a non-object in wp-content/plugins/woocommerce-mercadopago/includes/class-wc-mercadopago-gateway.php on line 487

    That line of code has this:

    $this->log->add( $this->id, 'Received valid IPN response from MercadoPago' );

    But if Debug mode is not enabled for the MercadoPago plugin, it fails and throws the error above. The reason is because of this line of code:

    wp-content/plugins/woocommerce-mercadopago/includes/class-wc-mercadopago-gateway.php
    66:		// Active logs.
    67-		if ( 'yes' == $this->debug ) {
    68-			if ( class_exists( 'WC_Logger' ) ) {
    69-				$this->log = new WC_Logger();
    70-			} else {
    71-				$this->log = WC_MercadoPago::woocommerce_instance()->logger();
    72-			}
    73-		}

    the log variable never gets created if debug mode is not turned on. If you’re having issues getting MercadoPago to communicate with your site, try turning on Debug mode. This should be fixed though. 🙂

    https://wordpress.org/plugins/woocommerce-mercadopago/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thanks Mark !

    Hi Mark,

    I am in communication with cachi, same situation. Have hosting with wpengine and had the same problem. I tried your solution out on a test install and it worked perfectly. But when I went back to my main install, I still get an error. (Although now it is isn’t a 500 error, it just says “requested failed”.

    The only thing different on my main site is I have an SSL certificate and some more plugins, different theme. On the test install I just had the basic theme and no plugins.

    Is there anyway to get in touch with you directly to take a lot at my site? I am afraid if I go with another support person they won’t be aware of the issue.

    Thanks!
    Tim

    I have a feeling it might be SSL certificate related.

    I can confirm it is SSL certificate related. I have removed the SSL certificate and it works. But still need to get it working with SSL as this is important on an ecommerce site!

    actually, I what I have done is just secured all the URL’s behind /checkout . That way the payment gateway url is not https, which was causing the problem. So this should be good to go.

    The problem is if you want to secure your whole site, this makes the payment gateway url SSL causing the problem.

    Where’s debug mode for MercadoPago plugin? Excuse my ignorance

    mebugarin:

    “Log de depuración” , check “Habilitar log”

    cachi: Gracias por la respuesta, sospechaba que era ese pero como no me lo solucionó, por las dudas repregunté, Voy a chequear con el hosting a ver si están bloqueandolo porque se me agotaron las opciones.

    Sí, seguramente está involucrado el hosting…
    Saludos!

    Gracias, tambien se resolvió asi usando BlueHost como hosting.

    Plugin Author Claudio Sanches

    (@claudiosanches)

    Fixed in version 2.0.6.

    Thank you Claudio Sanches !

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Bug with Debug and MercadoPago v. 2.0.1’ is closed to new replies.