get

abstract suspend fun get(): List<PaymentBill>

Retrieves the complete record of payments for the signed-in user.

Return

A list of PaymentBill objects. May be empty if no payments exist.

Throws

if retrieval fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val bills = AFCore.payments().get()
bills.filterNotNull().forEach { bill ->
println("Invoice: ${bill.id}, Amount: ${bill.amount}, Status: ${bill.status}")
}
} catch (t: Throwable) {
showError("Could not load payment history: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let bills = try await AFCore.shared.payments().get()
for bill in bills.compactMap({ $0 }) {
print("Invoice: \\(bill.id), Amount: \\(bill.amount), Status: \\(bill.status)")
}
} catch {
self.showError("Could not load payment history: \\(error.localizedDescription)")
}
}