diff --git a/angelleye-includes/angelleye-admin-order-payment-process.php b/angelleye-includes/angelleye-admin-order-payment-process.php index ec3411b7e..e0212b79d 100644 --- a/angelleye-includes/angelleye-admin-order-payment-process.php +++ b/angelleye-includes/angelleye-admin-order-payment-process.php @@ -9,6 +9,7 @@ class AngellEYE_Admin_Order_Payment_Process { public $utility; public $gateway_calculation; public $gateway_settings; + public $confirm_order_id; public function __construct() { if (is_admin() && !defined('DOING_AJAX')) { @@ -164,7 +165,7 @@ public function angelleye_admin_order_process_payment($post_id, $post) { public function angelleye_admin_create_reference_order_action($order) { $this->payment_method = version_compare( WC_VERSION, '3.0', '<' ) ? $order->payment_method : $order->get_payment_method(); - if (in_array($this->payment_method, array('paypal_express', 'braintree', 'paypal_credit_card_rest', 'paypal_advanced', 'paypal_pro', 'paypal_pro_payflow'))) { + if (in_array($this->payment_method, array('paypal_express', 'paypal_pro', 'paypal_pro_payflow'))) { $this->angelleye_admin_create_new_order($order); } remove_action('woocommerce_process_shop_order_meta', 'WC_Meta_Box_Order_Data::save', 40, 2); @@ -178,18 +179,6 @@ public function angelleye_admin_order_process_payment_action($order) { $this->angelleye_ec_pp_pf_reference_transaction($order); } break; - case 'braintree': { - $this->angelleye_braintree_reference_transaction($order); - } - break; - case 'paypal_credit_card_rest': { - $this->angelleye_paypal_credit_card_rest_reference_transaction($order); - } - break; - case 'paypal_advanced': { - $this->angelleye_paypal_advanced_reference_transaction($order); - } - break; case 'paypal_pro': { $this->angelleye_ec_pp_pf_reference_transaction($order); } @@ -330,7 +319,7 @@ public function angelleye_is_order_payment_method_selected($order) { public function angelleye_is_admin_order_payment_method_available($order) { $this->payment_method = version_compare( WC_VERSION, '3.0', '<' ) ? $order->payment_method : $order->get_payment_method(); - if (in_array($this->payment_method, array('paypal_express', 'braintree', 'paypal_credit_card_rest', 'paypal_advanced', 'paypal_pro', 'paypal_pro_payflow'))) { + if (in_array($this->payment_method, array('paypal_express', 'paypal_pro', 'paypal_pro_payflow'))) { return true; } else { return false; @@ -393,14 +382,14 @@ public function angelleye_is_usable_reference_transaction_avilable($order) { public function get_usable_reference_transaction($order) { $this->payment_method = version_compare( WC_VERSION, '3.0', '<' ) ? $order->payment_method : $order->get_payment_method(); $user_id = $order->get_user_id(); - if (in_array($this->payment_method, array('paypal_express', 'braintree', 'paypal_credit_card_rest', 'paypal_advanced', 'paypal_pro', 'paypal_pro_payflow'))) { + if (in_array($this->payment_method, array('paypal_express', 'paypal_pro', 'paypal_pro_payflow'))) { return $this->angelleye_get_payment_token($user_id, $order); } } public function angelleye_get_payment_token($user_id, $order) { $this->payment_method = version_compare( WC_VERSION, '3.0', '<' ) ? $order->payment_method : $order->get_payment_method(); - if (in_array($this->payment_method, array('paypal_pro', 'paypal_pro_payflow', 'paypal_advanced'))) { + if (in_array($this->payment_method, array('paypal_pro', 'paypal_pro_payflow'))) { $order_transaction_ids = $this->angelleye_get_transaction_id_by_order_id($order); if (!empty($order_transaction_ids)) { return $order_transaction_ids; @@ -413,9 +402,7 @@ public function angelleye_get_payment_token($user_id, $order) { return $customer_billing_agreement_id; } return $this->angelleye_get_customer_or_order_tokens($user_id, $order); - } elseif (in_array($this->payment_method, array('braintree', 'paypal_credit_card_rest'))) { - return $this->angelleye_get_customer_or_order_tokens($user_id, $order); - } + } } public function angelleye_get_customer_or_order_tokens($user_id, $order) { @@ -525,18 +512,6 @@ public function angelleye_load_payment_method_setting($order) { $this->paypal = $this->utility->paypal; } break; - case 'braintree' : { - - } - break; - case 'paypal_advanced': { - - } - break; - case 'paypal_credit_card_rest': { - - } - break; } } @@ -586,7 +561,7 @@ public function angelleye_ec_pp_pf_reference_transaction($order) { public function angelleye_reference_transaction_request_ec_pp_pf($order, $referenceid) { $this->angelleye_load_calculation(); - $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); + $this->confirm_order_id = $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); $PayPalRequestData = array(); $DRTFields = array( 'referenceid' => $referenceid, diff --git a/classes/wc-gateway-braintree-angelleye.php b/classes/wc-gateway-braintree-angelleye.php index 36f600fe6..aeaecaee9 100644 --- a/classes/wc-gateway-braintree-angelleye.php +++ b/classes/wc-gateway-braintree-angelleye.php @@ -2305,7 +2305,7 @@ public function angelleye_reload_gateway_credentials_for_woo_subscription_renewa $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); if ($this->is_subscription($order_id)) { foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_id = $product->get_id(); if (!empty($product_id)) { $product_type = get_post_type($product_id); diff --git a/classes/wc-gateway-calculations-angelleye.php b/classes/wc-gateway-calculations-angelleye.php index f44aaea83..b92aa5436 100644 --- a/classes/wc-gateway-calculations-angelleye.php +++ b/classes/wc-gateway-calculations-angelleye.php @@ -211,7 +211,7 @@ public function order_calculation($order_id) { } $desc = ''; foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_sku = null; if (is_object($product)) { $product_sku = $product->get_sku(); diff --git a/classes/wc-gateway-paypal-advanced-angelleye.php b/classes/wc-gateway-paypal-advanced-angelleye.php index 2cee85850..e85340694 100644 --- a/classes/wc-gateway-paypal-advanced-angelleye.php +++ b/classes/wc-gateway-paypal-advanced-angelleye.php @@ -1347,7 +1347,7 @@ public function create_reference_transaction($token, $order) { if (sizeof($order->get_items()) > 0 && $order->get_subtotal() > 0) { foreach ($order->get_items() as $item) { if ($item['qty']) { - $product = $order->get_product_from_item($item); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $item ) : $item->get_product(); $item_name = $item['name']; $paypal_args['L_NAME' . $item_loop . '[' . strlen($item_name) . ']'] = $item_name; if ($product->get_sku()) { @@ -1553,7 +1553,7 @@ public function angelleye_reload_gateway_credentials_for_woo_subscription_renewa $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); if( $this->is_subscription($order_id) ) { foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_id = $product->get_id(); $product_type = get_post_type($product_id); if($product_type == 'product_variation') { diff --git a/classes/wc-gateway-paypal-credit-cards-rest-angelleye.php b/classes/wc-gateway-paypal-credit-cards-rest-angelleye.php index 23982f442..f23d4573e 100644 --- a/classes/wc-gateway-paypal-credit-cards-rest-angelleye.php +++ b/classes/wc-gateway-paypal-credit-cards-rest-angelleye.php @@ -380,7 +380,7 @@ public function angelleye_reload_gateway_credentials_for_woo_subscription_renewa $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); if( $this->is_subscription($order_id) ) { foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_id = $product->get_id(); if( !empty($product_id) ) { $product_type = get_post_type($product_id); diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index f5d8056cd..1963b53d7 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -2729,7 +2729,7 @@ public function angelleye_reload_gateway_credentials_for_woo_subscription_renewa $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); if( $this->is_subscription($order_id) ) { foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_id = $product->get_id(); if( !empty($product_id) ) { $product_type = get_post_type($product_id); diff --git a/classes/wc-gateway-paypal-pro-angelleye.php b/classes/wc-gateway-paypal-pro-angelleye.php index 3a28d5b91..d78acc039 100644 --- a/classes/wc-gateway-paypal-pro-angelleye.php +++ b/classes/wc-gateway-paypal-pro-angelleye.php @@ -2091,7 +2091,7 @@ public function angelleye_reload_gateway_credentials_for_woo_subscription_renewa $order_id = version_compare(WC_VERSION, '3.0', '<') ? $order->id : $order->get_id(); if( $this->is_subscription($order_id) ) { foreach ($order->get_items() as $cart_item_key => $values) { - $product = $order->get_product_from_item($values); + $product = version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_product_from_item( $values ) : $values->get_product(); $product_id = $product->get_id(); if( !empty($product_id) ) { $product_type = get_post_type($product_id); diff --git a/paypal-for-woocommerce.php b/paypal-for-woocommerce.php index 10e74baa7..db5604e8a 100644 --- a/paypal-for-woocommerce.php +++ b/paypal-for-woocommerce.php @@ -4,7 +4,7 @@ * Plugin Name: PayPal for WooCommerce * Plugin URI: http://www.angelleye.com/product/paypal-for-woocommerce-plugin/ * Description: Easily enable PayPal Express Checkout, PayPal Pro, PayPal Advanced, PayPal REST, and PayPal Braintree. Each option is available separately so you can enable them individually. - * Version: 2.3.4 + * Version: 2.3.5 * Author: Angell EYE * Author URI: http://www.angelleye.com/ * License: GNU General Public License v3.0 @@ -12,10 +12,10 @@ * Text Domain: paypal-for-woocommerce * Domain Path: /i18n/languages/ * GitHub Plugin URI: https://github.com/angelleye/paypal-woocommerce - * Requires at least: 5.0 + * Requires at least: 5.2 * Tested up to: 5.5 * WC requires at least: 3.0.0 - * WC tested up to: 4.3.3 + * WC tested up to: 4.4.1 * ************* * Attribution @@ -39,7 +39,7 @@ define('PAYPAL_FOR_WOOCOMMERCE_ASSET_URL', plugin_dir_url(__FILE__)); } if (!defined('VERSION_PFW')) { - define('VERSION_PFW', '2.3.4'); + define('VERSION_PFW', '2.3.5'); } if ( ! defined( 'PAYPAL_FOR_WOOCOMMERCE_PLUGIN_FILE' ) ) { define( 'PAYPAL_FOR_WOOCOMMERCE_PLUGIN_FILE', __FILE__ ); diff --git a/readme.txt b/readme.txt index 51fb1b2bc..ec06c5c23 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: angelleye, angelleyesupport, Umangvaghela Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SG9SQU2GBXJNA Tags: woocommerce, paypal, express checkout, payments pro, angelleye, payflow, dodirectpayment, apple pay, google play, braintree, payments advanced, rest, credit cards, credit card payments, payments, payment -Requires at least: 5.0 +Requires at least: 5.2 Tested up to: 5.5 -Stable tag: 2.3.4 +Stable tag: 2.3.5 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -127,6 +127,10 @@ Automatic updates should work great for you. As always, though, we recommend ba == Changelog == += 2.3.5 - 08.20.2020 = +* Fix - Resolves a PHP error, Reference Transaction from admin side. ([PFW-674](https://github.com/angelleye/paypal-woocommerce/pull/1485)) +* Tweak - Adds WooCommerce 4.4.0 Compatibility. ([PFW-675](https://github.com/angelleye/paypal-woocommerce/pull/1486)) + = 2.3.4 - 08.17.2020 = * Fix - Adds WooCommerce 3.6.3 Compatibility. ([PFW-673](https://github.com/angelleye/paypal-woocommerce/pull/1484))