Repository navigation
2.2.0
Added
iTunes\Response::getAppItemId(),getOriginalPurchaseDate(),getRequestDate()and
getReceiptCreationDate()expose theapp_item_id,original_purchase_date_ms,
request_date_msandreceipt_creation_date_msreceipt fields (dates asCarbon).iTunes\Response::getRawData()returns the decoded JSON array the response was built from. Thanks
to @amasok (#82)iTunes\PurchaseItem::isTrialPeriod()andisInIntroOfferPeriod()read theis_trial_periodand
is_in_intro_offer_periodfields.iTunes\Response::getLatestReceiptInfo()andgetPendingRenewalInfo()now return an empty array
instead ofnullwhen the receipt has no such data.
Changed
- Breaking: composer now requires PHP >= 7.1 (was 7.0),
ext-json, andguzzlehttp/guzzle~6.3
(was ~6.2). - Breaking:
iTunes\Response::parseJsonResponse()and
iTunes\PurchaseItem::parseJsonResponse()were renamed toparseData();
iTunes\PendingRenewalInfogained a publicparseData()as well. - Breaking:
iTunes\PendingRenewalInfo::getIsInBillingRetryPeriod()was renamed to
isInBillingRetryPeriod(), andgetAutoRenewStatus()now returnsboolinstead ofint. - Breaking:
iTunes\Validator::__construct()throws\InvalidArgumentExceptioninstead of
ReceiptValidator\RunTimeExceptionfor an unknown endpoint. - Breaking:
iTunes\Response,iTunes\PurchaseItemandiTunes\PendingRenewalInfo
constructors are typed?array $data = nulland always parse; constructing one withnullnow
throwsRunTimeException("Response must be a scalar value") instead of producing an empty
object. iTunes\Validator::validate(?string $receipt_data = null, ?string $shared_secret = null): Responseand most iTunes getters gained scalar/nullable return types (for example
getResultCode(): int,getBundleId(): string,getPurchaseDate(): ?Carbon).
getLatestReceipt(): stringandgetBundleId(): stringare non-nullable, so a receipt lacking
those fields will raise aTypeError.Amazon\Validator::setEndpoint()is now explicitlypublic(it had no visibility keyword).
Thanks to @gsingh1 (#75)
Fixed
iTunes\PurchaseItemtrial/intro-offer flags are compared against the string"true"instead of
boolval(), which returnedtruefor the string"false". Thanks to @cumhuronat
(#77)Amazon\PurchaseItem::getRenewalDate()now usesCarbon::createFromTimestampUTC()on the
millisecond value divided by 1000; 2.1.0 passed that seconds value tocreateFromTimestampMs(),
yielding a date near 1970.- All millisecond-to-
Carbonconversions (iTunes and Amazon) cast the rounded timestamp toint
before calling Carbon.
Notes written from the code diff for this release; see CHANGELOG.md.