public function getData() { $this->validate('startDate', 'endDate'); $now = new DateTime('now'); $startDate = $this->getStartDate(); $finalDate = $this->getEndDate(); //Start Date and End Date less than today if ($startDate >= $now) { throw new InvalidRequestException("The initial date must be less than today"); } if ($finalDate >= $now) { throw new InvalidRequestException("The final date must be less than today"); } //The interval between the initial date and final date must be less than 30 days if ($startDate->diff($finalDate)->days > 30) { throw new InvalidRequestException("The interval between the initial date and final date must be less than 30 days"); } $data = ['initialDate' => $startDate->format('Y-m-d\\TH:i'), 'finalDate' => $finalDate->format('Y-m-d\\TH:i'), 'page' => $this->getPage(), 'maxPageResults' => $this->getMaxPageResults()]; return array_merge(parent::getData(), $data); }
public function getData() { $this->validate('currency', 'transactionReference'); $data = ['currency' => $this->getCurrency(), 'reference' => $this->getTransactionReference(), 'redirectURL' => $this->getReturnUrl(), 'notificationURL' => $this->getNotifyUrl()]; return array_merge(parent::getData(), $data, $this->getItemData(), $this->getCustomerData(), $this->getShippingData()); }