developer:soap-1.2:methods:gettransactionstatus

Soap API v1.2

getTransactionStatus

Retrieve the current status of a specific transaction.

Description

This method allows you to check the status of a completed transaction.

Use this method to determine if a transaction has been authorized, processed, or settled.

To specify the transaction you would like to view, you must retrieve it using the reference number (RefNum) assigned to the transaction by the gateway. The RefNum is assigned by the gateway and returned when a transaction is processed. To find a missing RefNum, use the searchTransactions method.

See also runTransaction, runQuickSale, voidTransaction, runCredit, runSale, runauthOnly, captureTransaction

Syntax

TransactionResponse getTransactionStatus ( ueSecurityToken Token, integer RefNum )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
integer RefNum Transaction Reference number assigned by the gateway.

ReturnValue

TransactionResponse Returns a TransactionResponse object containing the results of the transaction and all relevant data.

Examples

PHP

For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.

<?php 
 
try { 
 
  $refnum='1005312'; 
  print_r($client->getTransactionStatus($token,$refnum)); 
 
  } 
 
catch(SoapFault $e) { 
 
  echo $e->getMessage(); 
 
} 
 
echo "\n\nRequest: " . $tran->__getLastRequest(); 
echo "\n\nResponse: " . $tran->__getLastResponse(); 
 
 
 
?> 

Java

This example uses the USAePay Java library. For directions on how to install the library and create the token/client objects, go to either the Java JAX-RPC Howto or the Java JAX-WS Howto.

try {
  //Set RefNum to the Reference Number of transaction you 
  //want to retrieve.
  BigInteger refnum = new BigInteger();
 
  TransactionResponse response = new TransactionResponse();
 
  response = client.getTransactionStatus(token, refnum);
 
  System.out.println(response.getStatus());
} catch (Exception e) {
    System.out.println("Soap Exception: " + e.getMessage());
}

VB

    Dim client As usaepay.usaepayService = New usaepay.usaepayService
    Dim token As usaepay.ueSecurityToken
 
    token = Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "443311")
 
    Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject
 
    Dim refnum As Integer
 
    refnum = "46405618"
 
    Dim response As usaepay.TransactionResponse = New usaepay.TransactionResponse
 
    response = client.getTransactionStatus(token, refnum)
    If response.StatusCode = "P" Then
      MsgBox("Status: Pending")
    ElseIf response.StatusCode = "B" Then
      MsgBox("Status: Submitted")
    ElseIf response.StatusCode = "E" Then
      MsgBox("Status: Error, Reason: " & response.Error)
    ElseIf response.StatusCode = "N" Then
      MsgBox("Status: New Transaction")
    ElseIf response.StatusCode = "F" Then
      MsgBox("Status: Funded")
    ElseIf response.StatusCode = "S" Then
      MsgBox("Status: Settled")
    ElseIf response.StatusCode = "V" Then
      MsgBox("Status: Voided")
    ElseIf response.StatusCode = "T" Then
      MsgBox("Status: Timed Out (no response in 5 days)")
    ElseIf response.StatusCode = "R" Then
      MsgBox("Status: Returned")
    ElseIf response.StatusCode = "M" Then
      MsgBox("Status: On Hold")
    End If

.NET C#

string refnum;
            refnum = "47027872";
 
            usaepay.TransactionResponse response = new usaepay.TransactionResponse();
 
            try
            {
                response = client.getTransactionStatus(token, refnum);
                if (response.StatusCode == "V") { MessageBox.Show(string.Concat("Status: Voided")); }
                if (response.StatusCode == "B") {MessageBox.Show(string.Concat("Status: Submitted"));}
                if (response.StatusCode == "E") {MessageBox.Show(string.Concat("Status: Error, Reason: " + response.Error));}
                if (response.StatusCode == "N") {MessageBox.Show(string.Concat("Status: New transaction"));}
                if (response.StatusCode == "F") {MessageBox.Show(string.Concat("Status: Funded"));}
                if (response.StatusCode == "S") {MessageBox.Show(string.Concat("Status: Settled"));}
                if (response.StatusCode == "P") {MessageBox.Show(string.Concat("Status: Pending"));}
                if (response.StatusCode == "T") {MessageBox.Show(string.Concat("Status: Timed Out (no response in 5 days)"));}
                if (response.StatusCode == "R") {MessageBox.Show(string.Concat("Status: Returned"));}
                if (response.StatusCode == "M") { MessageBox.Show(string.Concat("Status: On hold")); }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
 
            }

XML

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
<SOAP-ENV:Body> 
<ns1:getTransactionStatus> 
<Token xsi:type="ns1:ueSecurityToken"> 
<ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP> 
<PinHash xsi:type="ns1:ueHash"> 
<HashValue xsi:type="xsd:string">e4a3cef16854af8c6495a4394050ed4c64af97ed</HashValue> 
<Seed xsi:type="xsd:string">1193689131266474060</Seed> 
<Type xsi:type="xsd:string">sha1</Type> 
</PinHash> 
<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> 
</Token> 
<RefNum xsi:type="xsd:integer">1118418</RefNum> 
</ns1:getTransactionStatus> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 
developer/soap-1.2/methods/gettransactionstatus.txt · Last modified: 2010/09/15 16:25 by irina

Page Tools