/** * @param $cart * @param $order * @return bool','null */ function plgVmConfirmedOrder($cart, $order) { if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) { return NULL; // Another method was selected, do nothing } if (!$this->selectedThisElement($method->payment_element)) { return FALSE; } $this->setInConfirmOrder($cart); $session = JFactory::getSession(); $return_context = $session->getId(); $this->_debug = $method->debug; $this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message'); vmdebug('SOFORT plgVmConfirmedOrder'); if (!class_exists('VirtueMartModelOrders')) { require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php'; } if (!class_exists('VirtueMartModelCurrency')) { require VMPATH_ADMIN . DS . 'models' . DS . 'currency.php'; } if (!class_exists('TableVendors')) { require VMPATH_ADMIN . DS . 'tables' . DS . 'vendors.php'; } $currency_code_3 = self::PAYMENT_CURRENCY_CODE_3; // $currency_id = shopFunctions::getCurrencyIDByName($currency_code_3); $totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $currency_id); $cd = CurrencyDisplay::getInstance($cart->pricesCurrency); $address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT']; $cd = CurrencyDisplay::getInstance($cart->pricesCurrency); if ($totalInPaymentCurrency <= 0) { vmInfo(vmText::sprintf('VMPAYMENT_SOFORT_AMOUNT_INCORRECT', $order['details']['BT']->order_total, $totalInPaymentCurrency['value'], $currency_code_3)); return FALSE; } // Prepare data that should be stored in the database $dbValues['order_number'] = $order['details']['BT']->order_number; $dbValues['payment_name'] = $this->renderPluginName($method, 'order'); $dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id; $dbValues['cost_per_transaction'] = $method->cost_per_transaction; $dbValues['cost_percent_total'] = $method->cost_percent_total; $dbValues['payment_currency'] = $currency_id; $dbValues['payment_order_total'] = $totalInPaymentCurrency['value']; $dbValues['tax_id'] = $method->tax_id; $dbValues['sofort_custom'] = $return_context; $this->storePSPluginInternalData($dbValues); if (!class_exists('SofortLib')) { require VMPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'sofort' . DS . 'sofort' . DS . 'library' . DS . 'sofortLib.php'; } if (!class_exists('SofortLib_iDealClassic')) { require VMPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'sofort' . DS . 'sofort' . DS . 'library' . DS . 'sofortLib_ideal_classic.php'; } $sofort_ideal = new SofortLib_iDealClassic($method->configuration_key, $method->project_password); $sofort_ideal->setVersion(self::RELEASE); $sofort_ideal->setAmount($totalInPaymentCurrency['value'], $currency_code_3); $sofort_ideal->setSenderCountryId(ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code')); $sofort_ideal->setReason($order['details']['BT']->order_number); $sofort_ideal->addUserVariable($order['details']['BT']->virtuemart_paymentmethod_id); //$sofort_ideal->setSuccessUrl(self::getSuccessUrl($order)); //user_variable_3 //$sofort_ideal->setAbortUrl(self::getCancelUrl($order)); //user_variable_4 //$sofort_ideal->setNotificationUrl(self::getNotificationUrl( $order['details']['BT']->order_number)); //user_variable_5 $sofort_ideal->setSenderCountryId(ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code')); //sender_country_id $sofort_ideal->setSenderBankCode(self::_getSelectedBankCode($order['details']['BT']->virtuemart_paymentmethod_id)); $url = $sofort_ideal->getPaymentUrl(); //$this->storePSPluginInternalData($dbValues); $mainframe = JFactory::getApplication(); $mainframe->redirect($url); }