Skip to content

Commit 002e8cc

Browse files
author
Dennis van den Heerik
committed
Fix getTableOrderV2 and added sub table number as argument
1 parent f67cc9f commit 002e8cc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Mplusqapiclient.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class MplusQAPIclient
44
{
5-
const CLIENT_VERSION = '1.27.1';
5+
const CLIENT_VERSION = '1.27.2';
66
const WSDL_TTL = 300;
77

88
var $MIN_API_VERSION_MAJOR = 0;
@@ -3047,16 +3047,16 @@ public function getTableOrder($terminal, $branchNumber, $tableNumber, $attempts=
30473047

30483048
//----------------------------------------------------------------------------
30493049

3050-
public function getTableOrderV2($terminal, $tableNumber, $claimTable=null, $attempts=0)
3050+
public function getTableOrderV2($terminal, $tableNumber, $claimTable=null, $tableSubNumber = null, $attempts=0)
30513051
{
30523052
try {
3053-
$result = $this->client->getTableOrderV2($this->parser->convertGetTableOrderV2Request($terminal, $terminal['branchNumber'], $tableNumber, $claimTable));
3053+
$result = $this->client->getTableOrderV2($this->parser->convertGetTableOrderV2Request($terminal, $tableNumber, $tableSubNumber, $claimTable));
30543054
return $this->parser->parseGetTableOrderResult($result);
30553055
} catch (SoapFault $e) {
30563056
$msg = $e->getMessage();
30573057
if (false !== stripos($msg, 'Could not connect to host') and $attempts < 3) {
30583058
sleep(1);
3059-
return $this->getTableOrderV2($terminal, $branchNumber, $tableNumber, $attempts+1);
3059+
return $this->getTableOrderV2($terminal, $tableNumber, $claimTable, $tableSubNumber, $attempts+1);
30603060
} else {
30613061
throw new MplusQAPIException('SoapFault occurred: '.$msg, 0, $e);
30623062
}
@@ -8323,18 +8323,21 @@ public function convertGetTableOrderRequest($terminal, $branchNumber, $tableNumb
83238323

83248324
//----------------------------------------------------------------------------
83258325

8326-
public function convertGetTableOrderV2Request($terminal, $branchNumber, $tableNumber, $claimTable)
8326+
public function convertGetTableOrderV2Request($terminal, $tableNumber, $tableSubNumber, $claimTable)
83278327
{
83288328
$terminal = $this->convertTerminal($terminal);
8329-
$branchNumber = $this->convertBranchNumber($branchNumber);
8330-
$tableNumber = $this->convertTableNumber($tableNumber);
83318329
$array = array(
83328330
'terminal'=>$terminal->terminal,
8333-
'request'=>array('tableNumber'=>$tableNumber->tableNumber),
8331+
'request'=>array(
8332+
'tableNumber'=>intval($tableNumber)
8333+
),
83348334
);
83358335
if ( ! is_null($claimTable)) {
83368336
$array['request']['claimTable'] = $claimTable;
83378337
}
8338+
if ( ! is_null($tableSubNumber)) {
8339+
$array['request']['tableSubNumber'] = $tableSubNumber;
8340+
}
83388341
$object = arrayToObject($array);
83398342
return $object;
83408343
} // END convertGetTableOrderV2Request()

0 commit comments

Comments
 (0)