Closed cbonachera closed 7 years ago
Can you push this patch please? For IOS6, you forgot to push the latest receipt in the result.
public function parseJsonResponse($jsonResponse) { if (!is_array($jsonResponse)) { throw new RuntimeException('Response must be a scalar value'); } // ios > 7 receipt validation if (array_key_exists('receipt', $jsonResponse) && is_array($jsonResponse['receipt']) && array_key_exists('in_app', $jsonResponse['receipt']) && is_array($jsonResponse['receipt']['in_app'])) { $this->_code = $jsonResponse['status']; $this->_receipt = $jsonResponse['receipt']; $this->_purchases = $jsonResponse['receipt']['in_app']; if (array_key_exists('bundle_id', $jsonResponse['receipt'])) { $this->_bundle_id = $jsonResponse['receipt']['bundle_id']; } if (array_key_exists('latest_receipt_info', $jsonResponse)) { $this->_latest_receipt_info = $jsonResponse['latest_receipt_info']; } if (array_key_exists('latest_receipt', $jsonResponse)) { $this->_latest_receipt = $jsonResponse['latest_receipt']; } } elseif (array_key_exists('receipt', $jsonResponse)) { // ios <= 6.0 validation $this->_code = $jsonResponse['status']; if (array_key_exists('receipt', $jsonResponse)) { $this->_receipt = $jsonResponse['receipt']; $this->_purchases = array($jsonResponse['receipt']); if (array_key_exists('bid', $jsonResponse['receipt'])) { $this->_bundle_id = $jsonResponse['receipt']['bid']; } if (array_key_exists('latest_receipt_info', $jsonResponse)) { $this->_latest_receipt_info = $jsonResponse['latest_receipt_info']; } if (array_key_exists('latest_receipt', $jsonResponse)) { $this->_latest_receipt = $jsonResponse['latest_receipt']; } } } elseif (array_key_exists('status', $jsonResponse)) { $this->_code = $jsonResponse['status']; } else { $this->_code = self::RESULT_DATA_MALFORMED; } return $this; }
I no longer support ios <= 6. however, if you can open a pull request with the changes, i'll gladly review it.
Can you push this patch please? For IOS6, you forgot to push the latest receipt in the result.