PayitgoCheckout class
The payer's side of a payment, without any key: safe in a Flutter app.
Your backend creates the payment and hands the app its checkout_token.
final checkout = PayitgoCheckout();
final payment = await checkout.retrieve(checkoutToken);
await for (final p in checkout.watch(checkoutToken)) { /* update the UI */ }
checkout.close(); // when the app no longer needs it
Constructors
- PayitgoCheckout({String? baseUrl, Client? httpClient})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void -
Closes the http.Client this checkout client made for itself. One passed
as
httpClient, or the one a Payitgo'scheckoutshares with it, is left open. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
retrieve(
String checkoutToken) → Future< Payment> - The payer's view of a payment, by its checkout token.
-
selectToken(
String checkoutToken, String token) → Future< Payment> - The customer's choice of coin for a payment created without one: the payment comes back with its address, amount and deadline.
-
simulate(
String checkoutToken, String outcome) → Future< Payment> -
Plays
outcome(one of Payments.simulationOutcomes) on a test payment, for a test checkout's "simulate" buttons: its deposits and statuses follow a few seconds apart, with no coins (watch shows them). A live payment is a PayitgoException with status 400; a simulation that is still running, 409. -
toString(
) → String -
A string representation of this object.
inherited
-
watch(
String checkoutToken, {Duration every = const Duration(seconds: 5)}) → Stream< Payment> -
Polls the payment every
everyand emits it at once, then whenever its status changes. The stream ends once the payment can change no more: confirmed or failed, or expired or underpaid with its 24 hours for late payments over (at once for a payment expired without a coin, which has no address). Until then an expired or underpaid payment is still followed, so a late payment shows as detecting and then confirmed. Cancel the subscription to stop sooner.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited