aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-06 09:10:11 +0300
committerFilipp Lepalaan <f@230.to>2013-05-06 09:10:11 +0300
commit6a6d4fe0e52d2b396c1eabebf4622df1d69e410a (patch)
tree6c8e0734d3dc191f8c5c243cf05ca17c13cf7b90
parent7b76e29ab3c9258c87f318aaa9f66e10ac976e66 (diff)
downloadgsxlib-6a6d4fe0e52d2b396c1eabebf4622df1d69e410a.tar.gz
gsxlib-6a6d4fe0e52d2b396c1eabebf4622df1d69e410a.tar.bz2
gsxlib-6a6d4fe0e52d2b396c1eabebf4622df1d69e410a.zip
Added warranty check with IMEI code, updated README
-rw-r--r--README.md2
-rwxr-xr-xgsxcl5
-rw-r--r--gsxlib.php23
3 files changed, 19 insertions, 11 deletions
diff --git a/README.md b/README.md
index 6e2e9da..e64eb8c 100644
--- a/README.md
+++ b/README.md
@@ -48,5 +48,5 @@ mainly as a simple test tool for the library.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
-[1]: http://gsxwsut.apple.com/apidocs/html/WSReference.html?user=asp
+[1]: https://gsxwsut.apple.com/apidocs/ut/html/WSHome.html
[2]: http://php.net/manual/en/book.soap.php
diff --git a/gsxcl b/gsxcl
index 1783587..ea5ae78 100755
--- a/gsxcl
+++ b/gsxcl
@@ -35,13 +35,12 @@ usage: gsxcl -s sold-to -u username -p password [-r region] [-e environment] [-f
-p password the password for the Apple ID
-r region either "am" (America), "emea" (default, Europe, Middle-East, Africa)
"apac" (Asia-Pacific) or "la" (Latin America)
- -e environment the GSX environment. Either empty (production), "it" or "ut"
- Defaults to production
+ -e environment the GSX environment. Either empty (production, default), "it" or "ut"
-f format the output format. Either print_r (default), json, xml or csv
-d data data for the query (serial number, order confirmation, repair number, EEE code, etc
Defaults to this machine's serial number. Or path to a JSON file.
- noun one of: {$verbs_str}
verb one of: {$nouns_str}
+ noun one of: {$verbs_str}
EOT;
exit();
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;