aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-03-31 10:01:51 +0300
committerFilipp Lepalaan <filipp@mac.com>2016-03-31 10:01:51 +0300
commit68c2b78f93af5a4f950d54a009951725cc3889cf (patch)
treeb47632a1f12057c6941626434e9fe706ed425d38
parent1144dc5939c994388acaa5522f1e8ba2ce82477e (diff)
parentf405dc504b62e5b8157429fe36a1f96d83c97b61 (diff)
downloadgsxlib-master.tar.gz
gsxlib-master.tar.bz2
gsxlib-master.zip
Merge pull request #57 from eriktobben/masterHEADmaster
warrantyStatus method updated for May upgrade
-rw-r--r--examples/warranty_status.php54
-rw-r--r--gsxlib.php5
2 files changed, 57 insertions, 2 deletions
diff --git a/examples/warranty_status.php b/examples/warranty_status.php
new file mode 100644
index 0000000..6ae77ed
--- /dev/null
+++ b/examples/warranty_status.php
@@ -0,0 +1,54 @@
+<?php
+
+ /**
+ * This example mimics the serial number lookup for WarrantyStatus in GSX.
+ * Updated to send shipTo as required by the May 2016 release of GSX.
+ */
+
+ require 'gsxlib/gsxlib.php';
+
+ $sold_to = '';
+ $ship_to = '';
+ $username = '';
+ $serialnumber = '';
+
+ $_ENV['GSX_CERT'] = '/path/to/certificate';
+ $_ENV['GSX_KEYPASS'] = '';
+
+ try {
+ $gsx = GsxLib::getInstance($sold_to, $username);
+ $info = $gsx->warrantyStatus($serialnumber, $ship_to);
+ } catch (SoapFault $e) {
+ var_dump($e->faultstring);
+ die;
+ }
+
+ ?>
+
+ <table>
+ <tr>
+ <td><strong>Serial Number:</strong> <?= $info->serialNumber ?></td>
+ </tr>
+ <tr>
+ <td><strong>Warranty Status:</strong> <?= $info->warrantyStatus ?></td>
+ </tr>
+ <tr>
+ <td><strong>Days remaining:</strong> <?= $info->daysRemaining ?></td>
+ </tr>
+ <tr>
+ <td><strong>Estimated Purchase Date:</strong> <?= $info->estimatedPurchaseDate ?></td>
+ </tr>
+ <tr>
+ <td><strong>Purchase Country:</strong> <?= $info->purchaseCountry ?></td>
+ </tr>
+ <tr>
+ <td><strong>Product Description:</strong> <?= $info->productDescription ?></td>
+ </tr>
+ <tr>
+ <td><strong>Config Description:</strong> <?= $info->configDescription ?></td>
+ </tr>
+ <tr>
+ <td><strong>Activation Lock Status:</strong> <?= $info->activationLockStatus ?></td>
+ </tr>
+
+ </table>
diff --git a/gsxlib.php b/gsxlib.php
index 59e4281..0edc724 100644
--- a/gsxlib.php
+++ b/gsxlib.php
@@ -478,11 +478,12 @@ class GsxLib
/**
* A shortcut for checking warranty status of device
+ * UPDATE: Now includes shipTo as per GSX update May 2016.
*/
- public function warrantyStatus($serialNumber)
+ public function warrantyStatus($serialNumber, $ship_to)
{
if(!is_array($serialNumber)) {
- $serialNumber = array('serialNumber' => $serialNumber);
+ $serialNumber = array('serialNumber' => $serialNumber, 'shipTo' => $ship_to);
}
if(array_key_exists('alternateDeviceId', $serialNumber)) {