developer:soap-1.6:methods:gettransaction

Soap API v1.6

getTransaction

Retrieves all details of a specified transaction.

Description

Use this method to view all of the details relating to a particular transaction including transaction status, type, and gateway response.

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 getTransactionStatus, getTransactionCustom, searchTransactions, searchTransactionsCustom, getTransactionReport

Syntax

TransactionObject getTransaction ( 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.

Return Value

TransactionObject Returns all information for a specified transaction, including the transaction status, gateway response, date and time of transaction, credit card specific data, transaction amount, cardholder name and address, and all other transaction details.

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=1009411; 
 
  $res=$client->getTransaction($token, $RefNum);  
  print_r($res); 
 
} 
 
catch (SoapFault $e){ 
  die("getTransaction failed :" .$e->getMessage()); 
} 
 
?>

Java

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

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

.NET VB

 Dim client As usaepay.usaepayService = New usaepay.usaepayService
        Dim token As usaepay.ueSecurityToken
 
        token = Me.CreateToken("714SSUxv1uohng2XkMJ7kLpETsu58G66", "1234")
        Dim refnum As Integer
 
        refnum = 46993430
 
        Dim response As usaepay.TransactionObject
 
        response = client.getTransaction(token, refnum)
 
        MsgBox("Transaction Type: " & response.TransactionType)

.NET C#

For directions on how to set up the WSDL link and create the “token” and “client” variables, go to the C Sharp .Net Soap How-to.

            string refnum;
            refnum = "46973526";
 
            usaepay.TransactionObject tran = new usaepay.TransactionObject();
 
            try
            {
                tran = client.getTransaction(token, refnum);
                MessageBox.Show(string.Concat("Transaction RefNum: ",
                            tran.Response.RefNum));
 
 
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
 
            }

XML

Request:

<?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:getTransaction>
            <Token xsi:type="ns1:ueSecurityToken">
               <ClientIP xsi:type="xsd:string">123.123.123.123</ClientIP>
               <PinHash xsi:type="ns1:ueHash">
                  <HashValue xsi:type="xsd:string">c1d4b65ab1d56024278889d6f88919dc2e1b1967</HashValue>
                  <Seed xsi:type="xsd:string">1255252487-test</Seed>
                  <Type xsi:type="xsd:string">sha1</Type>
               </PinHash>
               <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
            </Token>
            <RefNum xsi:type="xsd:integer">102230299</RefNum>
         </ns1:getTransaction>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

Response:

<?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:getTransactionResponse>
      <getTransactionReturn xsi:type="ns1:TransactionObject">
        <AccountHolder xsi:type="xsd:string">Tester Jones</AccountHolder>
        <BillingAddress xsi:type="ns1:Address">
          <City xsi:type="xsd:string"></City>
          <Company xsi:type="xsd:string"></Company>
          <Country xsi:type="xsd:string"></Country>
          <Email xsi:type="xsd:string"></Email>
          <Fax xsi:type="xsd:string"></Fax>
          <FirstName xsi:type="xsd:string"></FirstName>
          <LastName xsi:type="xsd:string"></LastName>
          <Phone xsi:type="xsd:string"></Phone>
          <State xsi:type="xsd:string"></State>
          <Street xsi:type="xsd:string"></Street>
          <Street2 xsi:type="xsd:string"></Street2>
          <Zip xsi:type="xsd:string"></Zip>
        </BillingAddress>
        <CheckData xsi:type="ns1:CheckData">
          <Account xsi:nil="true" />
          <Routing xsi:nil="true" />
        </CheckData>
        <CheckTrace xsi:type="ns1:CheckTrace" />
        <ClientIP xsi:type="xsd:string"></ClientIP>
        <CreditCardData xsi:type="ns1:CreditCardData">
          <AvsStreet xsi:type="xsd:string">1234 Main Street</AvsStreet>
          <AvsZip xsi:type="xsd:string">99281</AvsZip>
          <CardCode xsi:type="xsd:string">XXX</CardCode>
          <CardExpiration xsi:type="xsd:string">XXXX</CardExpiration>
          <CardNumber xsi:type="xsd:string">XXXXXXXXXXXX7779</CardNumber>
          <CardPresent xsi:type="xsd:boolean">false</CardPresent>
          <CardType xsi:type="xsd:string">V</CardType>
          <InternalCardAuth xsi:type="xsd:boolean">false</InternalCardAuth>
          <MagStripe xsi:type="xsd:string"></MagStripe>
          <MagSupport xsi:type="xsd:string"></MagSupport>
          <Pares xsi:type="xsd:string"></Pares>
          <TermType xsi:type="xsd:string"></TermType>
        </CreditCardData>
        <CustomerID xsi:type="xsd:string"></CustomerID>
        <CustomFields SOAP-ENC:arrayType="ns1:FieldValue[0]" xsi:type="ns1:FieldValueArray" />
        <DateTime xsi:type="xsd:string">2015-11-19 16:20:13</DateTime>
        <Details xsi:type="ns1:TransactionDetail">
          <Amount xsi:type="xsd:double">4</Amount>
          <Clerk xsi:type="xsd:string"></Clerk>
          <Currency xsi:type="xsd:string"></Currency>
          <Description xsi:type="xsd:string">Example Transaction</Description>
          <Comments xsi:type="xsd:string"></Comments>
          <Discount xsi:type="xsd:double">0</Discount>
          <Invoice xsi:type="xsd:string">520009908</Invoice>
          <NonTax xsi:type="xsd:boolean">false</NonTax>
          <OrderID xsi:type="xsd:string"></OrderID>
          <PONum xsi:type="xsd:string"></PONum>
          <Shipping xsi:type="xsd:double">0</Shipping>
          <Subtotal xsi:type="xsd:double">0</Subtotal>
          <Table xsi:type="xsd:string"></Table>
          <Tax xsi:type="xsd:double">0</Tax>
          <Terminal xsi:type="xsd:string"></Terminal>
          <Tip xsi:type="xsd:double">0</Tip>
        </Details>
        <LineItems SOAP-ENC:arrayType="ns1:LineItem[0]" xsi:type="ns1:LineItemArray" />
        <Response xsi:type="ns1:TransactionResponse">
          <AcsUrl xsi:nil="true" />
          <AuthAmount xsi:type="xsd:double">4</AuthAmount>
          <AuthCode xsi:type="xsd:string">071044</AuthCode>
          <AvsResult xsi:type="xsd:string">Address: Match &amp; 5 Digit Zip: Match</AvsResult>
          <AvsResultCode xsi:type="xsd:string">YYY</AvsResultCode>
          <BatchNum xsi:type="xsd:integer">1911</BatchNum>
          <BatchRefNum xsi:type="xsd:integer">198442</BatchRefNum>
          <CardCodeResult xsi:type="xsd:string">Match</CardCodeResult>
          <CardCodeResultCode xsi:type="xsd:string">M</CardCodeResultCode>
          <CardLevelResult xsi:nil="true" />
          <CardLevelResultCode xsi:nil="true" />
          <ConversionRate xsi:type="xsd:double">0</ConversionRate>
          <ConvertedAmount xsi:type="xsd:double">0</ConvertedAmount>
          <ConvertedAmountCurrency xsi:type="xsd:string"></ConvertedAmountCurrency>
          <CustNum xsi:type="xsd:integer">0</CustNum>
          <Error xsi:type="xsd:string">Approved</Error>
          <ErrorCode xsi:type="xsd:integer">0</ErrorCode>
          <isDuplicate xsi:type="xsd:boolean">false</isDuplicate>
          <Payload xsi:nil="true" />
          <RefNum xsi:type="xsd:integer">102230299</RefNum>
          <Result xsi:type="xsd:string">Approved</Result>
          <ResultCode xsi:type="xsd:string">A</ResultCode>
          <Status xsi:type="xsd:string">Pending</Status>
          <StatusCode xsi:type="xsd:string">P</StatusCode>
          <VpasResultCode xsi:nil="true" />
        </Response>
        <ServerIP xsi:type="xsd:string">209.37.25.121</ServerIP>
        <ShippingAddress xsi:type="ns1:Address">
          <City xsi:type="xsd:string"></City>
          <Company xsi:type="xsd:string"></Company>
          <Country xsi:type="xsd:string"></Country>
          <Email xsi:type="xsd:string"></Email>
          <Fax xsi:type="xsd:string"></Fax>
          <FirstName xsi:type="xsd:string"></FirstName>
          <LastName xsi:type="xsd:string"></LastName>
          <Phone xsi:type="xsd:string"></Phone>
          <State xsi:type="xsd:string"></State>
          <Street xsi:type="xsd:string"></Street>
          <Street2 xsi:type="xsd:string"></Street2>
          <Zip xsi:type="xsd:string"></Zip>
        </ShippingAddress>
        <Source xsi:type="xsd:string">XML Trace Key</Source>
        <Status xsi:type="xsd:string">Authorized (Pending Settlement)</Status>
        <TransactionType xsi:type="xsd:string">Sale</TransactionType>
        <User xsi:type="xsd:string">auto</User>
      </getTransactionReturn>
    </ns1:getTransactionResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Change History

Version Change
1.1 Method added prior to soap-1.1
developer/soap-1.6/methods/gettransaction.txt · Last modified: 2015/11/19 16:48 by yaya

Page Tools