getReceipt

Parent Previous Next

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.

 

Syntax

 

Receipt getReceipt ( ueSecurityToken, ReceiptRefNum)

 

Arguments

 

Type

Name

Description

ueSecurityToken

Token

Merchant security token: used to identify merchant and retrieve the custom fields.

integer

ReceiptRefNum

ID of receipt

 

Return Value

 

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

 

<?php

try {

 $ReceiptRefNum = 1;

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

 echo base64_decode($res->TemplateText);

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

 

VB

 

Dim receipt As eBizCharge.Receipt

       Dim receiptNum As String

       receiptNum = "2"

       receipt = client.getReceipt(token, receiptNum)

       MsgBox(receipt.Name)

 

 

.NET C#

 

          string receiptNumber = "5";

           eBizCharge.Receipt receipt = new eBizCharge.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:eBizCharge"

       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">192.168.0.1</ClientIP>

<PinHash xsi:type="ns1:ueHash">

<HashValue xsi:type="xsd:string">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>

<Seed xsi:type="xsd:string">12678150211876663375</Seed>

<Type xsi:type="xsd:string">sha1</Type>

</PinHash>

<SourceKey xsi:type="xsd:string">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>

</Token>

       <ReceiptRefNum xsi:type="xsd:integer">25</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:eBizCharge"

       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:integer">25</ReceiptRefNum>

       <Name xsi:type="xsd:string">test1</Name>

       <Subject xsi:type="xsd:string">test2</Subject>

       <FromEmail xsi:type="xsd:string">test@testing3.com</FromEmail>

       <Target xsi:type="xsd:string">email</Target>

       <ContentType xsi:type="xsd:string">both</ContentType>

       <TemplateHTML xsi:type="xsd:string">dGVzdDM=</TemplateHTML>

       <TemplateText xsi:type="xsd:string">dGVzdDQ=</TemplateText>

       </getReceiptReturn>

</ns1:getReceiptResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

: