getReceipt

Retrieve a receipt template identified by ReceiptRefNum.

Description

This method allows you to retrieve the receipt template identified by ReceiptRefNum. The ReceiptRefNum is the ID assigned by the gateway when the receipt template was added.

If successful this method will return a Receipt object. If receipt is not found and exception will be thrown.

See also addReceipt, getReceipts, updateReceipt

Syntax

Receipt getReceipt ( ueSecurityToken, string ReceiptRefNum)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string ReceiptRefNum ID of receipt

Return Value

Name Description
Receipt Returns a Receipt object for the requested receipt.

Exceptions

The following exceptions (errors) are applicable to this method.

Code Message Advice
20030 Requested receipt not found No receipts were matched using ReceiptRefNum.

Examples

PHP

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


    try {

      $ReceiptRefNum = 1;
      $res = $client->getReceipt($token, $ReceiptRefNum);

      echo base64_decode($res->TemplateText);
    }

    catch(SoapFault $e) {

      echo $e->getMessage();

    }

VB

    Dim receipt As newtek.Receipt
            Dim receiptNum As String
            receiptNum = "2"
            receipt = client.getReceipt(token, receiptNum)
            MsgBox(receipt.Name)

.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 receiptNumber = "5";
                newtek.Receipt receipt = new newtek.Receipt();

                try
                {
                    receipt = client.getReceipt(token, receiptNumber);
                    MessageBox.Show(string.Concat(receipt.Name));

                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }

XML (RPC/Encoded)

Request:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:newtek" 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:getReceipt>
    <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">1787075eece01c89dc06a962580e2719bd92c78d</HashValue>
    <Seed xsi:type="xsd:string">1172863218-test</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
    <ReceiptRefNum xsi:type="xsd:string">4</ReceiptRefNum>
    </ns1:getReceipt>
    </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:newtek"
    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:getReceiptResponse>
    <getReceiptReturn xsi:type="ns1:Receipt">
    <ReceiptRefNum xsi:type="xsd:string">4</ReceiptRefNum>
    <Name xsi:type="xsd:string">tranapi</Name>
    <Subject xsi:type="xsd:string">Transaction[result.response]-Invoice#
    [post.UMinvoice]</Subject>
    <FromEmail xsi:type="xsd:string">test@tmcode.com</FromEmail>
    <Target xsi:type="xsd:string">email</Target>
    <ContentType xsi:type="xsd:string">text</ContentType>
    <TemplateHTML xsi:type="xsd:string"></TemplateHTML>
    <TemplateText xsi:type="xsd:string">VHJhbnNhY3Rpb24gUmVzdWx0DQotLS0tL
    S0tLS0tLS0tLS0tLS0tLS0tLQ0KRGF0ZTogICAgICAgICAgW3Jlc3VsdC5kYXRlXQ0KW2
    lmIHJlc3VsdC5yZXNwb25zZUNvZGU9QV1SZWZlcmVu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tLS0tLS0tLS0NCltwb3N0LmV4dHJhZmllbGRzXQ0KWy9pZ
    l0NCg0KW2lmIHRyYW5zYWN0aW9uLmhhc2xpbmVpdGVtcz1ZXQ0KT3JkZXIgRGV0YWlscw
    0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NClt0cmFuc2FjdGlvbi5saW5laXRlbXNdDQp
    bL2lmXQ0KDQoNCnY4LjItdWUtZy1t</TemplateText>
    </getReceiptReturn>
    </ns1:getReceiptResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 Changed ReceiptRefNum to type string