Repository navigation
5.0.0
Removed
- Breaking: Removed the Windows Store validator:
ReceiptValidator\WindowsStore\Validatorand
ReceiptValidator\WindowsStore\CacheInterfaceare gone, and therobrichards/xmlseclibs
dependency was dropped with them.
Changed
- Breaking: Minimum PHP version raised from
^7.3|^8.0to^8.2. - Breaking: Constructor arguments that used to be optional are now required (still nullable):
Amazon\PurchaseItem::__construct(?array $jsonResponse),
Amazon\Response::parseJsonResponse(?array $jsonResponse),
iTunes\AbstractResponse::__construct(?array $data),iTunes\PurchaseItem::__construct(?array $data),iTunes\PendingRenewalInfo::__construct(?array $data). Passing a non-array (e.g. a
string) to these now throwsTypeErrorinstead ofRuntimeException('Response must be a scalar value'). - Breaking:
Amazon\Response::__construct(int $httpStatusCode = 200, ?array $jsonResponse = [])
— the second parameter's default changed fromnullto[], sonew Response(200)now parses an
empty array andgetPurchases()returns one emptyPurchaseIteminstead of an empty array; pass
nullexplicitly to keep the old behaviour. - Breaking: Scalar parameter types and
staticreturn types added across
GooglePlay\Validator:__construct(AndroidPublisher $service, bool $validationModePurchase = true),setPackageName(string),setPurchaseToken(string),setProductId(string),
setValidationModePurchase(bool),setValidationSubscriptionV2(bool);validatePurchase(): PurchaseResponse,validateSubscription(): SubscriptionResponse,validateSubscriptionV2(): SubscriptionV2Response,getPublisherService(): ?AndroidPublisher. - Breaking:
GooglePlay\Acknowledger::__construct()now requiresstringfor$packageName,
$productId,$purchaseTokenand$strategy;acknowledge()is declared: bool. - Breaking: Return types declared on the Google Play response classes, so a missing field from
Google now raisesTypeErrorinstead of returningnull:
AbstractResponse::getDeveloperPayload(): array|string,getAcknowledgementState(): int,
getKind(): string;PurchaseResponse::getConsumptionState(): int,getPurchaseTimeMillis(): string,getDeveloperPayloadElement(string $key): string,getPurchaseState(): string;
SubscriptionResponse::getAutoRenewing(): bool,getCancelReason(): ?int,getCountryCode(): string,getPriceAmountMicros(): string,getPriceCurrencyCode(): string,
getStartTimeMillis(): string,getExpiryTimeMillis(): int,getUserCancellationTimeMillis(): ?int,getPaymentState(): int,getExpiresDate(): string,getExternalAccountId(): string. GooglePlay\SubscriptionResponse::getPriceAmountMicros()is now documented and typed asstring
(Google returns the int64 as a string); it was previously documented asint.iTunes\PurchaseItemandiTunes\PendingRenewalInfoArrayAccessmethods now carry native
return types (offsetSet(): void,offsetGet(): mixed,offsetUnset(): void,offsetExists(): bool); subclasses overriding them must match.- All classes now use typed properties (
Amazon\*,GooglePlay\*,iTunes\*); subclasses that
redeclare these protected properties must use compatible types. composer.json:phpunit/phpunitdev dependency raised to^11.0;minimum-stability: devwith
prefer-stable: trueadded (affects the repository only, not consumers).- Note: the original release notes said only "PHP 8.2 minimum required, Removed Windows Store
validator, Code style improvements"; the signature/return-type changes above are user-visible and
theAmazon\Responsedefault change is a behaviour change.
Notes written from the code diff for this release; see CHANGELOG.md.