Source of file PxPayMessage.php
Size: 2,829 Bytes - Last Modified: 2021-12-23T10:33:28+00:00
/var/www/docs.ssmods.com/process/src/code/DPSPayment/thirdparty/dps_hosted_helper/PxPayMessage.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 | <?php #****************************************************************************** # Abstract base class for PxPay messages. # These are messages with certain defined elements, which can be serialized to XML. #****************************************************************************** class PxPayMessage { public $TxnType; public $TxnData1; public $TxnData2; public $TxnData3; public $MerchantReference; public $EmailAddress; public $BillingId; public $DpsBillingId; public $DpsTxnRef; public function PxPayMessage() { } public function setDpsTxnRef($DpsTxnRef) { $this->DpsTxnRef = $DpsTxnRef; } public function getDpsTxnRef() { return $this->DpsTxnRef; } public function setDpsBillingId($DpsBillingId) { $this->DpsBillingId = $DpsBillingId; } public function getDpsBillingId() { return $this->DpsBillingId; } public function setBillingId($BillingId) { $this->BillingId = $BillingId; } public function getBillingId() { return $this->BillingId; } public function setTxnType($TxnType) { $this->TxnType = $TxnType; } public function getTxnType() { return $this->TxnType; } public function setMerchantReference($MerchantReference) { $this->MerchantReference = $MerchantReference; } public function getMerchantReference() { return $this->MerchantReference; } public function setEmailAddress($EmailAddress) { $this->EmailAddress = $EmailAddress; } public function getEmailAddress() { return $this->EmailAddress; } public function setTxnData1($TxnData1) { $this->TxnData1 = $TxnData1; } public function getTxnData1() { return $this->TxnData1; } public function setTxnData2($TxnData2) { $this->TxnData2 = $TxnData2; } public function getTxnData2() { return $this->TxnData2; } public function getTxnData3() { return $this->TxnData3; } public function setTxnData3($TxnData3) { $this->TxnData3 = $TxnData3; } public function toXml() { $arr = get_object_vars($this); $root = strtolower(get_class($this)); #echo "<br>root:".$root; if ($root == "pxpayrequest") { $root = "GenerateRequest"; } elseif ($root == "pxpayresponse") { $root = "Response"; } else { $root ="Request"; } $xml = "<$root>"; while (list($prop, $val) = each($arr)) { $xml .= "<$prop>$val</$prop>" ; } $xml .= "</$root>"; return $xml; } } |