Пример #1
0
 /**
  * Executes Trusted shops protection order.
  *
  * @param oxBasket $oBasket basket object
  *
  * @return bool
  */
 protected function _executeTsProtection(oxBasket $oBasket)
 {
     $aValues['tsProductId'] = $this->oxorder__oxtsprotectid->value;
     $aValues['amount'] = $oBasket->getTsInsuredSum();
     $oCur = $this->getConfig()->getActShopCurrencyObject();
     $aValues['currency'] = $oCur->name;
     $aValues['buyerEmail'] = $this->oxorder__oxbillemail->value;
     $aValues['shopCustomerID'] = $this->oxorder__oxuserid->value;
     $aValues['shopOrderID'] = $this->oxorder__oxordernr->value;
     $aValues['orderDate'] = $this->oxorder__oxorderdate->value;
     $sPaymentId = $oBasket->getPaymentId();
     /** @var oxTsProtection $oTsProtection */
     $oTsProtection = oxNew('oxtsprotection');
     $oTsProtection->requestForTsProtection($aValues, $sPaymentId);
     return true;
 }
Пример #2
0
 /**
  * Check is valid Paymorrow payment method was used in the checkout ir not.
  *
  * @param oxBasket $oBasket
  *
  * @return bool
  */
 protected function _wasPaymorrowPaymentUsed(oxBasket $oBasket)
 {
     /** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */
     $oPayment = oxNew('OxpsPaymorrowOxPayment');
     if ($oPayment->load($oBasket->getPaymentId()) and $oPayment->isPaymorrowActiveAndMapped()) {
         return true;
     }
     return false;
 }
Пример #3
0
 /**
  * Executes Trusted shops protection order. On failure -
  * deletes order and returns error code or 6.
  *
  * @param oxBasket $oBasket basket object
  *
  * @return mixed
  */
 protected function _executeTsProtection(oxBasket $oBasket)
 {
     $aValues['tsProductId'] = $this->oxorder__oxtsprotectid->value;
     $aValues['amount'] = $oBasket->getPrice()->getBruttoPrice();
     $oCur = $this->getConfig()->getActShopCurrencyObject();
     $aValues['currency'] = $oCur->name;
     $aValues['buyerEmail'] = $this->oxorder__oxbillemail->value;
     $aValues['shopCustomerID'] = $this->oxorder__oxuserid->value;
     $aValues['shopOrderID'] = $this->oxorder__oxordernr->value;
     $aValues['orderDate'] = $this->oxorder__oxorderdate->value;
     $sPaymentId = $oBasket->getPaymentId();
     $oTsProtection = oxNew('oxtsprotection');
     $blRes = $oTsProtection->requestForTsProtection($aValues, $sPaymentId);
     /*if ( !$blRes ) {
           $this->delete();
           return self::ORDER_STATE_INVALIDTSPROTECTION;
       }*/
     return true;
     // everything fine
 }