Esempio n. 1
0
 /**
  * Set return URL
  *
  * @param string $url URL to set
  *
  * @return void
  */
 public function setReturnURL($url)
 {
     if (\XLite\Module\CDev\Paypal\Main::isExpressCheckoutEnabled() && \XLite\Module\CDev\Paypal\Main::isInContextCheckoutAvailable() && \XLite\Core\Request::getInstance()->cancelUrl) {
         $url = $this->getShopURL(\XLite\Core\Request::getInstance()->cancelUrl, \XLite\Core\Config::getInstance()->Security->customer_security);
     }
     parent::setReturnURL($url);
 }
Esempio n. 2
0
 /**
  * Return
  *
  * @return void
  */
 protected function doActionReturn()
 {
     $txnId = \XLite\Core\Request::getInstance()->txnId;
     $transaction = null;
     if ($txnId) {
         $transactionData = \XLite\Core\Database::getRepo('XLite\\Model\\Payment\\TransactionData')->findOneBy(array('value' => $txnId, 'name' => 'xpc_txnid'));
         if ($transactionData) {
             $transaction = $transactionData->getTransaction();
         }
     }
     if ($transaction) {
         if (\XLite\Core\Request::getInstance()->last_4_cc_num && \XLite\Core\Request::getInstance()->card_type && !$transaction->getCard()) {
             $transaction->saveCard('******', \XLite\Core\Request::getInstance()->last_4_cc_num, \XLite\Core\Request::getInstance()->card_type);
             \XLite\Core\Database::getEM()->flush();
         }
         $this->getIframe()->enable();
     }
     parent::doActionReturn();
 }