140 if (
$myConfig->getConfigParam(
'blPsBasketReservationEnabled')) {
141 $this->
getSession()->getBasketReservations()->renewExpiration();
158 $blPsBasketReservationEnabled =
$myConfig->getConfigParam(
'blPsBasketReservationEnabled');
159 if ($blPsBasketReservationEnabled && (!$oBasket || ($oBasket && !$oBasket->getProductsCount()))) {
164 if (!$oUser && ($oBasket && $oBasket->getProductsCount() > 0)) {
166 } elseif (!$oBasket || !$oUser || ($oBasket && !$oBasket->getProductsCount())) {
172 if (
$myConfig->getCurrentShopURL() !=
$myConfig->getSSLShopURL() && !$blAlreadyRedirected && !$sFncParameter) {
175 $shopSecureHomeURL =
$myConfig->getShopSecureHomeURL();
177 $sPayError = $sPayErrorParameter ?
'payerror='.$sPayErrorParameter:
'';
178 $sPayErrorText = $sPayErrorTextParameter ?
'payerrortext='.$sPayErrorTextParameter:
'';
179 $sRedirectURL = $shopSecureHomeURL .
'sslredirect=forced&cl=payment&'.$sPayError.
"&".$sPayErrorText;
202 if ($this->
getConfig()->getConfigParam(
'blOtherCountryOrder')) {
203 $oPayment =
oxNew(
'oxpayment');
204 if ($oPayment->load(
'oxempty')) {
205 $this->_oEmptyPayment = $oPayment;
208 $this->_sPaymentError = -2;
211 $this->_sPaymentError = -2;
223 if (!($iPayError || $sPayErrorText)) {
230 $this->_sPaymentError = $iPayError;
232 if ($sPayErrorText) {
234 $this->_sPaymentErrorText = $sPayErrorText;
246 $oBasket = $oSession->getBasket();
247 $oBasket->setShipping(null);
248 $oBasket->onUpdate();
249 $oSession->setVariable(
'sShipSet', $this->
getConfig()->getRequestParameter(
'sShipSet'));
272 $oSession->setVariable(
'payerror', 2);
278 $sShipSetId = $oSession->getVariable(
'sShipSet');
281 $sPaymentId = $oSession->getVariable(
'paymentid');
284 $aDynvalue = $oSession->getVariable(
'dynvalue');
288 if (!
$myConfig->getConfigParam(
'blOtherCountryOrder') && $sPaymentId ==
'oxempty') {
294 $oSession->setVariable(
'payerror', 1);
300 $oSession->setVariable(
'payerror', 7);
305 $oBasket = $oSession->getBasket();
306 $oBasket->setPayment(null);
307 $oPayment =
oxNew(
'oxpayment');
308 $oPayment->load($sPaymentId);
311 $dBasketPrice = $oBasket->getPriceForPayment();
313 $blOK = $oPayment->isValidPayment($aDynvalue,
$myConfig->getShopId(), $oUser, $dBasketPrice, $sShipSetId);
316 $oSession->setVariable(
'paymentid', $sPaymentId);
317 $oSession->setVariable(
'dynvalue', $aDynvalue);
320 $oBasket->setTsProductId($sTsProductId);
321 $oSession->setVariable(
'stsprotection', $sTsProductId);
323 $oSession->deleteVariable(
'stsprotection');
324 $oBasket->setTsProductId(null);
326 $oBasket->setShipping($sShipSetId);
327 $oSession->deleteVariable(
'_selected_paymentid');
331 $oSession->setVariable(
'payerror', $oPayment->getPaymentErrorNumber());
334 $oSession->deleteVariable(
'paymentid');
335 $oSession->setVariable(
'_selected_paymentid', $sPaymentId);
336 $oSession->deleteVariable(
'stsprotection');
337 $oBasket->setTsProductId(null);
350 if ($this->_oPaymentList === null) {
351 $this->_oPaymentList =
false;
361 list($aAllSets, $sActShipSet, $aPaymentList) =
364 $oBasket->setShipping($sActShipSet);
368 $this->_oPaymentList = $aPaymentList;
369 $this->_aAllSets = $aAllSets;
383 if ($this->_aAllSets === null) {
384 $this->_aAllSets =
false;
401 if ($this->_iAllSetsCnt === null) {
402 $this->_iAllSetsCnt = 0;
405 $this->_iAllSetsCnt = count($this->_aAllSets);
418 protected function _setValues(& $aPaymentList, $oBasket = null)
420 if (is_array($aPaymentList)) {
421 foreach ($aPaymentList as $oPayment) {
422 $oPayment->calculate($oBasket);
423 $oPayment->aDynValues = $oPayment->getDynValues();
424 if ($oPayment->oxpayments__oxchecked->value) {
425 $this->_sCheckedId = $oPayment->getId();
478 return !$this->
getConfig()->getConfigParam(
'blSkipDebitOldBankInfo');
488 if ($this->_aDynValue === null) {
489 $this->_aDynValue =
false;
493 $this->_aDynValue = $aDynValue;
501 if (isset($aPaymentList[
'oxiddebitnote'])) {
516 $oUserPayment =
oxNew(
'oxuserpayment');
518 if ($oUserPayment->getPaymentByPaymentType($this->getUser(),
'oxiddebitnote')) {
519 $sUserPaymentField =
'oxuserpayments__oxvalue';
520 $aAddPaymentData =
oxRegistry::getUtils()->assignValuesFromText($oUserPayment->$sUserPaymentField->value);
523 foreach ($aAddPaymentData as $oData) {
524 if (!isset($this->_aDynValue[$oData->name]) ||
525 (isset($this->_aDynValue[$oData->name]) && !$this->_aDynValue[$oData->name])
527 $this->_aDynValue[$oData->name] = $oData->value;
541 if ($this->_sCheckedPaymentId === null) {
546 $sCheckedId = $sPaymentID;
548 $sCheckedId = $sSelectedPaymentID;
551 if ($oUser = $this->
getUser()) {
552 $oOrder =
oxNew(
'oxorder');
553 if (($sLastPaymentId = $oOrder->getLastUserPaymentType($oUser->getId()))) {
554 $sCheckedId = $sLastPaymentId;
560 if (!$sCheckedId && $this->_sCheckedId) {
566 if (isset($oPaymentList) && $oPaymentList && !isset($oPaymentList[$sCheckedId])) {
568 $sCheckedId = key($oPaymentList);
570 $this->_sCheckedPaymentId = $sCheckedId;
583 if ($this->_iPaymentCnt === null) {
584 $this->_iPaymentCnt =
false;
587 $this->_iPaymentCnt = count($oPaymentList);
601 if ($this->_aCreditYears === null) {
602 $this->_aCreditYears =
false;
604 $this->_aCreditYears = range(date(
'Y'), date(
'Y') + 10);
620 if (!is_array($aKeys) || count($aKeys) < 1) {
624 foreach ($aKeys as $sKey) {
625 if (isset($aData[$sKey]) && !empty($aData[$sKey])) {
649 $this->_blDynDataFiltered =
false;
654 $aDynData = $this->
getSession()->getVariable(
"dynvalue");
656 $aFields = array(
"kktype",
"kknumber",
"kkname",
"kkmonth",
"kkyear",
"kkpruef");
660 $this->_blDynDataFiltered =
true;
662 $aDynData[
"kktype"] = null;
663 $aDynData[
"kknumber"] = null;
664 $aDynData[
"kkname"] = null;
665 $aDynData[
"kkmonth"] = null;
666 $aDynData[
"kkyear"] = null;
667 $aDynData[
"kkpruef"] = null;
675 $this->_blDynDataFiltered =
true;
678 unset($_REQUEST[
"dynvalue"][
"kktype"]);
679 unset($_REQUEST[
"dynvalue"][
"kknumber"]);
680 unset($_REQUEST[
"dynvalue"][
"kkname"]);
681 unset($_REQUEST[
"dynvalue"][
"kkmonth"]);
682 unset($_REQUEST[
"dynvalue"][
"kkyear"]);
683 unset($_REQUEST[
"dynvalue"][
"kkpruef"]);
685 unset($_POST[
"dynvalue"][
"kktype"]);
686 unset($_POST[
"dynvalue"][
"kknumber"]);
687 unset($_POST[
"dynvalue"][
"kkname"]);
688 unset($_POST[
"dynvalue"][
"kkmonth"]);
689 unset($_POST[
"dynvalue"][
"kkyear"]);
690 unset($_POST[
"dynvalue"][
"kkpruef"]);
692 unset($_GET[
"dynvalue"][
"kktype"]);
693 unset($_GET[
"dynvalue"][
"kknumber"]);
694 unset($_GET[
"dynvalue"][
"kkname"]);
695 unset($_GET[
"dynvalue"][
"kkmonth"]);
696 unset($_GET[
"dynvalue"][
"kkyear"]);
697 unset($_GET[
"dynvalue"][
"kkpruef"]);
710 if ($this->_aTsProducts === null) {
712 $dVat = $oBasket->getAdditionalServicesVatPercent();
713 if ($dPrice = $oBasket->getPrice()->getBruttoPrice()) {
714 $oTsProtection =
oxNew(
'oxtsprotection');
715 $oTsProtection->setVat($dVat);
716 $this->_aTsProducts = $oTsProtection->getTsProducts($dPrice);
732 if ($this->_sCheckedProductId === null) {
733 $this->_sCheckedProductId =
false;
735 $this->_sCheckedProductId = $sId;
739 return $this->_sCheckedProductId;
755 $aPath[
'link'] = $this->
getLink();
769 return $this->
getConfig()->getConfigParam(
'blShowVATForPayCharge');