Example #1
0
 /**
  * Convert xml object to a Varien object.
  *
  * @param SimpleXMLElement $xml Xml response from the API.
  * @return object Api response into a Varien object.
  */
 private function _mapTranscationDetails(SimpleXMLElement $xml)
 {
     $object = new Varien_Object();
     $object->setErrorcode($xml->errorcode);
     $object->setTimestamp($xml->timestamp);
     if ((string) $xml->errorcode === '0000') {
         $object->setVpstxid($xml->vpstxid);
         $object->setContactNumber($xml->contactnumber);
         $object->setVendortxcode($xml->vendortxcode);
         $object->setTransactiontype($xml->transactiontype);
         $object->setStatus($xml->status);
         $object->setDescription($xml->description);
         $object->setAmount($xml->amount);
         $object->setCurrency($xml->currency);
         $object->setStarted($xml->started);
         $object->setCompleted($xml->completed);
         $object->setSecuritykey($xml->securitykey);
         $object->setClientip($xml->clientip);
         $object->setIplocation($xml->iplocation);
         $object->setGiftaid($xml->giftaid);
         $object->setPaymentsystem($xml->paymentsystem);
         $object->setPaymentsystemdetails($xml->paymentsystemdetails);
         $object->setAuthprocessor($xml->authprocessor);
         $object->setMerchantnumber($xml->merchantnumber);
         $object->setAccounttype($xml->accounttype);
         $object->setBillingaddress($xml->billingaddress);
         $object->setBillingpostcode($xml->billingpostcode);
         $object->setDeliveryaddress($xml->deliveryaddress);
         $object->setDeliverypostcode($xml->deliverypostcode);
         $object->setSystemused($xml->systemused);
         $object->setCustomeremail($xml->customeremail);
         $object->setAborted($xml->aborted);
         $object->setRefunded($xml->refunded);
         $object->setRepeated($xml->repeated);
         $object->setBasket($xml->basket);
         $object->setApplyavscv2($xml->applyavscv2);
         $object->setApply3dsecure($xml->apply3dsecure);
         $object->setAttempt($xml->attempt);
         $object->setCardholder($xml->cardholder);
         $object->setCardaddress($xml->cardaddress);
         $object->setCardpostcode($xml->cardpostcode);
         $object->setStartdate($xml->startdate);
         $object->setExpirydate($xml->expirydate);
         $object->setLast4digits($xml->last4digits);
         $object->setThreedresult($xml->threedresult);
         $object->setEci($xml->eci);
         $object->setCavv($xml->cavv);
         $object->setT3mscore($xml->t3mscore);
         $object->setT3maction($xml->t3maction);
         $object->setT3mid($xml->t3mid);
     } else {
         $object->setError(htmlentities($xml->error));
     }
     return $object;
 }