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

Some small changes

parent c89ab30f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* The addressable object includes functionality for addresses and such, as * The addressable object includes functionality for addresses and such, as
* quite a lot of functionality is shared between billing and customers, for * quite a lot of functionality is shared between billing and customers, for
* example. * example.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* the card and the like. It's recommended that everything stuck into * the card and the like. It's recommended that everything stuck into
* this class matches the name registered on the card. Addresses * this class matches the name registered on the card. Addresses
* are also key. * are also key.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Customer information does not constitute billing information, so there's * Customer information does not constitute billing information, so there's
* no real need to fill in anything like addresses and such - however there * no real need to fill in anything like addresses and such - however there
* /is/ a recommendation from ST to do so. * /is/ a recommendation from ST to do so.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Merchant information is usually not required when using STPP, however * Merchant information is usually not required when using STPP, however
* it is a required feature for 3D-Secure, which most if not all * it is a required feature for 3D-Secure, which most if not all
* transactions should be performed using (if available). * transactions should be performed using (if available).
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* This is the god object for all parts of the request, such as * This is the god object for all parts of the request, such as
* the merchant, operations and such. * the merchant, operations and such.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* The operation object contains some other information that is needed * The operation object contains some other information that is needed
* to complete the request. * to complete the request.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -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
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* PHP based wrapper for SecureTrading's new STPP protocol. * PHP based wrapper for SecureTrading's new STPP protocol.
* *
* This is the object that represents updated settlement details. * This is the object that represents updated settlement details.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* This won't allow you to connect your system immediately * This won't allow you to connect your system immediately
* to a setup, however, it'll allow you to with ease create * to a setup, however, it'll allow you to with ease create
* and maintain a new contract with a SecureTrading node. * and maintain a new contract with a SecureTrading node.
* *
* @version: untested * @version: untested
* @author: David Weston <stpp@typefish.co.uk> * @author: David Weston <stpp@typefish.co.uk>
*/ */
...@@ -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