Skip to content

Commit

Permalink
remove if condition, PFWMA-132
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Jun 7, 2020
1 parent 1f4168f commit 6fb5d7d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1597,19 +1597,17 @@ public function angelleye_get_account_for_ec_payment_load_balancer($gateways, $g
$express_checkout_accounts[$key] = $account;
}
foreach ($express_checkout_accounts as $key => $account) {
if(empty($account['is_used'])) {
if ( $key != 'default' && false === get_post_status( $key ) ) {
unset($express_checkout_accounts[$key]);
} else {
$found_email = $account['email'];
WC()->session->set($session_key, $account['email']);
$account['is_used'] = 'yes';
$express_checkout_accounts[$key] = $account;
WC()->session->set($session_key_account, $account);
update_option($option_key, $express_checkout_accounts);
$found_account = true;
break;
}
if ( $key != 'default' && false === get_post_status( $key ) ) {
unset($express_checkout_accounts[$key]);
} else {
$found_email = $account['email'];
WC()->session->set($session_key, $account['email']);
$account['is_used'] = 'yes';
$express_checkout_accounts[$key] = $account;
WC()->session->set($session_key_account, $account);
update_option($option_key, $express_checkout_accounts);
$found_account = true;
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,17 +639,15 @@ public function angelleye_get_account_for_payflow_payment_load_balancer($gateway
$payflow_accounts[$key] = $account;
}
foreach ($payflow_accounts as $key => $account) {
if(empty($account['is_used'])) {
if ( $key != 'default' && false === get_post_status( $key ) ) {
unset($payflow_accounts[$key]);
} else {
$account['is_used'] = 'yes';
$payflow_accounts[$key] = $account;
$used_account = $account['multi_account_id'];
update_post_meta($order_id, '_multi_account_api_username_load_balancer', $used_account);
update_option($option_key, $payflow_accounts);
break;
}
if ( $key != 'default' && false === get_post_status( $key ) ) {
unset($payflow_accounts[$key]);
} else {
$account['is_used'] = 'yes';
$payflow_accounts[$key] = $account;
$used_account = $account['multi_account_id'];
update_post_meta($order_id, '_multi_account_api_username_load_balancer', $used_account);
update_option($option_key, $payflow_accounts);
break;
}
}
}
Expand Down

0 comments on commit 6fb5d7d

Please sign in to comment.