developer:soap-1.3:methods:renderreceiptbyname

Soap API v1.3

renderReceiptByName

Retrieve a receipt for a transaction

Description

This method allows you to render a receipt template for a given transaction.

RefNum referers to the gateway assigned transaction identifier. ReceiptName refers to the name of the receipt. ContentType refers to the type of receipt requested.

Returns base64 encode receipt. If an error occurs, an exception will be thrown.

See also renderReceipt

Syntax

string renderReceiptByName ( ueSecurityToken, RefNum, ReceiptName, ContentType )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
integer RefNum Gateway assigned transaction ID
string ReceiptName Name of receipt to render
string ContentType Format of receipt (HTML or Text)

Return Value

string Returns base64 encoded receipt

Exceptions

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

Code Message Advice
20001 Specified transactions was not found Specified RefNum does not match a transaction for this merchant.
20030 Requested receipt not found ReceiptRefNum must match an existing receipt.
20031 Invalid content type ContentType must be either Text, HTML or Both

Examples

PHP

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

<?php 
 
try { 
  $ReceiptName = "mycartreceipt;
  $RefNum = 1102910;
  $receipt = $client->renderReceiptByName($token, $RefNum, $ReceiptName, "HTML"); 
  $receipt = base64_decode($receipt);
} 
 
catch(SoapFault $e) { 
 
  echo $e->getMessage(); 
 
} 
 
?> 

VB

Dim receiptName As String
        receiptName = "test receipt"
        Dim refNum As String
        refNum = "46981789"
        Dim contentType As String
        contentType = "text"
        Dim response As String
        response = client.renderReceiptByName(token, refNum, receiptName, contentType)
        Dim todecode As Byte()
        todecode = Convert.FromBase64String(response)
        MsgBox(System.Text.Encoding.UTF8.GetString(todecode))

.NET C#

string refNum = "46981789";
            string receiptName = "test receipt";
            string ContentType = "text";
            string response;
 
            try
            {
                response = client.renderReceiptByName(token, refNum, receiptName, ContentType);
                byte[] todecode = Convert.FromBase64String(response);
                MessageBox.Show(string.Concat(System.Text.Encoding.UTF8.GetString(todecode)));
 
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }

XML

Request:

 

Response:

 

Change History

Version Change
1.3 Method added in this release
developer/soap-1.3/methods/renderreceiptbyname.txt · Last modified: 2010/10/13 15:56 by irina

Page Tools