From 1b3b92d1fe234c599f0fc2da8a01624e5be2819e Mon Sep 17 00:00:00 2001 From: WP Lab Date: Fri, 4 Jan 2013 22:51:54 +0100 Subject: [PATCH] Fixed fatal error in paypal gateway MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This line should contain use $response instead of the not existing $result. The error only occurs when debugging is enabled and the communication with Paypal API failed for some reason. But in this case, it results in a fatal php error: Call to a member function get_error_message() on a non-object --- classes/gateways/paypal/class-wc-gateway-paypal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/gateways/paypal/class-wc-gateway-paypal.php b/classes/gateways/paypal/class-wc-gateway-paypal.php index a5247969a9c..b7c2c4cb262 100644 --- a/classes/gateways/paypal/class-wc-gateway-paypal.php +++ b/classes/gateways/paypal/class-wc-gateway-paypal.php @@ -539,7 +539,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { if ( 'yes' == $this->debug ) { $this->log->add( 'paypal', 'Received invalid response from PayPal' ); if ( is_wp_error( $response ) ) - $this->log->add( 'paypal', 'Error response: ' . $result->get_error_message() ); + $this->log->add( 'paypal', 'Error response: ' . $response->get_error_message() ); } return false; @@ -743,4 +743,4 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { return $order; } -} \ No newline at end of file +}