/** * Creates a listTransactions transaction through the HpsCreditService */ public function execute() { parent::execute(); $listTransactionsSvc = new HpsCreditService($this->service->servicesConfig()); return $listTransactionsSvc->listTransactions($this->startDate, $this->endDate, $this->filterBy); }
/** * The list charges test method. */ public function testtestListWhenConfigValidShouldListChargesWithInteger() { $testConfig = new TestServicesConfig(); $chargeSvc = new HpsCreditService($testConfig->ValidMultiUseConfig()); $dateFormat = 'Y-m-d\\TH:i:s.00\\Z'; $dateMinus10 = new DateTime(); $dateMinus10->sub(new DateInterval('P1D')); $dateMinus10Utc = gmdate($dateFormat, $dateMinus10->Format('U')); $nowUtc = gmdate($dateFormat); $items = $chargeSvc->listTransactions($dateMinus10Utc, $nowUtc, HpsTransactionType::CAPTURE); // HpsTransactionType::CAPTURE $this->assertNotNull($items); $this->assertGreaterThan(1, count($items)); $charge0 = $items[0]->transactionId; $charge1 = $items[1]->transactionId; $this->assertNotNull($charge0); $this->assertNotNull($charge1); $this->assertNotEquals($charge0, $charge1); }