Skip to content

1.0.0

Pre-release
Pre-release

Choose a tag to compare

@aporat aporat released this 08 Aug 00:57

Added

  • iTunes\Validator: constants ENDPOINT_PRODUCTION and ENDPOINT_SANDBOX;
    __construct($endpoint) (throws RunTimeException for any other URL);
    setReceiptData()/getReceiptData(), accepting either base64 or raw JSON (JSON is base64-encoded
    for you); setEndpoint()/getEndpoint(); and validate($receiptData = null), which POSTs to
    Apple's verifyReceipt endpoint with Guzzle 3 and returns an iTunes\Response. When the production
    endpoint answers 21007 (sandbox receipt sent to production, as during App Review) the request is
    automatically retried against the sandbox. A non-200 HTTP reply throws RunTimeException.
  • iTunes\Response: constants RESULT_OK (0), RESULT_APPSTORE_CANNOT_READ (21000),
    RESULT_DATA_MALFORMED (21002), RESULT_RECEIPT_NOT_AUTHENTICATED (21003),
    RESULT_SHARED_SECRET_NOT_MATCH (21004), RESULT_RECEIPT_SERVER_UNAVAILABLE (21005),
    RESULT_RECEIPT_VALID_BUT_SUB_EXPIRED (21006), RESULT_SANDBOX_RECEIPT_SENT_TO_PRODUCTION
    (21007), RESULT_PRODUCTION_RECEIPT_SENT_TO_SENDBOX (21008, sic); methods getResultCode(),
    setResultCode(), getReceipt(), isValid(), parseJsonResponse().
  • GooglePlay\Validator: __construct(array $options) taking client_id, client_secret and
    refresh_token, caching the OAuth access token in /tmp/google_access_token.txt; chainable
    setPackageName(), setPurchaseToken(), setProductId(); and validate(), returning the
    Android Publisher inapppurchases->get() result, or null (with the error echoed to stdout) on
    failure.
  • ReceiptValidator\RunTimeException, extending \Exception.
  • composer: package aporat/store-receipt-validator requiring PHP >=5.4, guzzle/guzzle 3.8.*
    and google/apiclient 1.0.4-beta, with PSR-0 autoloading of the ReceiptValidator namespace from
    src/.

Notes written from the code diff for this release; see CHANGELOG.md.