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
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();
}
?>
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);
}
Updated over 2 years ago