Fixed fatal error in paypal gateway
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
This commit is contained in:
parent
6b1f645e24
commit
1b3b92d1fe
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue