public function getPaymentHistory()
{
$paymentHistory = array();
$auxStartDate = new \DateTime("2000-01-01");
$auxStartDate->setTime(0, 0);
$auxEndDate = new \DateTime();
$params = array('CredentialToken' => $this->_token, 'PublisherId' => $this->_user, 'StartDate' => \strtotime($auxStartDate->format("Y-m-d")), 'EndDate' => \strtotime($auxEndDate->format("Y-m-d")));
$accountServiceUrl = 'https://api.affili.net/V2.0/AccountService.svc?wsdl';
$accountService = new \SoapClient($accountServiceUrl, array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE, 'soap_version' => SOAP_1_1));
$paymentList = self::affilinetCall('payment', $accountService, $params);
if (isset($paymentList->PaymentInformationCollection) && !\is_array($paymentList->PaymentInformationCollection)) {
$paymentList->PaymentInformationCollection = array($paymentList->PaymentInformationCollection);
}
if (isset($paymentList->PaymentInformationCollection)) {
foreach ($paymentList->PaymentInformationCollection as $payment) {
$obj = array();
$obj['method'] = $payment->PaymentType;
$obj['pid'] = $payment->PaymentId;
$obj['value'] = $payment->GrossTotal;
$obj['date'] = $payment->PaymentDate;
$paymentHistory[] = $obj;
}
}
$this->_paymentHistory = $paymentHistory;
return $paymentHistory;
}