From 7564c53dffb75c643dc32406ad0a939fa31d8833 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 4 May 2011 10:01:01 +0300 Subject: Added repairDetail() --- gsxlib.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gsxlib.php b/gsxlib.php index 055dd9b..7f6be8c 100644 --- a/gsxlib.php +++ b/gsxlib.php @@ -77,6 +77,24 @@ class GsxLib } + /** + * Return details for given dispatch ID + * @param string $dispatchId + * @return object lookupResponseData + */ + public function repairDetails($dispatchId) + { + $dispatchId = trim($dispatchId); + + if (!self::looksLike($dispatchId, 'dispatchId')) { + exit('Invalid dispatch ID: ' . $dispatchId); + } + + $req = array('RepairDetails' => array('dispatchId' => $dispatchId)); + return $this->request($req)->lookupResponseData; + + } + /** * a shortcut for looking up part information * @param mixed $string @@ -111,11 +129,11 @@ class GsxLib $result = false; $rex = array( - 'partNumber' => '/^[a-z]?\d{3}\-\d{4}$/i', - 'serialNumber' => '/^[a-z0-9]{11,12}$/i', - 'eeeCode' => '/^[a-z0-9]{3,4}$/i', - 'repairNumber' => '/^\d{12}$/', - 'repairConfirmationNumber' => '/^G\d{9}$/i' + 'partNumber' => '/^[a-z]?\d{3}\-\d{4}$/i', + 'serialNumber' => '/^[a-z0-9]{11,12}$/i', + 'eeeCode' => '/^[a-z0-9]{3,4}$/i', + 'repairNumber' => '/^\d{12}$/', + 'dispatchId' => '/^G\d{9}$/i' ); foreach ($rex as $k => $v) { -- cgit v1.2.3