getReceipts

Parent Previous Next

getReceipts

Retrieve list of custom receipt templates

 

Description

 

This method allows you pull a list of the receipt templates based on the target receipt type. This type can be “Email”, “Print” or “Both”.

An array of Receipt objects is returned. For efficiency reasons, the actual templates (Receipt.TemplateHTML and Receipt.TemplateText) are not returned by this method. Use getReceipt to pull the full Receipt object including the templates.

If an error occurs, an exception will be thrown.

 

Syntax

 

Receipts[] getReceipts ( ueSecurityToken, Target)

 

Arguments

 

Type

Name

Description

ueSecurityToken

Token

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

string

Target

Type of receipts to retreive (Print, Email or Both)

 

 

Return Value

 

Receipt[]

Returns an array of Receipt objects

 

Exceptions

 

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

 

Code

Message

Advice

20034

Error pulling receipt templates

'Internal server error pulling list of receipts, wait and try again or contact support

 

Examples

 

PHP

 

<?php

try {

 $templates = $client->getReceipts($token, "Email");

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

 

VB

 

Dim target As String

       target = "email"

       Dim receipt() As eBizCharge.Receipt

       receipt = client.getReceipts(token, target)

       MsgBox(receipt.Length)

 

 

.NET C#

 

           string target = "email";

           try

           {

               eBizCharge.Receipt[] receipt = client.getReceipts(token, target);

               MessageBox.Show(string.Concat(receipt.Length));

           }

           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: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:getReceipts>

<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>

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

</ns1:getReceipts>

</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: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:getReceiptsResponse>

 <getReceiptsReturn SOAP-ENC:arrayType="ns1:Receipt[2]" xsi:type="ns1:ReceiptArray">

 <item xsi:type="ns1:Receipt">

   <ReceiptRefNum xsi:type="xsd:integer">139</ReceiptRefNum>

   <Name xsi:type="xsd:string">test0</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>

 </item>

 <item xsi:type="ns1:Receipt">

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

 </item>

 </getReceiptsReturn>

</ns1:getReceiptsResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

: