appleTransaction static method
Parses a single decoded transaction from getTransactionHistory.
Implementation
static VerificationResult appleTransaction(
AppleJwsPayload tx, {
required String environment,
}) {
final revoked = tx.revocationDate != null;
return VerificationResult(
isValid: !revoked,
state: revoked ? VerificationState.revoked : VerificationState.purchased,
platform: StorePlatform.apple,
productId: tx.productId,
expiresAt: _fromMillis(tx.expiresDate),
isSandbox: _isAppleSandbox(environment),
raw: tx.json,
);
}