/** * Creates a listTransactions transaction through the HpsCreditService */ public function execute() { parent::execute(); date_default_timezone_set("UTC"); $dateFormat = 'Y-m-d\\TH:i:s.00\\Z'; $current = new DateTime(); $currentTime = $current->format($dateFormat); HpsInputValidation::checkDateNotFuture($this->startDate); HpsInputValidation::checkDateNotFuture($this->endDate); $xml = new DOMDocument(); $hpsTransaction = $xml->createElement('hps:Transaction'); $hpsReportActivity = $xml->createElement('hps:ReportActivity'); $hpsReportActivity->appendChild($xml->createElement('hps:RptStartUtcDT', $this->startDate)); $hpsReportActivity->appendChild($xml->createElement('hps:RptEndUtcDT', $this->endDate)); $hpsTransaction->appendChild($hpsReportActivity); return $this->service->_submitTransaction($hpsTransaction, 'ReportActivity'); }
public function listTransactions($startDate, $endDate, $filterBy = null) { $this->_filterBy = $filterBy; date_default_timezone_set("UTC"); $dateFormat = 'Y-m-d\\TH:i:s.00\\Z'; $current = new DateTime(); $currentTime = $current->format($dateFormat); if ($startDate > $currentTime) { throw HpsExceptionMapper::map_sdk_exception(HpsSdkCodes::$invalidStartDate); } else { if ($endDate > $currentTime) { throw HpsExceptionMapper::map_sdk_exception(HpsSdkCodes::$invalidEndDate); } } HpsInputValidation::checkDateNotFuture($startDate); HpsInputValidation::checkDateNotFuture($endDate); $xml = new DOMDocument(); $hpsTransaction = $xml->createElement('hps:Transaction'); $hpsReportActivity = $xml->createElement('hps:ReportActivity'); $hpsReportActivity->appendChild($xml->createElement('hps:RptStartUtcDT', $startDate)); $hpsReportActivity->appendChild($xml->createElement('hps:RptEndUtcDT', $endDate)); $hpsTransaction->appendChild($hpsReportActivity); return $this->_submitTransaction($hpsTransaction, 'ReportActivity'); }