Skip to content

Commit

Permalink
added php 5.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Adar Porat committed Nov 21, 2014
1 parent df5f923 commit 5c87490
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: php
php:
- "5.4"
- "5.5"
- "5.6"


before_script:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ store-receipt-validator

[![Latest Stable Version](https://poser.pugx.org/aporat/store-receipt-validator/version.png)](https://packagist.org/packages/aporat/store-receipt-validator) [![Composer Downloads](https://poser.pugx.org/aporat/store-receipt-validator/d/total.png)](https://packagist.org/packages/aporat/store-receipt-validator)

[![Build Status](https://travis-ci.org/aporat/store-receipt-validator.png?branch=master)](https://travis-ci.org/aporat/store-receipt-validator) [![Dependency Status](https://www.versioneye.com/user/projects/529f708e632bac512c000002/badge.png)](https://www.versioneye.com/user/projects/521b6fd1632bac7a5900b02a) [![Coverage Status](https://coveralls.io/repos/aporat/store-receipt-validator/badge.png)](https://coveralls.io/r/aporat/store-receipt-validator) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/aporat/store-receipt-validator/badges/quality-score.png?s=5b8ac393ba82b0d8850c6397ba32ec460cd398cf)](https://scrutinizer-ci.com/g/aporat/store-receipt-validator/)
[![Build Status](https://travis-ci.org/aporat/store-receipt-validator.png?branch=master)](https://travis-ci.org/aporat/store-receipt-validator) [![Dependency Status](https://www.versioneye.com/user/projects/546f4d8c810106c2af0005b0/badge.svg?style=flat)](https://www.versioneye.com/user/projects/546f4d8c810106c2af0005b0) [![Coverage Status](https://img.shields.io/coveralls/aporat/store-receipt-validator.svg)](https://coveralls.io/r/aporat/store-receipt-validator)

PHP library that can be used to validate base64 encoded iTunes in app purchase receipts.

Expand Down
10 changes: 8 additions & 2 deletions src/ReceiptValidator/iTunes/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ public function parseJsonResponse($jsonResponse)
$this->_code = $jsonResponse['status'];
$this->_receipt = $jsonResponse['receipt'];
$this->_purchases = $jsonResponse['receipt']['in_app'];
$this->_bundle_id = $jsonResponse['receipt']['bundle_id'];

if (array_key_exists('bundle_id', $jsonResponse['receipt'])) {
$this->_bundle_id = $jsonResponse['receipt']['bundle_id'];
}

} elseif (array_key_exists('receipt', $jsonResponse)) {

Expand All @@ -173,7 +176,10 @@ public function parseJsonResponse($jsonResponse)
if (array_key_exists('receipt', $jsonResponse)) {
$this->_receipt = $jsonResponse['receipt'];
$this->_purchases = [$jsonResponse['receipt']];
$this->_bundle_id = $jsonResponse['receipt']['bid'];

if (array_key_exists('bid', $jsonResponse['receipt'])) {
$this->_bundle_id = $jsonResponse['receipt']['bid'];
}
}
} else {
$this->_code = self::RESULT_DATA_MALFORMED;
Expand Down

0 comments on commit 5c87490

Please sign in to comment.