Commit 72b4b00a authored by David Weston's avatar David Weston

Some small changes

parent c89ab30f
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* The STPPResponse object parses the response from the SecureTrading endpoint, * The STPPResponse object parses the response from the SecureTrading endpoint,
* and puts it into a nice easy to use output. * and puts it into a nice easy to use output.
* *
* This class can be used to revisit previous transactions. All you need to do is
* give the XML response as the argument to the constructor and all will be
* revealed.
*
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
...@@ -42,10 +46,10 @@ class STPPResponse ...@@ -42,10 +46,10 @@ class STPPResponse
*/ */
public function isSuccessful() public function isSuccessful()
{ {
if(!isset($this->feed->error->code)) if(!isset($this->feed->response->error->code))
return null; return null;
return ((integer) $this->feed->error->code == 0); return ((integer) $this->feed->response->error->code == 0);
} }
...@@ -101,4 +105,17 @@ class STPPResponse ...@@ -101,4 +105,17 @@ class STPPResponse
return $set; return $set;
} }
/**
* Check if the response indicated that this request/response pair
* actually is associated with the testing environment or not.
*/
public function isLiveEnvironment()
{
if(!isset($this->feed->response->live))
return null;
return ((integer) $this->feed->response->live == 1);
}
} }
\ No newline at end of file
...@@ -299,6 +299,9 @@ class STAPI ...@@ -299,6 +299,9 @@ class STAPI
$method, $method,
); );
if(!method_exists($callback[0], $callback[1]))
return null;
$result = call_user_func_array($callback, $arguments); $result = call_user_func_array($callback, $arguments);
if($result instanceof STPPObject) if($result instanceof STPPObject)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment