Skip to content

3.0.0

Choose a tag to compare

@aporat aporat released this 26 Dec 21:59
e4b7c36

Added

  • iTunes\ResponseInterface (declares all response getters and the RESULT_* constants) and
    iTunes\EnvironmentResponseInterface (isSandbox(): bool, isProduction(): bool). Thanks to
    @Stafox (#87)
  • iTunes\ProductionResponse and iTunes\SandboxResponse, both extending the new
    iTunes\AbstractResponse; Validator::validate() returns the one matching the environment that
    actually answered, so a 21007 sandbox retry yields a SandboxResponse.
    (#87)
  • iTunes\ResponseInterface::isRetryable(): bool, true when Apple's response contains the
    is-retryable key (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\Response was removed and replaced by the abstract iTunes\AbstractResponse
    plus ProductionResponse/SandboxResponse. Code that instantiates new Response(...) or
    type-hints Response must switch to ResponseInterface (or one of the concrete classes).
    (#87)
  • Breaking: The RESULT_* constants moved from iTunes\Response to iTunes\ResponseInterface
    (e.g. Response::RESULT_OK is now ResponseInterface::RESULT_OK).
    (#87)
  • Breaking: iTunes\Validator::validate() return type changed from Response to
    ResponseInterface. (#87)
  • Breaking: iTunes\AbstractResponse::setResultCode(int $code) now returns void instead of
    self, so it can no longer be chained.
    (#87)
  • Breaking: isValid() on iTunes responses now also returns true for status 21006
    (RESULT_RECEIPT_VALID_BUT_SUB_EXPIRED), not only for 0; code relying on isValid() to mean
    "active subscription" must also check the result code.
    (#87)
  • iTunes\AbstractResponse::getRawData() now declares a ?array return type.
    (#87)
  • iTunes\PurchaseItem casts quantity to int and parses
    is_trial_period/is_in_intro_offer_period with FILTER_VALIDATE_BOOLEAN instead of comparing
    to the string "true". (#87)
  • iTunes\Validator: the private encodeRequest() became protected prepareRequestData(), 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 to string in 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.