diff options
author | Erik Tobiassen <erik@vivalto.no> | 2016-03-30 23:12:52 +0200 |
---|---|---|
committer | Erik Tobiassen <erik@vivalto.no> | 2016-03-30 23:12:52 +0200 |
commit | f405dc504b62e5b8157429fe36a1f96d83c97b61 (patch) | |
tree | b47632a1f12057c6941626434e9fe706ed425d38 /examples/warranty_status.php | |
parent | 68d471d690a4d83e7a30507ec205afebffc0572b (diff) | |
download | gsxlib-f405dc504b62e5b8157429fe36a1f96d83c97b61.tar.gz gsxlib-f405dc504b62e5b8157429fe36a1f96d83c97b61.tar.bz2 gsxlib-f405dc504b62e5b8157429fe36a1f96d83c97b61.zip |
warrantyStatus method updated for May upgrade
- Added shipTo to the $serialNumber array.
- Added warranty status example.
Diffstat (limited to 'examples/warranty_status.php')
-rw-r--r-- | examples/warranty_status.php | 54 |
1 files changed, 54 insertions, 0 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> |