txError = $xtr->ewayTrxnError; # # $this->txStatus = $xtr->ewayTrxnStatus; # # $this->txTransactionNumber = $xtr->ewayTrxnNumber; # # $this->txOption1 = $xtr->ewayTrxnOption1; # # $this->txOption2 = $xtr->ewayTrxnOption2; # # $this->txOption3 = $xtr->ewayTrxnOption3; # # $this->txAmount = $xtr->ewayReturnAmount; # # $this->txAuthCode = $xtr->ewayAuthCode; # # $this->txInvoiceReference = $xtr->ewayTrxnReference; # # # ##################################################################################### $this->txError = self::GetNodeValue("ewayTrxnError", $Xml); $this->txStatus = self::GetNodeValue("ewayTrxnStatus", $Xml); $this->txTransactionNumber = self::GetNodeValue("ewayTrxnNumber", $Xml); $this->txOption1 = self::GetNodeValue("ewayTrxnOption1", $Xml); $this->txOption2 = self::GetNodeValue("ewayTrxnOption2", $Xml); $this->txOption3 = self::GetNodeValue("ewayTrxnOption3", $Xml); $amount = self::GetNodeValue("ewayReturnAmount", $Xml); $this->txAuthCode = self::GetNodeValue("ewayAuthCode", $Xml); $this->txInvoiceReference = self::GetNodeValue("ewayTrxnReference", $Xml); $this->txBeagleScore = self::GetNodeValue("ewayBeagleScore", $Xml); $this->txAmount = (int) $amount; } /************************************************************************ * Simple function to use in place of the 'simplexml_load_string' call. * * It returns the NodeValue for a given NodeName * or returns and empty string. ************************************************************************/ function GetNodeValue($NodeName, &$strXML) { $OpeningNodeName = "<" . $NodeName . ">"; $ClosingNodeName = ""; $pos1 = stripos($strXML, $OpeningNodeName); $pos2 = stripos($strXML, $ClosingNodeName); if ( ($pos1 === false) || ($pos2 === false) ) return ""; $pos1 += strlen($OpeningNodeName); $len = $pos2 - $pos1; $return = substr($strXML, $pos1, $len); return ($return); } function TransactionNumber() { return $this->txTransactionNumber; } function InvoiceReference() { return $this->txInvoiceReference; } function Option1() { return $this->txOption1; } function Option2() { return $this->txOption2; } function Option3() { return $this->txOption3; } function AuthorisationCode() { return $this->txAuthCode; } function Error() { return $this->txError; } function Amount() { return $this->txAmount; } function Status() { return $this->txStatus; } function BeagleScore () { return $this->txBeagleScore ; } } ?>