From 340f7ab65ac288a29334dd5312d76ff595143dbd Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Wed, 9 Jan 2019 14:45:08 +0530 Subject: [PATCH] pnref-and-ppref-not-showing-in-order-notes, PFW-310 --- ...c-gateway-paypal-pro-payflow-angelleye.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/classes/wc-gateway-paypal-pro-payflow-angelleye.php b/classes/wc-gateway-paypal-pro-payflow-angelleye.php index efdd75554..3675e1c28 100644 --- a/classes/wc-gateway-paypal-pro-payflow-angelleye.php +++ b/classes/wc-gateway-paypal-pro-payflow-angelleye.php @@ -787,6 +787,11 @@ function do_payment($order, $card_number, $card_exp, $card_csc) { wc_maybe_reduce_stock_levels($order_id); } } elseif ($this->payment_action == "Authorization" ) { + if (isset($PayPalResult['PPREF']) && !empty($PayPalResult['PPREF'])) { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s) (PPREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'], $PayPalResult['PPREF'])); + } else { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'])); + } if( $this->pending_authorization_order_status == 'Processing' ) { $order->payment_complete($PayPalResult['PNREF']); } else { @@ -812,6 +817,11 @@ function do_payment($order, $card_number, $card_exp, $card_csc) { $angelleye_utility = new AngellEYE_Utility(null, null); $angelleye_utility->angelleye_get_transactionDetails($PayPalResult['PNREF']); } else { + if (isset($PayPalResult['PPREF']) && !empty($PayPalResult['PPREF'])) { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s) (PPREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'], $PayPalResult['PPREF'])); + } else { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'])); + } if( $this->default_order_status == 'Completed' ) { $order->update_status('completed'); if ($old_wc) { @@ -1409,6 +1419,11 @@ public function process_subscription_payment($order, $amount, $payment_token = n wc_maybe_reduce_stock_levels($order_id); } } elseif ($this->payment_action == "Authorization") { + if (isset($PayPalResult['PPREF']) && !empty($PayPalResult['PPREF'])) { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s) (PPREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'], $PayPalResult['PPREF'])); + } else { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'])); + } if ($old_wc) { update_post_meta($order_id, '_first_transaction_id', $PayPalResult['PNREF']); } else { @@ -1420,6 +1435,11 @@ public function process_subscription_payment($order, $amount, $payment_token = n $angelleye_utility = new AngellEYE_Utility(null, null); $angelleye_utility->angelleye_get_transactionDetails($PayPalResult['PNREF']); } else { + if (isset($PayPalResult['PPREF']) && !empty($PayPalResult['PPREF'])) { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s) (PPREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'], $PayPalResult['PPREF'])); + } else { + $order->add_order_note(sprintf(__('PayPal Pro Payflow payment completed (PNREF: %s)', 'paypal-for-woocommerce'), $PayPalResult['PNREF'])); + } if( $this->default_order_status == 'Completed' ) { $order->update_status('completed'); if ($old_wc) {