RenderReceipt

Retrieve a receipt for a transaction.

Description

This method is used to render a receipt template for a given transaction.

transactionRefNum refers to the gateway-assigned transaction identifier. receiptRefNum refers to the gateway-assigned ID for the receipt. receiptName refers to the receipt name. ContentType refers to the type of receipt requested.

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

Syntax

string RenderReceipt( SecurityToken securityToken, string transactionRefNum, string receiptRefNum, string receiptName, string contentType)

Arguments

TypeNameDescription
SecurityTokensecurityTokenMerchant security token: used to identify merchant. (required)
stringtransactionRefNumGateway-assigned transaction ID. (required)
stringreceiptRefNumGateway-assigned receipt ID. (required)
stringreceiptNameReceipt name. (optional)
stringcontentTypeFormat of receipt (HTML or text). (optional)

Return Value

stringReturns base64-encoded receipt.

Exceptions

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

MessageAdvice
Specified transactions was not foundSpecified transactionRefNum does not match a transaction for this merchant.
Requested receipt not foundreceiptRefNum must match an existing receipt.
Invalid content typecontentType must be either Text, HTML, or Both.

Examples

<?php 
 
try { 
  $receiptRefNum = 2;
  $transactionRefNum = 1102910;
  $receipt = $client->RenderReceipt($token, transactionRefNum, $receiptRefNum, "",  "HTML"); 
  $receipt = base64_decode($receipt);
} 
 
catch(SoapFault $e) { 
 
  echo $e->getMessage(); 
 
} 
 
?>
Request: 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:RenderReceipt>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-90b4-4a38-ad78-********</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:transactionRefNum>128351609</ebiz:transactionRefNum>
         <ebiz:receiptRefNum>115</ebiz:receiptRefNum>
         <ebiz:receiptName/>
         <ebiz:contentType>text</ebiz:contentType>
      </ebiz:RenderReceipt>
   </soapenv:Body>
</soapenv:Envelope>



Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RenderReceiptResponse xmlns="http://eBizCharge.ServiceModel.SOAP">        
        <RenderReceiptResult>WW91ciBjcmV********A0KDQoNCnY4LjAxLXVlZ3ItbQ==</RenderReceiptResult>
      </RenderReceiptResponse>
   </s:Body>
</s:Envelope>
Usman to provide payload.
  
string transactionRefNum = "46981789";
            string receiptRefNum = "6";
            string ContentType = "text";
            string response;
 
            try
            {
                response = client.RenderReceipt(token, refNum, "", receiptRefNum, ContentType);
                byte[] todecode = Convert.FromBase64String(response);
                MessageBox.Show(string.Concat(System.Text.Encoding.UTF8.GetString(todecode)));
 
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }