getReceiptByName

Parent Previous Next

getReceiptByName

Retrieve a receipt template identified by Name.

 

Description

This method allows you to retrieve the receipt template identified by Name. This method will return the merchant's receipt template if it exists. Otherwise, if a system default template exists for “Name” it will be returned. If a system default is returned, the ReceiptRefNum in the resulting object will be “0”.

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

 

Syntax

 

Receipt getReceiptByName ( ueSecurityToken, Name)

 

Arguments

 

Type

Name

Description

ueSecurityToken

Token

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

string

Name

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

 

Examples

 

PHP

 

<?php

try {

 $Name = 'vterm';

 $res = $client->getReceiptByName($token, $Name);

 echo base64_decode($res->TemplateText);

}

catch(SoapFault $e) {

 echo $e->getMessage();

}

?>

 

 

VB

 

Dim receipt As eBizCharge.Receipt

       Dim receiptName As String

       receiptName = "recurring"

       receipt = client.getReceiptByName(token, receiptName)

       MsgBox(receipt.ReceiptRefNum)

 

 

.NET C#

 

           string name = "test receipt";

           try

           {

               eBizCharge.Receipt receipt = client.getReceiptByName(token, name);

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

           }

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

       <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">8f63a3359735a07580f240b9eb31f776492e7793</HashValue>

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

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

               </PinHash>

               <SourceKey xsi:type="xsd:string">1B93L5cpXV5hbx557d183q96EZ2jpqEf</SourceKey>

       </Token>

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

</ns1:getReceiptByName>

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

<getReceiptByNameReturn 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:getReceiptByNameResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

: