GetTransaction Example

Below is an example nudge page: It recieves the Token as post data, and then uses it to call GetTransaction.

For the technical details of the API call, click here.

You need to specify:

  • Your Merchant and Authentication codes
  • The token for the transaction you wish to check

You usually use this in one of two places:

  1. A page set up to recieve the Nudge
  2. On your Successful or Unsuccessful redirect pages

  • PHP
  • C#
Loading ...
$token = $_POST["Token"];
if(is_null($token)) {
	$token = $_GET["token"];
 $auth = base64_encode('S61xxxxx:AuthCode1234');
 $header = array();
 $header[] = 'Authorization: Basic '.$auth;
 $ch = curl_init("".urlencode($token));
 //See the cURL documentation for more information:
 //We recommend using this bundle:
 curl_setopt( $ch, CURLOPT_CAINFO, "ca-bundle.crt");
 curl_setopt( $ch, CURLOPT_HTTPHEADER, $header);
 curl_setopt( $ch, CURLOPT_HEADER, 0);
 curl_setopt( $ch, CURLOPT_POST, 0);
 curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0);
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
 $response = curl_exec( $ch );
 curl_close ($ch);
 $json = json_decode($response, true);

Once you have completed get transaction call, there are other integration steps required. Return to the Integration Overview to understand and complete the remaining integration work.

gettransactionexample.txt · Last modified: 2017/10/24 10:03 (external edit)