Created
March 17, 2020 13:40
-
-
Save WirecardMobileServices/e10785add82b5b4197a54f51e6e2d0a9 to your computer and use it in GitHub Desktop.
Receipt creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//We assume you have complete a Sale or retreived a Sale Response using History query/search. | |
//Note: having a valid Sale Response object is mandatory for the steps below. | |
let saleResponse: WDSaleResponse = WDSaleResponse() //In your code, instead of an empty sale, saleResponse is your actual sale response object | |
//Receipt for individual payments: | |
//If you want the receipt for a payment you know its id (instead of the whole Sale), you can get the saleResponse of that subPayment by using the function: | |
//let subPaymentResponse = saleResponse.paymentForReceipt:yourPaymentId | |
//subPaymentResponse.receipt(:showReturns:format:... | |
saleResponse.receipt(true, //Is the receipt for cardholder use? For more details, see documentation above | |
showReturns: false, //Should the receipt contain returns? | |
format: WDPrintFormat.datecs, //The receipt format (in this case, for portable Datecs, but could be PDF, html, etc.) | |
dpi: WDPrintDpi.default, //The dots per width is set to Default - valid for Datecs or AirPrint | |
completion: { (receipt: Any?, error: Error?) in | |
//For more details on printing receipt, see the Printer Manager section | |
}) | |
//Note: Other variations of the function above are offered to you for choosing the language and locale of the receipt content. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment