getParameter('email'); } /** * Sets the customer's email address. * * @param string $value * @return CreateCustomerRequest provides a fluent interface. */ public function setEmail($value) { return $this->setParameter('email', $value); } /** * Get the customer's source. * * @return string */ public function getSource() { return $this->getParameter('source'); } /** * Sets the customer's source. * * @param string $value * @return CreateCustomerRequest provides a fluent interface. */ public function setSource($value) { $this->setParameter('source', $value); } public function getData() { $this->validate('customerReference'); $data = array(); $data['description'] = $this->getDescription(); if ($this->getToken()) { $data['card'] = $this->getToken(); } elseif ($this->getCard()) { $this->getCard()->validate(); $data['card'] = $this->getCardData(); $data['email'] = $this->getCard()->getEmail(); } elseif ($this->getEmail()) { $data['email'] = $this->getEmail(); } if ($this->getMetadata()) { $data['metadata'] = $this->getMetadata(); } if ($this->getSource()) { $data['source'] = $this->getSource(); } return $data; } public function getEndpoint() { return $this->endpoint.'/customers/'.$this->getCustomerReference(); } }