GatewayRetryPolicy class
Retry policy for handoff calls.
Important: the SDK only retries failures the transport classifies as transient (network error before request hit the server, explicit 5xx). It NEVER retries:
- 2xx responses (the gateway said yes; we are done);
- 4xx responses (the gateway said no; retrying would just say no again, and the cardholder might still be charged on a racing accepted attempt);
- timeouts after the request body has been sent (the gateway may have authorized; only the POS knows whether the idempotency key was already accepted).
In short: retries are a "did we even reach the gateway" guard, never a "let's try harder" guard.
Constructors
- GatewayRetryPolicy({int maxAttempts = 1, Duration initialBackoff = const Duration(milliseconds: 500), double backoffMultiplier = 2.0})
-
const
-
GatewayRetryPolicy.fromJson(Map<
String, dynamic> json) -
factory
Properties
- backoffMultiplier → double
-
Multiplier for exponential backoff. A value of
1.0keeps a fixed delay between attempts.final - hashCode → int
-
The hash code for this object.
no setterinherited
- initialBackoff → Duration
-
Delay before the second attempt fires. Subsequent
attempts use initialBackoff * backoffMultiplier^(n-1).
final
- maxAttempts → int
-
Max number of transport attempts per handoff.
1means "no retries"; this is the default because most gateway failures are non-retryable (see class doc).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited