Skip to content

Commit

Permalink
Fix getTableOrderV2 and added sub table number as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis van den Heerik committed Dec 11, 2019
1 parent fd526d1 commit c072ce7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Mplusqapiclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class MplusQAPIclient
{
const CLIENT_VERSION = '1.27.1';
const CLIENT_VERSION = '1.27.2';
const WSDL_TTL = 300;

var $MIN_API_VERSION_MAJOR = 0;
Expand Down Expand Up @@ -3014,16 +3014,16 @@ public function getTableOrder($terminal, $branchNumber, $tableNumber, $attempts=

//----------------------------------------------------------------------------

public function getTableOrderV2($terminal, $tableNumber, $claimTable=null, $attempts=0)
public function getTableOrderV2($terminal, $tableNumber, $claimTable=null, $tableSubNumber = null, $attempts=0)
{
try {
$result = $this->client->getTableOrderV2($this->parser->convertGetTableOrderV2Request($terminal, $terminal['branchNumber'], $tableNumber, $claimTable));
$result = $this->client->getTableOrderV2($this->parser->convertGetTableOrderV2Request($terminal, $tableNumber, $tableSubNumber, $claimTable));
return $this->parser->parseGetTableOrderResult($result);
} catch (SoapFault $e) {
$msg = $e->getMessage();
if (false !== stripos($msg, 'Could not connect to host') and $attempts < 3) {
sleep(1);
return $this->getTableOrderV2($terminal, $branchNumber, $tableNumber, $attempts+1);
return $this->getTableOrderV2($terminal, $tableNumber, $claimTable, $tableSubNumber, $attempts+1);
} else {
throw new MplusQAPIException('SoapFault occurred: '.$msg, 0, $e);
}
Expand Down Expand Up @@ -8271,18 +8271,21 @@ public function convertGetTableOrderRequest($terminal, $branchNumber, $tableNumb

//----------------------------------------------------------------------------

public function convertGetTableOrderV2Request($terminal, $branchNumber, $tableNumber, $claimTable)
public function convertGetTableOrderV2Request($terminal, $tableNumber, $tableSubNumber, $claimTable)
{
$terminal = $this->convertTerminal($terminal);
$branchNumber = $this->convertBranchNumber($branchNumber);
$tableNumber = $this->convertTableNumber($tableNumber);
$array = array(
'terminal'=>$terminal->terminal,
'request'=>array('tableNumber'=>$tableNumber->tableNumber),
'request'=>array(
'tableNumber'=>intval($tableNumber)
),
);
if ( ! is_null($claimTable)) {
$array['request']['claimTable'] = $claimTable;
}
if ( ! is_null($tableSubNumber)) {
$array['request']['tableSubNumber'] = $tableSubNumber;
}
$object = arrayToObject($array);
return $object;
} // END convertGetTableOrderV2Request()
Expand Down

0 comments on commit c072ce7

Please sign in to comment.