getBatchStatus

Retrieves the status of a batch specified by its BatchRefNum.

Description

This method will check on the status of any batch within the merchant console. Enter the BatchRefNum (a unique batch reference number assigned by the gateway) into the search field and the method will return the status of the requested batch.

To pull the status of the currently open batch (which has not yet passed to the gateway), use 0 for the the BatchRefNum.

See also searchBatches, closeBatch, getBatchTransactions

Syntax

BatchStatus getBatchStatus ( ueSecurityToken Token, string BatchRefNum )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
string BatchRefNum A unique batch reference number assigned by the gateway.

Return Value

Value Description
BatchStatus This method returns a BatchStatus object which includes information about the requested batch including BatchRefNum (if assigned), batch sequence, status (open, closing, or closed) dates and times when the batch was opened and closed, sales count, credit count, total settled amount and other pertinent details.

Examples

PHP

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


    try {
      $BatchRefNum=0;

      $Result=$client->getBatchStatus($token, $BatchRefNum);  
    }

    catch (SoapFault $e) {

      echo "get Batch Upload status 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 BatchNum to the Batch Reference Number of the batch
      //you want to retrieve.  0 is always the current batch
      BigInteger BatchNum = new BigInteger("0");

      BatchStatus batchstat = new BatchStatus();
      batchstat = client.getBatchStatus(token, BigInteger.ZERO);
    } catch (Exception e) {
        System.out.println("Soap Exception: " + e.getMessage());
    }

.NET VB

    Dim BatchRefNum As String
            BatchRefNum = "9581"
            Dim result as usaepay.BatchStatus = New usaepay.BatchStatus

            result = client.getBatchStatus(token, BatchRefNum)
            MsgBox(result.Status)

.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 BatchRefNum;
                BatchRefNum = "9581";

                usaepay.BatchStatus result = new usaepay.BatchStatus();

                try
                {
                    result = client.getBatchStatus(token, BatchRefNum);

                    MessageBox.Show(string.Concat(result.Status));

                }


                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:getBatchStatus>
    <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">35aa99bcb731c2eabde8c722dcda648ca49014ed</HashValue>
    <Seed xsi:type="xsd:string">11441581678-test</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
    <BatchRefNum xsi:type="xsd:string">201940</BatchRefNum>
    </ns1:getBatchStatus>
    </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:getBatchStatusResponse>
    <getBatchStatusReturn xsi:type="ns1:BatchStatus">
    <BatchRefNum xsi:type="xsd:string">201940</BatchRefNum>
    <Closed xsi:type="xsd:string"></Closed>
    <CreditsAmount xsi:type="xsd:double">0</CreditsAmount>
    <CreditsCount xsi:type="xsd:integer">0</CreditsCount>
    <NetAmount xsi:type="xsd:double">1594.2</NetAmount>
    <Opened xsi:type="xsd:string">01/26/2016T15:51:06</Opened>
    <SalesAmount xsi:type="xsd:double">1594.2</SalesAmount>
    <SalesCount xsi:type="xsd:integer">12</SalesCount>
    <Scheduled xsi:type="xsd:string"></Scheduled>
    <Sequence xsi:type="xsd:integer">1</Sequence>
    <Status xsi:type="xsd:string">Open</Status>
    <TransactionCount xsi:type="xsd:integer">12</TransactionCount>
    <VoidsAmount xsi:type="xsd:double">0</VoidsAmount>
    <VoidsCount xsi:type="xsd:integer">0</VoidsCount>
    </getBatchStatusReturn>
    </ns1:getBatchStatusResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 Changed BatchRefNum to type string