Login

Contact

Custom Receipts

Should you require more flexibility than the ready-made receipts provide, you can also send out or print your own receipts including the payment related data!

You need to make sure, that your custom receipt contains all the required fields stated below and that you are able to also send receipts for successful refunds.

Sample Receipt

1 2 3 4 5


6 7 8

 

 

Required Receipt information

The image above shows where the data contained in the response below should be displayed:

  1. Full address of the merchant, including the country. Iterate over $.merchantDetails, for each line item print $.value.
  2. $.receiptType.value
  3. $.transactionType.value
  4. $.amountAndCurrency.value
  5. The payment details, e.g. the masked account number. Iterate over $.paymentDetails , for each line item print the $.label and  $.value .
  6. $.statusText.value 
  7. $.date.value and $.time.value
  8. The clearing details, e.g. the merchant identifier. Iterate over  $.clearingDetails , for each line item print the $.label and  $.value .
  9. If the $.signatureLineRequired is true, then you have to print a signature line on your merchant receipt. 

Accessing Receipt data

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.

Here is how to access receipt data:


MPTransactionProcess *process =
[transactionProvider startTransactionWithParameters:transactionParameters
                                accessoryParameters:accessoryParameters
                                         registered:[...]
                                      statusChanged:[...]
                                     actionRequired:[...]
                                          completed:^(MPTransactionProcess *process,
                                                      MPTransaction *transaction,
                                                      MPTransactionProcessDetails *details)
{

    MPReceipt *receipt = transaction.merchantReceipt;
    // For the Customer Receipt
    //MPReceipt *receipt = transaction.customerReceipt;

    NSLog(@"MERCHANT DETAILS");
    for (MPReceiptLineItem* lineItem in receipt.merchantDetails)
    {
        NSString *label = lineItem.label;
        NSString *value = lineItem.value;
        NSLog(@"%@: %@", label, value);
     }
    NSLog(@" ");

    NSLog(@"%@: %@", receipt.receiptType.label, receipt.receiptType.value);
    NSLog(@"%@: %@", receipt.transactionType.label, receipt.transactionType.value);
    NSLog(@"%@: %@", receipt.amountAndCurrency.label, receipt.amountAndCurrency.value);
    NSLog(@" ");

    NSLog(@"PAYMENT DETAILS");
    for (MPReceiptLineItem* lineItem in receipt.paymentDetails)
    {
        NSString *label = lineItem.label;
        NSString *value = lineItem.value;
        NSLog(@"%@: %@", label, value);
    }
    NSLog(@" ");

    NSLog(@"%@: %@", receipt.statusText.label, receipt.statusText.value);
    NSLog(@"%@: %@", receipt.date.label, receipt.date.value);
    NSLog(@"%@: %@", receipt.time.label, receipt.time.value);
    NSLog(@" ");

    NSLog(@"CLEARING DETAILS");
    for (MPReceiptLineItem* lineItem in receipt.clearingDetails)
    {
        NSString *label = lineItem.label;
        NSString *value = lineItem.value;
        NSLog(@"%@: %@", label, value);
    }
    NSLog(@" ");

    // --- Optional
    NSLog(@"%@: %@", receipt.identifier.label, receipt.identifier.value);
    // ---

    // --- Only for the Merchant Receipt
    if(receipt.printSignatureLine)
    {
        NSLog(@"Customer Signature:");
        NSLog(@"___________________");
    }

}];