Skip to content

Commit

Permalink
Update nochex.php
Browse files Browse the repository at this point in the history
  • Loading branch information
NochexDevTeam authored Sep 15, 2020
1 parent 73e2978 commit 4bf882c
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions plugins/vmpayment/nochex/nochex.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,59 +558,6 @@ function _getPaymentResponseHtml($nochexTable, $payment_name) {
return $html;
}

function getCosts(VirtueMartCart $cart, $method, $cart_prices) {
if (preg_match('/%$/', $method->cost_percent_total)) {
$cost_percent_total = substr($method->cost_percent_total, 0, -1);
} else {
$cost_percent_total = $method->cost_percent_total;
}
return ($method->cost_per_transaction + ($cart_prices['salesPrice'] * $cost_percent_total * 0.01));
}

/**
* Check if the payment conditions are fulfilled for this payment method
* @author: Valerie Isaksen
*
* @param $cart_prices: cart prices
* @param $payment
* @return true: if the conditions are fulfilled, false otherwise
*
*/
protected function checkConditions($cart, $method, $cart_prices) {

$address = (($cart->ST == 0) ? $cart->BT : $cart->ST);

$amount = $cart_prices['salesPrice'];
$amount_cond = ($amount >= $method->min_amount AND $amount <= $method->max_amount
OR
($method->min_amount <= $amount AND ($method->max_amount == 0) ));

$countries = array();
if (!empty($method->countries)) {
if (!is_array($method->countries)) {
$countries[0] = $method->countries;
} else {
$countries = $method->countries;
}
}
// probably did not gave his BT:ST address
if (!is_array($address)) {
$address = array();
$address['virtuemart_country_id'] = 0;
}

if (!isset($address['virtuemart_country_id']))
$address['virtuemart_country_id'] = 0;
if (in_array($address['virtuemart_country_id'], $countries) || count($countries) == 0) {
if ($amount_cond) {
return true;
}
}


return false;
}

/**
* We must reimplement this triggers for joomla 1.7
*/
Expand Down

0 comments on commit 4bf882c

Please sign in to comment.