getTransactionCustom

Retrieves only selected details of a specified transaction.

Description

If only a small subset of the transaction data is needed, use this method instead of the broader getTransaction retrieval method. This method returns only the data requested in the Fields parameters and is therefore more efficient than the getTransaction method.

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.

Specify which transaction fields you would like to retrieve data from by entering one or more of the following:

  • Response.AuthCode
  • Response.AvsResult
  • Response.AvsResultCode
  • Response.BatchNum
  • Response.CardCodeResult
  • Response.CardCodeResultCode
  • Response.ConversionRate
  • Response.ConvertedAmount
  • Response.ConvertedAmountCurrency
  • Response.Error
  • Response.ErrorCode
  • Response.RefNum
  • Response.Result
  • Response.ResultCode
  • Response.Status
  • Response.StatusCode
  • CheckTrace.TrackingNum
  • CheckTrace.Effective
  • CheckTrace.Processed
  • CheckTrace.Settled
  • CheckTrace.Returned
  • CheckTrace.BankNote
  • DateTime
  • AccountHolder
  • Details.Invoice
  • Details.PoNum
  • Details.OrderID
  • Details.Clerk
  • Details.Terminal
  • Details.Table
  • Details.Description
  • Details.Amount
  • Details.Currency
  • Details.Tax
  • Details.Tip
  • Details.NonTax
  • Details.Shipping
  • Details.Discount
  • Details.Subtotal
  • CreditCardData.CardType
  • CreditCardData.CardNumber
  • CreditCardData.CardExpiration
  • CreditCardData.CardCode
  • CreditCardData.AvsStreet
  • CreditCardData.AvsZip
  • CreditCardData.CardPresent
  • CheckData.CheckNumber
  • CheckData.Routing
  • CheckData.Account
  • CheckData.SSN
  • CheckData.DriversLicense
  • CheckData.DriversLicenseState
  • CheckData.RecordType
  • User
  • Source
  • ServerIP
  • ClientIP
  • CustomerID
  • BillingAddress.FirstName
  • BillingAddress.LastName
  • BillingAddress.Company
  • BillingAddress.Street
  • BillingAddress.Street2
  • BillingAddress.City
  • BillingAddress.State
  • BillingAddress.Zip
  • BillingAddress.Country
  • BillingAddress.Phone
  • BillingAddress.Fax
  • BillingAddress.Email
  • ShippingAddress.FirstName
  • ShippingAddress.LastName
  • ShippingAddress.Company
  • ShippingAddress.Street
  • ShippingAddress.Street2
  • ShippingAddress.City
  • ShippingAddress.State
  • ShippingAddress.Zip
  • ShippingAddress.Country
  • ShippingAddress.Phone
  • ShippingAddress.Fax
  • ShippingAddress.Email

See also getTransactionStatus, getTransaction, searchTransactions, searchTransactionsCustom, getTransactionReport

Syntax

FieldValue getTransactionCustom ( ueSecurityToken Token, string RefNum, string Fields )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
string RefNum Unique transaction reference number assigned by the gateway. You can also use TransKey in the RefNum field.
string Fields An array listing the fields to be retrieved.

Return Value

Type Description
FieldValue Returns requested data from specified transaction. Possible values include transaction status, gateway response, date and time of transaction, credit card specific data, transaction amount, cardholder name and address, and any other transaction details entered in the request.

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;
      $Fields = array(
        'Details.Amount',
        'AccountHolder',  
        'CheckTrace.TrackingNum'
        );

      $res=$client->getTransactionCustom($token, $RefNum, $Fields);  
      print_r($res);

    }

    catch (SoapFault $e) {
      echo $client->__getLastResponse();
      die("Get Transaction 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 fields from.
      BigInteger RefNum = new BigInteger();

      StringArray fields = new StringArray();

      fields.add(new String("Details.Amount"));

      FieldValueArray Response;

      Response = client.getTransactionCustom(token, refnum, fields);
    } catch (Exception e) {
        System.out.println("Soap Exception: " + e.getMessage());
    }

.NET VB

    Dim refnum As String
    refnum = 46976537
    Dim fields(0 To 2) As String

    fields(0) = "Details.Amount"
    fields(1) = "AccountHolder"
    fields(2) = "CreditCardData.AvsStreet"

    Dim tran(0 To 2) As usaepay.FieldValue
    For i As Integer = 0 To 2
        tran(i) = New usaepay.FieldValue()
    Next i

    tran = client.getTransactionCustom(token, refnum, fields)
    MsgBox(tran(0).Value & " " & tran(1).Value & " " & tran(2).Value)

.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;
            string[] fields = new string[3];

            fields[0] = "Details.Amount";
            fields[1] = "AccountHolder";
            fields[2] = "CreditCardData.AvsStreet";

            refnum = "46976537";

            usaepay.FieldValue[] tran = new usaepay.FieldValue[3];

            for (int i = 0; i < 3; i++)
            {
                tran[i] = new usaepay.FieldValue();
            }

            try
            {
                tran = client.getTransactionCustom(token, refnum,fields);

                    MessageBox.Show(string.Concat("Transaction Approved, RefNum: ",
                            tran[0].Field," = ",tran[0].Value, " ",
                            tran[0].Field," = ",tran[1].Value, " ",
                            tran[0].Field," = ",tran[2].Value));

            }


            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:getTransactionCustom>
                <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">21013136958b134b14ddd66a3be80049e70625ea</HashValue>
                      <Seed xsi:type="xsd:string">1967295471-test</Seed>
                      <Type xsi:type="xsd:string">sha1</Type>
                   </PinHash>
                   <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
                </Token>
                <RefNum xsi:type="xsd:string">102284059</RefNum>
                <Fields SOAP-ENC:arrayType="xsd:string[5]" xsi:type="ns1:stringArray">
                   <item xsi:type="xsd:string">Response.AvsResult</item>
                   <item xsi:type="xsd:string">Response.BatchNum</item>
                   <item xsi:type="xsd:string">Response.RefNum</item>
                   <item xsi:type="xsd:string">Response.Status</item>
                   <item xsi:type="xsd:string">Details.Amount</item>
                </Fields>
             </ns1:getTransactionCustom>
          </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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
        <ns1:getTransactionCustomResponse>
          <getTransactionCustomReturn SOAP-ENC:arrayType="ns1:FieldValue[5]" xsi:type="ns1:FieldValueArray">
            <item xsi:type="ns1:FieldValue">
              <Field xsi:type="xsd:string">Response.AvsResult</Field>
              <Value xsi:type="xsd:string">Address: Match &amp; 5 Digit Zip: Match</Value>
            </item>
            <item xsi:type="ns1:FieldValue">
              <Field xsi:type="xsd:string">Response.BatchNum</Field>
              <Value xsi:type="xsd:string">1911</Value>
            </item>
            <item xsi:type="ns1:FieldValue">
              <Field xsi:type="xsd:string">Response.RefNum</Field>
              <Value xsi:type="xsd:string">102284059</Value>
            </item>
            <item xsi:type="ns1:FieldValue">
              <Field xsi:type="xsd:string">Response.Status</Field>
              <Value xsi:type="xsd:string">Pending</Value>
            </item>
            <item xsi:type="ns1:FieldValue">
              <Field xsi:type="xsd:string">Details.Amount</Field>
              <Value xsi:type="xsd:string">4.00</Value>
            </item>
          </getTransactionCustomReturn>
        </ns1:getTransactionCustomResponse>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 TransKey can be used in RefNum field.