Custom Receipts
After the transaction has been completed, you must provide a payment receipt to the
merchant and the shopper.
Sample Receipt
A sample receipt with required
information and its placement is shown below. Actual receipt content may vary from
what is shown on the sample receipt, depending on acquirer and payment
method.
Required Receipt Information
transaction
variable in the TransactionCompleted
callback provides the following two properties: transaction.MerchantReceipt transaction.CustomerReceipt
Make sure that your custom receipt contains all the following required fields and
that you are able to send receipts for successful refunds.
ReceiptLineItem
items. Each
item provides a Label
that describes the entry itself,
and a Value
containing the actual data. When building
the receipt on your end, do the following both for transaction.MerchantReceipt
and transaction.CustomerReceipt
:
- Add all the merchant information, such as address including country, by iterating over theMerchantDetails.
- Specify the receipt type:MerchantReceiptorCustomerReceipt. For a receipt sent to the merchant, it must clearly stateMerchant Receipt.
- Provide the static elements that are available directly on theReceiptobject, including:
- Type
- AmountAndCurrency
- Subject
- StatusText
- TimeandDate
- Add all payment related information by iterating over thePaymentDetails.
- And finally add all information from processing the transaction by iterating over theClearingDetails.
- Check if you need to print Tip and Total Amount lines on the receipts viaTipLineRequired.
- Check if you need to print a signature line on the merchant receipt viaSignatureLineRequired.
The receipts are already embedded in the transaction reference that you receive
after a successful transaction. The transaction object provides access to the
receipt for both, the merchant and the customer.
Receipts are only attached if the transaction did not fail, so always make sure to
check the transaction and both receipt properties before accessing them.
// Merchant Receipt var receipt = transaction.MerchantReceipt; Console.WriteLine("Merchant Receipt " + receipt.Type.Value); // or Customer Receipt // var receipt = transaction.CustomerReceipt; // Console.WriteLine("Customer Receipt " + receipt.Type.Value)); Console.WriteLine("MERCHANT DETAILS:"); foreach (var merchantDetail in receipt.MerchantDetails) { Console.WriteLine("\t " + merchantDetail.Label + ": " + merchantDetail.Value); } Console.WriteLine("Amount: " + receipt.AmountAndCurrency.Value); Console.WriteLine("Time: " + receipt.Time.Value); Console.WriteLine("Date: " + receipt.Date.Value); Console.WriteLine("Subject: " + receipt.Subject.Value); Console.WriteLine("Status: " + receipt.StatusText.Value); // -- Optional Console.WriteLine("Transaction identifier: " + receipt.Identifier.Value); // -- Console.WriteLine("PAYMENT DETAILS:"); foreach (var paymentDetail in receipt.PaymentDetails) { Console.WriteLine("\t " + paymentDetail.Label + ": " + paymentDetail.Value); } Console.WriteLine("CLEARING DETAILS:"); foreach (var clearingDetail in receipt.ClearingDetails) { Console.WriteLine("\t " + clearingDetail.Label + ": " + clearingDetail.Value); } if (receipt.TipLineRequired) { Console.WriteLine("TIP : ________________________"); Console.WriteLine("TOTAL: ________________________"); } // Usually only on the Merchant Receipt if(receipt.SignatureLineRequired) { Console.WriteLine("Customer Signature: ________________________"); }