Example #1
0
 /**
  * Parses xml response object with full transaction details to Varien_Object
  *
  * @param Varien_Simplexml_Element $responseXmlDocument - xml object with full transaction details for a specified transaction ID
  * @return Varien_Object
  */
 protected function _parseTransactionDetailsXmlResponseToVarienObject(Varien_Simplexml_Element $responseXmlDocument)
 {
     $response = new Varien_Object();
     $responseTransactionXmlDocument = $responseXmlDocument->transaction;
     //main fields for generating order status:
     $response->setResponseCode((string) $responseTransactionXmlDocument->responseCode)->setResponseReasonCode((string) $responseTransactionXmlDocument->responseReasonCode)->setTransactionStatus((string) $responseTransactionXmlDocument->transactionStatus);
     //some additional fields:
     isset($responseTransactionXmlDocument->responseReasonDescription) && $response->setResponseReasonDescription((string) $responseTransactionXmlDocument->responseReasonDescription);
     isset($responseTransactionXmlDocument->FDSFilterAction) && $response->setFdsFilterAction((string) $responseTransactionXmlDocument->FDSFilterAction);
     isset($responseTransactionXmlDocument->FDSFilters) && $response->setFdsFilters(serialize($responseTransactionXmlDocument->FDSFilters->asArray()));
     isset($responseTransactionXmlDocument->transactionType) && $response->setTransactionType((string) $responseTransactionXmlDocument->transactionType);
     isset($responseTransactionXmlDocument->submitTimeUTC) && $response->setSubmitTimeUtc((string) $responseTransactionXmlDocument->submitTimeUTC);
     isset($responseTransactionXmlDocument->submitTimeLocal) && $response->setSubmitTimeLocal((string) $responseTransactionXmlDocument->submitTimeLocal);
     return $response;
 }
Example #2
0
 protected function _getBuildPaymentObject($quoteObj, $params = array('payment' => array()))
 {
     $payment = new Varien_Object();
     if (isset($params['payment']) && !empty($params['payment'])) {
         $payment->addData($params['payment']);
     }
     if (Mage::helper('sagepaysuite')->creatingAdminOrder()) {
         $payment->addData($quoteObj->getPayment()->toArray());
     }
     $payment->setTransactionType(strtoupper($this->getConfigData('payment_action')));
     $payment->setAmountOrdered($this->formatAmount($quoteObj->getGrandTotal(), $quoteObj->getQuoteCurrencyCode()));
     $payment->setRealCapture(true);
     //To difference invoice from capture
     $payment->setOrder(clone $quoteObj);
     $payment->setAnetTransType(strtoupper($this->getConfigData('payment_action')));
     $payment->getOrder()->setOrderCurrencyCode($quoteObj->getQuoteCurrencyCode());
     $payment->getOrder()->setBillingAddress($quoteObj->getBillingAddress());
     if ($quoteObj->isVirtual()) {
         $payment->getOrder()->setShippingAddress($quoteObj->getBillingAddress());
     } else {
         $payment->getOrder()->setShippingAddress($quoteObj->getShippingAddress());
     }
     return $payment;
 }
Example #3
0
 protected function _getBuildPaymentObject($quoteObj, $params = array('payment' => array()))
 {
     $payment = new Varien_Object();
     if (isset($params['payment'])) {
         $payment->addData($params['payment']);
     }
     $billingAddressObj = $this->_getQuote()->getBillingAddress();
     $shippingAddressObj = $this->_getQuote()->getShippingAddress();
     $payment->setTransactionType(strtoupper($this->getConfigData('payment_action')));
     $payment->setAmountOrdered($this->formatAmount($this->_getQuote()->getGrandTotal(), $this->_getQuote()->getQuoteCurrencyCode()));
     $payment->setRealCapture(true);
     //To difference invoice from capture
     $payment->setOrder(new Varien_Object($this->_getQuote()->toArray()));
     $payment->setAnetTransType(strtoupper($this->getConfigData('payment_action')));
     $payment->getOrder()->setOrderCurrencyCode($this->_getQuote()->getQuoteCurrencyCode());
     $payment->getOrder()->setBillingAddress($this->_getQuote()->getBillingAddress());
     $payment->getOrder()->setShippingAddress($this->_getQuote()->getShippingAddress());
     return $payment;
 }