RenderReceipt

Retrieve a receipt for a transaction.

Description

This method allows you 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

Type

Name

Description

SecurityToken

securityToken

Merchant security token: used to identify merchant. (required)

string

transactionRefNum

Gateway-assigned transaction ID. (required)

string

receiptRefNum

Gateway-assigned receipt ID. (required)

string

receiptName

Receipt name. (optional)

string

contentType

Format of receipt (HTML or text). (optional)

Return Value

string

Returns base64-encoded receipt.

Exceptions

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

Message

Advice

Specified transactions was not found

Specified transactionRefNum does not match a transaction for this merchant.

Requested receipt not found

receiptRefNum must match an existing receipt.

Invalid content type

contentType 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(); 
 
} 
 
?>
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);
            }
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>1dc496d1-90b4-4a38-ad78-28a795af78e9</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>WW91ciBjcmVkaXQgY2FyZCBwYXltZW50IGhhcyBiZWVuIHJlY2VpdmVkIGJ5IENCUyAtIEdlbmVyYWwuIEJlbG93IGlzIA0KeW91ciByZWNlaXB0IG9mIHBheW1lbnQuDQoNClRyYW5zYWN0aW9uIERldGFpbHMNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQpNZXJjaGFudDogICAgQ0JTIC0gR2VuZXJhbA0KVHlwZTogICAgICAgIENyZWRpdCBDYXJkIFNhbGUNCkludm9pY2UgIzogICBDQ1BBWU1FTlQtDQpBbW91bnQ6ICAgICAgNDcuMDANCkRlc2NyaXB0aW9uOiBJbnZvaWNlIFBheW1lbnQgQ0NQQVlNRU5ULTcxQjIxODg0DQpDYXJkIEhvbGRlcjogTXIuICBBbmR5IFRlYWwNCkNhcmQgTnVtYmVyOiB4eHh4eHh4eHh4eHh4eDIyMjQNCg0KDQpTdWJ0b3RhbDogNDcuMDANCkZyZWlnaHQ6IC0NClRheDogLQ0KPT09PT09PT09PT09PT09PT09PT0NClRvdGFsOiA0Ny4wMA0KDQoNCnY4LjAxLXVlZ3ItbQ==</RenderReceiptResult>
      </RenderReceiptResponse>
   </s:Body>
</s:Envelope>