Skip to content

Commit

Permalink
Merge pull request #45 from angelleye/PFWMA-105
Browse files Browse the repository at this point in the history
Split payment issue randomly for same set of rules issue resolved, PFWMA-105
  • Loading branch information
deepakmaurya authored Mar 29, 2020
2 parents 7344f3d + 63e6271 commit dd445ae
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
$order_total = $this->angelleye_get_total($order_id);
if (!empty($gateway_setting->id) && $gateway_setting->id == 'paypal_express') {
$args = array(
'posts_per_page' => -1,
'post_type' => 'microprocessing',
'order' => 'DESC',
'orderby' => 'order_clause',
Expand Down Expand Up @@ -128,6 +129,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
$query = new WP_Query();
$result = $query->query($args);
$total_posts = $query->found_posts;

if ($total_posts > 0) {
foreach ($result as $key => $value) {
$passed_rules = array();
Expand All @@ -136,6 +138,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
$this->angelleye_is_taxable = 0;
$this->angelleye_needs_shipping = 0;
$this->angelleye_is_discountable = 0;

if (!empty($value->ID)) {
$microprocessing_array = get_post_meta($value->ID);
if (!empty($microprocessing_array['woocommerce_paypal_express_api_condition_sign'][0]) && isset($microprocessing_array['woocommerce_paypal_express_api_condition_value'][0])) {
Expand Down Expand Up @@ -290,6 +293,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
}
}
$product_ids = get_post_meta($value->ID, 'woocommerce_paypal_express_api_product_ids', true);

if (!empty($product_ids)) {
if (!array_intersect((array) $product_id, $product_ids)) {
$cart_loop_not_pass = $cart_loop_not_pass + 1;
Expand Down Expand Up @@ -444,6 +448,7 @@ public function angelleye_get_account_for_ec_parallel_payments($gateways, $gatew
}
unset($passed_rules);
}

if ((isset($result) && count($result)) > 0 && (isset($this->map_item_with_account) && count($this->map_item_with_account))) {
return $this->angelleye_modified_ec_parallel_parameter($request, $gateways, $order_id);
}
Expand Down

0 comments on commit dd445ae

Please sign in to comment.