/** * Build the Payment params */ public function getCheapestMonthlyCost($cart = NULL, $cData) { if (!class_exists('CurrencyDisplay')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php'; } if (!class_exists('KlarnaAPI')) { require JPATH_VMKLARNAPLUGIN . DS . 'klarna' . DS . 'helpers' . DS . 'klarnaapi.php'; } if (!isset($this->klarna) || !$this->klarna instanceof Klarna_virtuemart) { return NULL; } $display_fee = 0; $billTotalInCountryCurrency = 0; if (isset($cart->pricesUnformatted['billTotal'])) { $billTotalInCountryCurrency = KlarnaHandler::convertPrice($cart->pricesUnformatted['billTotal'], $cData['vendor_currency'], $cData['virtuemart_currency_id'], $cart->pricesCurrency); } if ($billTotalInCountryCurrency <= 0) { return NULL; } $aTypes = array(KlarnaPClass::ACCOUNT, KlarnaPClass::CAMPAIGN); $kCheckout = new KlarnaAPI($this->country, $this->lang, 'part', $billTotalInCountryCurrency, KlarnaFlags::CHECKOUT_PAGE, $this->klarna, $aTypes, JPATH_VMKLARNAPLUGIN); KlarnaHandler::getCheapestPclass($kCheckout, $cheapest, $minimum); vmdebug('getCheapestMonthlyCost', $cart->pricesUnformatted['billTotal'], $billTotalInCountryCurrency, $cheapest, $minimum); if ($billTotalInCountryCurrency < $minimum) { return NULL; } if (!class_exists('VirtueMartModelCurrency')) { require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php'; } $sFee = $kCheckout->getPresentableValuta($cheapest); return $sFee; }