From 1faae5f4f55426269e411daa55228037da60c9c8 Mon Sep 17 00:00:00 2001 From: Diego Zanella Date: Wed, 10 Jun 2015 19:17:37 +0100 Subject: [PATCH] Fixed reference in PayPal IPN class * Using __CLASS__ in valid_response() prevents inheritance, as __CLASS__ is always resolved as the parent class. A descendant class would have to copy/paste the whole block of code for it to work correctly. Solution: replaced it with $this, as the valid_response() method is not static, and neither are any of the "payment_status_" methods. --- .../paypal/includes/class-wc-gateway-paypal-ipn-handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php index 3b7fb3f7b72..7fa6ce3ca58 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php @@ -57,8 +57,8 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { WC_Gateway_Paypal::log( 'Found order #' . $order->id ); WC_Gateway_Paypal::log( 'Payment status: ' . $posted['payment_status'] ); - if ( method_exists( __CLASS__, 'payment_status_' . $posted['payment_status'] ) ) { - call_user_func( array( __CLASS__, 'payment_status_' . $posted['payment_status'] ), $order, $posted ); + if ( method_exists( $this, 'payment_status_' . $posted['payment_status'] ) ) { + call_user_func( array( $this, 'payment_status_' . $posted['payment_status'] ), $order, $posted ); } } }