Custom Receipts

After the transaction has been completed, you are required to provide a payment receipt to both the merchant and the shopper when using PayProtocol (P3).
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
Your custom receipt must contain the required fields stated below and shown in the sample receipt above. You must be able to send receipts for successful refunds.
When building the receipt on your end, do the following both for 
transaction.merchantReceipt
 and 
transaction.customerReceipt
:
  1. Add all the merchant information, such as address including country, by iterating over the 
    merchantDetails
     .
  2. Specify the receipt type:
    MerchantReceipt
     or 
    CustomerReceipt
    . For a receipt sent to the merchant, it must clearly state 
    Merchant Receipt
     .
  3.  
    RECEIPT_TYPE
     .
  4.  
    AMOUNT_AND_CURRENCY
     .
  5. Add all payment related information by iterating over the 
    paymentDetails
     .
  6.  
    STATUS_TEXT
    .
  7.  
    TIME
     and 
    DATE
     .
  8. And finally add all information from processing the transaction by iterating over the 
    clearingDetails
     .
  9. Check if you need to print Tip and Total Amount lines on the receipts via 
    tipLineRequired
     .
  10. Check if you need to print a signature line on the receipt via 
    signatureLineRequired
     . (Not shown on sample receipt.)
  11. SUBJECT
    . (Optional. Not shown on sample receipt.)
Receipt Format
The receipt formats are embedded in the execute transaction response that you receive after a successful transaction. The transaction object provides access to the receipt for both 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.
The the receipt data in P3 looks like this:
"merchantReceipt": { "data": { "RECEIPT_TYPE": { "key": "RECEIPT_TYPE", "label": "Receipt Type", "value": "Merchant Receipt" }, "TRANSACTION_TYPE": { "key": "TRANSACTION_TYPE", "label": "Type", "value": "Payment" }, "SUBJECT": { "key": "SUBJECT", "label": "Description", "value": "Hey World!" }, "IDENTIFIER": { "key": "IDENTIFIER", "label": "PWID", "value": "bf1bda0a0c9611e68a588f955891035b" }, "AMOUNT_AND_CURRENCY": { "key": "AMOUNT_AND_CURRENCY", "label": "Amount", "value": "€1.00" }, "DATE": { "key": "DATE", "label": "Date", "value": "4/27/2016" }, "TIME": { "key": "TIME", "label": "Time", "value": "6:40:27 PM" }, "STATUS_TEXT": { "key": "STATUS_TEXT", "label": "Information", "value": "Please retain receipt!" }, }, "clearingDetails": [ { "key": "CLEARING_DETAILS_TRANSACTION_IDENTIFIER", "label": "Transaction", "value": "217500" }, { "key": "CLEARING_DETAILS_AUTHORIZATION_CODE", "label": "Authorization", "value": "721100/055700" }, { "key": "CLEARING_DETAILS_MERCHANT_IDENTIFIER", "label": "Merchant ID", "value": "100058700" }, { "key": "CLEARING_DETAILS_TERMINAL_ID", "label": "Terminal ID", "value": "BAD04568" } ], "paymentDetails": [ { "key": "PAYMENT_DETAILS_SCHEME_OR_LABEL", "label": "Card", "value": "VISA" }, { "key": "PAYMENT_DETAILS_MASKED_ACCOUNT", "label": "Account", "value": "**** **** **** 0119" }, { "key": "PAYMENT_DETAILS_EMV_APPLICATION_ID", "label": "AID", "value": "A00000000310109999" }, { "key": "PAYMENT_DETAILS_SOURCE", "label": "Entry Mode", "value": "Contactless" } ], "merchantDetails": [ { "key": "MERCHANT_DETAILS_PUBLIC_NAME", "label": "Name", "value": "Merchant" }, { "key": "MERCHANT_DETAILS_ADDRESS", "label": "Address", "value": "Demo Street 12" }, { "key": "MERCHANT_DETAILS_ZIP", "label": "Zip", "value": "12601" }, { "key": "MERCHANT_DETAILS_CITY", "label": "City", "value": "City" }, { "key": "MERCHANT_DETAILS_COUNTRY", "label": "Country", "value": "Country" }, { "key": "MERCHANT_DETAILS_CONTACT", "label": "Contact", "value": "+49 (170) 1234567" }, { "key": "MERCHANT_DETAILS_ADDITIONAL_INFORMATION", "label": "Additional Information", "value": "" } ], "signatureLineRequired": false, "tipLineRequired": false },