From 6a6d4fe0e52d2b396c1eabebf4622df1d69e410a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 6 May 2013 09:10:11 +0300 Subject: Added warranty check with IMEI code, updated README --- gsxlib.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'gsxlib.php') diff --git a/gsxlib.php b/gsxlib.php index 740323b..3540c2e 100644 --- a/gsxlib.php +++ b/gsxlib.php @@ -180,14 +180,15 @@ class GsxLib public function fetchiOsActivation($query) { - $like = self::looksLike($query); - - $request = array('FetchIOSActivationDetails' => array( - $like => $query - )); - + if( !is_array($query )) { + $like = self::looksLike( $query ); + $query = array( $like => $query ); + } + + $request = array( 'FetchIOSActivationDetails' => $query ); + return $this->request($request)->activationDetailsInfo; - + } public function createCarryInRepair($repairData) @@ -424,6 +425,14 @@ class GsxLib $serialNumber = array('serialNumber' => $serialNumber); } + if( array_key_exists( 'alternateDeviceId', $serialNumber )) { + # checking warranty with IMEI code - must run activation check first + $ad = $this->fetchiOsActivation( $serialNumber ); + $wty = $this->warrantyStatus( $ad->serialNumber ); + $wty->activationDetails = $ad; + return $wty; + } + $req = array( 'WarrantyStatus' => array( 'unitDetail' => $serialNumber )); return $this->request($req)->warrantyDetailInfo; -- cgit v1.2.3