Receipts — VP3350
func generateReceipt(_ r: VP3350TransactionResult) -> [String: String] {
return [
"Merchant": "Your Business",
"Date": DateFormatter.localizedString(from: r.timestamp, dateStyle: .medium, timeStyle: .short),
"Amount": String(format: "$%.2f", r.amount),
"Card": "\(r.cardBrand) ending \(r.cardLast4)",
"Entry": r.entryMode.description, // Chip, Tap, or Swipe
"Auth": r.authCode,
"TxID": r.transactionID,
"Status": r.isApproved ? "APPROVED" : "DECLINED",
]
}
See the VP3350 overview for the full topic list.