From 5a0134c824db8491f4ca9d8f066b7d5cc04f259f Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Mon, 3 Feb 2020 10:55:15 +0530 Subject: [PATCH] LIVE API Active in PFW and same details in Multi-Account, PFWMA-56 --- ...ccount-management-admin-paypal-payflow.php | 21 ------------------- includes/angelleye-multi-account-function.php | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php index 7d49338..b6d7283 100644 --- a/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php +++ b/admin/class-paypal-for-woocommerce-multi-account-management-admin-paypal-payflow.php @@ -427,27 +427,6 @@ public function angelleye_get_multi_account_by_order_total($gateways, $gateway_s } } - public function angelleye_get_closest_amount($array, $value) { - $size = count($array); - $index_key = 0; - if ($size > 0) { - $diff = abs($array[0]['woocommerce_paypal_express_api_condition_value'] - $value); - $ret = $array[0]['woocommerce_paypal_express_api_condition_value']; - $index_key = 0; - for ($i = 1; $i < $size; $i) { - $temp = abs($array[$i]['woocommerce_paypal_express_api_condition_value'] - $value); - if ($temp < $diff) { - $diff = $temp; - $ret = $array[$i]['woocommerce_paypal_express_api_condition_value']; - $index_key = $i; - } - } - return $array[$index_key]; - } else { - return array(); - } - } - public function angelleye_paypal_for_woocommerce_multi_account_api_paypal_payflow($gateways, $request = null, $order_id = null) { if ($request == null) { $gateway_setting = $gateways; diff --git a/includes/angelleye-multi-account-function.php b/includes/angelleye-multi-account-function.php index aa37338..20afdad 100644 --- a/includes/angelleye-multi-account-function.php +++ b/includes/angelleye-multi-account-function.php @@ -16,3 +16,24 @@ function angelleye_get_product_cat($categories) { } return $categories; } + +function angelleye_get_closest_amount($array, $value) { + $size = count($array); + $index_key = 0; + if ($size > 0) { + $diff = abs($array[0]['woocommerce_paypal_express_api_condition_value'] - $value); + $ret = $array[0]['woocommerce_paypal_express_api_condition_value']; + $index_key = 0; + for ($i = 1; $i < $size; $i++) { + $temp = abs($array[$i]['woocommerce_paypal_express_api_condition_value'] - $value); + if ($temp < $diff) { + $diff = $temp; + $ret = $array[$i]['woocommerce_paypal_express_api_condition_value']; + $index_key = $i; + } + } + return $array[$index_key]; + } else { + return array(); + } +}