Repository navigation
3.0.0
Added
iTunes\ResponseInterface(declares all response getters and theRESULT_*constants) and
iTunes\EnvironmentResponseInterface(isSandbox(): bool,isProduction(): bool). Thanks to
@Stafox (#87)iTunes\ProductionResponseandiTunes\SandboxResponse, both extending the new
iTunes\AbstractResponse;Validator::validate()returns the one matching the environment that
actually answered, so a 21007 sandbox retry yields aSandboxResponse.
(#87)iTunes\ResponseInterface::isRetryable(): bool, true when Apple's response contains the
is-retryablekey (status codes 21100-21199). Thanks to @amasok
(#84)- New constant
iTunes\ResponseInterface::RESULT_RECEIPT_WITHOUT_PURCHASE = 21010.
(#87) iTunes\Validator::getClientConfig(): array(protected) so subclasses can override the Guzzle
client configuration; the sandbox retry client now reuses this config instead of a bare
base_uri. (#87)
Changed
- Breaking:
iTunes\Responsewas removed and replaced by the abstractiTunes\AbstractResponse
plusProductionResponse/SandboxResponse. Code that instantiatesnew Response(...)or
type-hintsResponsemust switch toResponseInterface(or one of the concrete classes).
(#87) - Breaking: The
RESULT_*constants moved fromiTunes\ResponsetoiTunes\ResponseInterface
(e.g.Response::RESULT_OKis nowResponseInterface::RESULT_OK).
(#87) - Breaking:
iTunes\Validator::validate()return type changed fromResponseto
ResponseInterface. (#87) - Breaking:
iTunes\AbstractResponse::setResultCode(int $code)now returnsvoidinstead of
self, so it can no longer be chained.
(#87) - Breaking:
isValid()on iTunes responses now also returnstruefor status 21006
(RESULT_RECEIPT_VALID_BUT_SUB_EXPIRED), not only for 0; code relying onisValid()to mean
"active subscription" must also check the result code.
(#87) iTunes\AbstractResponse::getRawData()now declares a?arrayreturn type.
(#87)iTunes\PurchaseItemcastsquantitytointand parses
is_trial_period/is_in_intro_offer_periodwithFILTER_VALIDATE_BOOLEANinstead of comparing
to the string"true". (#87)iTunes\Validator: the privateencodeRequest()became protectedprepareRequestData(), and the
sandbox retry is now recursive through the same request path (a non-200 status still throws
RunTimeException). (#87)- Amazon, GooglePlay and WindowsStore sources were reformatted (PSR-2 indentation) with no
functional change. - Note: PR #83 (@sumbria, "Set Line Item Optional") changed
iTunes\PurchaseItem::getWebOrderLineItemId()to return?string, but the subsequent refactor in
#87 reverted it tostringin the tagged 3.0.0; the nullable return only shipped in 3.1.0.
Notes written from the code diff for this release; see CHANGELOG.md.