Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnref-and-ppref-not-showing-in-order-notes, PFW-310 #1265

Merged
merged 1 commit into from
Jan 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions classes/wc-gateway-paypal-pro-payflow-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down