I have implemented Secure pay payment gateway in my website. It was working fine but from yesterday it is not working. I did not get any response from secure server. Also I am getting an error.
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: libraries/securepay.php
Line Number: 479
In securepay.php 479 number line is
($this->_TranslateServerCode($this->ResponseTree->Status->statusCode) == SECUREPAY_STATUS_OK);
and full function is below
function TestConnection() {
$this->RequestXml = $this->_ComposeEcho();
$this->ResponseXml = $this->_Dispatch($this->RequestXml);
$this->ResponseTree = simplexml_load_string($this->ResponseXml);
return ($this->_TranslateServerCode($this->ResponseTree->Status->statusCode) == SECUREPAY_STATUS_OK);
}
Below is my sample code:
include('securepay.php');
$sp = new SecurePay('ABC0001','abc123', TRUE);
$sp->TestMode();
$sp->TestConnection();
$sp->Cc = 4111111111111111;
$sp->ExpiryDate = '07/20';
$sp->ChargeAmount = 1500;
$sp->ChargeCurrency = 'AUD';
$sp->Cvv = 321;
$sp->OrderId = 'ORD34234';
if ($sp->Valid()) {
$response = $sp->Process();
if ($response == SECUREPAY_STATUS_APPROVED) {
echo "Transaction was a success
";
} else {
echo "Transaction failed with the error code: $response
";
echo "XML Dump: " . print_r($sp->ResponseXml,1) . "
";
}
} else {
die("Your data is invalid
");
}
Please help me how to solve it.