From a3db29f697ee447840e771833efa7b85bd37c7c6 Mon Sep 17 00:00:00 2001 From: mrSmedal <39346326+mrSmedal@users.noreply.github.com> Date: Wed, 30 Jan 2019 15:39:06 -0500 Subject: [PATCH 1/2] Support reporting by individual device ID This should allow users to report by individual Device IDs. Reporting by individual Device IDs is useful for merchant using multiple Portico devices. --- src/Services/Gateway/HpsCreditService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Services/Gateway/HpsCreditService.php b/src/Services/Gateway/HpsCreditService.php index a63ce3b..5dcb1d9 100644 --- a/src/Services/Gateway/HpsCreditService.php +++ b/src/Services/Gateway/HpsCreditService.php @@ -372,6 +372,7 @@ public function get($transactionId) /** * @param $startDate * @param $endDate + * @param null $deviceID * @param null $filterBy * * @return array|null @@ -379,7 +380,7 @@ public function get($transactionId) * @throws \HpsGatewayException * @throws \HpsInvalidRequestException */ - public function listTransactions($startDate, $endDate, $filterBy = null) + public function listTransactions($startDate, $endDate, $deviceId = null, $filterBy = null) { $this->_filterBy = $filterBy; date_default_timezone_set("UTC"); @@ -395,6 +396,9 @@ public function listTransactions($startDate, $endDate, $filterBy = null) $hpsReportActivity = $xml->createElement('hps:ReportActivity'); $hpsReportActivity->appendChild($xml->createElement('hps:RptStartUtcDT', $startDate)); $hpsReportActivity->appendChild($xml->createElement('hps:RptEndUtcDT', $endDate)); + if ($deviceId != null) { + $hpsReportActivity->appendChild($xml->createElement('hps:DeviceId', $deviceId)); + }; $hpsTransaction->appendChild($hpsReportActivity); return $this->_submitTransaction($hpsTransaction, 'ReportActivity'); From 4a98c5bdd1bae969c4b796182384c1ba15e5d849 Mon Sep 17 00:00:00 2001 From: mrSmedal <39346326+mrSmedal@users.noreply.github.com> Date: Thu, 31 Jan 2019 10:58:25 -0500 Subject: [PATCH 2/2] Update HpsCreditService.php --- src/Services/Gateway/HpsCreditService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Services/Gateway/HpsCreditService.php b/src/Services/Gateway/HpsCreditService.php index 5dcb1d9..7d14514 100644 --- a/src/Services/Gateway/HpsCreditService.php +++ b/src/Services/Gateway/HpsCreditService.php @@ -371,16 +371,16 @@ public function get($transactionId) } /** * @param $startDate - * @param $endDate - * @param null $deviceID + * @param $endDate * @param null $filterBy + * @param null $deviceID * * @return array|null * @throws \HpsException * @throws \HpsGatewayException * @throws \HpsInvalidRequestException */ - public function listTransactions($startDate, $endDate, $deviceId = null, $filterBy = null) + public function listTransactions($startDate, $endDate, $filterBy = null, $deviceId = null) { $this->_filterBy = $filterBy; date_default_timezone_set("UTC"); @@ -396,9 +396,9 @@ public function listTransactions($startDate, $endDate, $deviceId = null, $filter $hpsReportActivity = $xml->createElement('hps:ReportActivity'); $hpsReportActivity->appendChild($xml->createElement('hps:RptStartUtcDT', $startDate)); $hpsReportActivity->appendChild($xml->createElement('hps:RptEndUtcDT', $endDate)); - if ($deviceId != null) { + if ($deviceId !== null) { $hpsReportActivity->appendChild($xml->createElement('hps:DeviceId', $deviceId)); - }; + } $hpsTransaction->appendChild($hpsReportActivity); return $this->_submitTransaction($hpsTransaction, 'ReportActivity');