aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

Protected Bundle and Purchases set differently... #24

Closed si-rbrisita closed 8 years ago

si-rbrisita commented 8 years ago

I am seeing different values set to the protected Validator::_purchases and Validator::_bundle_id members. When the condition 'is_array($jsonResponse['receipt'])' is true on line 197 they are set to:

$this->_purchases = $jsonResponse['receipt']['in_app']; $this->_bundle_id = $jsonResponse['receipt']['bundle_id'];

When the condition 'is_array($jsonResponse['receipt'])' is false they are set to:

$this->_purchases = array($jsonResponse['receipt']); $this->_bundle_id = $jsonResponse['receipt']['bid'];

Even though '$jsonResponse['receipt']['in_app']' and '$jsonResponse['receipt']['bundle_id']' exists. I am using iOS 9 and the Sandbox URL so that might have something to do with it but any insight would be appreciated.

si-rbrisita commented 8 years ago

Please disregard. Further testing showed otherwise but looking at the logic shows that the method could be simplified.