PaymentContent class abstract final

A payment request: who to pay, into which account, how much and what for. One subclass per standard, each with its own fields; the getters here are what every standard has, so that one screen can show any of them:

if (barcode.content case final PaymentContent payment) {
  showPayment(payment.payee, payment.amount, payment.currency);
}

Amounts are text with a decimal point ('12.50'), never a double, so nothing is lost to rounding; see amount and currency for what they hold exactly. A code whose check digits or checksum are wrong is not a payment: it parses as TextContent.

New standards are added in minor versions, so a switch over a payment needs a default (or _) case; classes outside this package cannot extend it.

Inheritance
Implementers

Properties

account → String?
The account paid into: an IBAN, an account number, a UPI address or a PIX key.
no setter
amount → String?
The amount in currency, in its main unit with a decimal point ('12.50' euros, not cents), or null when the payer enters it.
no setter
currency → String?
The ISO 4217 alphabetic code of the currency, such as EUR.
no setter
hashCode → int
The hash code for this object.
no setterinherited
payee → String?
Who is paid.
no setter
reference → String?
What the payment is for: a reference or a message.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uri → Uri?
A link that opens this content in the app made for it, for launchUrl of package:url_launcher; null when there is none.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toPayload() → String
The text to put in a barcode: WIFI:…, a vCard, mailto:… and so on.
inherited
toString() → String
A string representation of this object.
inherited
validate() → List<ContentIssue>
The problems that keep toPayload from building this value, such as an empty network name or a latitude out of range. Empty when the value can be built. For forms: show each ContentIssue.message next to its ContentIssue.field.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited