PaymentBill

class PaymentBill(var id: String? = null, var dateIssued: String? = null, var amount: Double? = null, var type: String? = null, var status: String? = null, var statusMessage: String? = null, var credits: List<PaymentCredit?>? = emptyList())

PaymentBill — represents a monthly payment associated with a member.

Payments are generated when a member reaches the required number of visits within a billing period. Each bill may also include detailed PaymentCredits showing how visits contributed to the payout.

Properties

  • id Unique identifier of the payment transaction.

  • dateIssued Date the bill was issued (ISO format yyyy-MM-dd, e.g., "2022-02-22").

  • amount Payment amount (e.g., 20.0).

  • type Type of payment method (e.g., "DirectDeposit", "GiftCard").

  • status Current status (e.g., "Pending", "Paid", "Rejected").

  • statusMessage A display-friendly message describing the status.

  • credits List of PaymentCredit entries linked to this bill.

Notes

Android (Kotlin) — showing payments

lifecycleScope.launch {
val payments = AFCore.payments().get()
payments.forEach { bill ->
println("Payment: ${bill?.amount} on ${bill?.dateIssued} — status=${bill?.status}")
bill?.credits?.forEach { credit ->
println(" Credit for period=${credit?.period}, visits=${credit?.visits}")
}
}
}

iOS (Swift) — showing payments

Task {
do {
let bills = try await AFCore.shared.payments().get()
for bill in bills {
print("Payment: \\(bill?.amount ?? 0) on \\(bill?.dateIssued ?? "-") — status=\\(bill?.status ?? "-")")
bill?.credits?.forEach { credit in
print(" Credit period=\\(credit?.period ?? "-"), visits=\\(credit?.visits ?? 0)")
}
}
} catch {
print("Failed to fetch payments: \\(error.localizedDescription)")
}
}

Constructors

Link copied to clipboard
constructor(id: String? = null, dateIssued: String? = null, amount: Double? = null, type: String? = null, status: String? = null, statusMessage: String? = null, credits: List<PaymentCredit?>? = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var id: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var type: String?

Functions

Link copied to clipboard
open override fun toString(): String