PlayPurchaseGateway class

Google Play Billing behind the PurchaseGateway port.

Play is the reason the port has a complete step at all: a purchase that is not acknowledged within three days is automatically refunded, and the money goes back whether or not the player got what they bought. So the order matters and is not this class's to choose — CommerceService verifies with the Worker, commits the entitlement, and only then calls complete.

Everything here is evidence, never permission. A purchased update is a claim that Play says something was bought; the Worker re-reads it from the Android Publisher API before any of it becomes access.

Constructors

PlayPurchaseGateway({required String accountId(), InAppPurchasePlatform? billing})

Properties

accountId String Function()
The Eigen account to bind a purchase to, read at purchase time.
final
hashCode int
The hash code for this object.
no setterinherited
provider String
Key matching the provider name in the server commerce catalog.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updates Stream<PurchaseUpdate>
no setteroverride

Methods

complete(PurchaseUpdate update) Future<void>
Acknowledges or completes provider delivery after Worker verification.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
products(Set<String> providerReferences) Future<List<StoreProduct>>
override
purchase({required String offerKey, required StoreProduct product, required bool repeatable}) Future<void>
Starts the SDK purchase flow.
override
restore() Future<void>
override
toString() String
A string representation of this object.
inherited

Operators

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