/** * Create subscriber * * @param array $data * @return mixed */ public function create(array $data) { $data['subscriptionHandle'] = $this->subscriptionHandle; if (!isset($data['debtor'])) { throw new InvalidArgumentException("It's required to provide a debtor number."); } $debtor = new Debtor($this->client_raw); $data['debtorHandle'] = $debtor->getHandle($data['debtor']); unset($data['debtor']); $data = array_merge(['startDate' => date('Y-m-d H:i:s'), 'registeredDate' => date('Y-m-d H:i:s'), 'endDate' => date('Y-m-d H:i:s', strtotime('+99 YEAR'))], $data); return $this->client->Subscriber_Create($data)->Subscriber_CreateResponse->Subscriber_CreateResult; }