. * Only use this if you are using Connect API * * @param string $customer The id of the customer * @return \Omnipay\Common\Message\AbstractRequest|\Omnipay\Stripe\Message\CreateTokenRequest */ public function setCustomer($customer) { return $this->setParameter('customer', $customer); } /** * Get the raw data array for this message. The format of this varies from gateway to * gateway, but will usually be either an associative array, or a SimpleXMLElement. * @return mixed * @throws InvalidRequestException */ public function getData() { $data = array(); if ($this->getParameter('customer')) { $data['customer'] = $this->getParameter('customer'); } elseif ($this->getParameter('card')) { $data['card'] = $this->getParameter('card'); } else { throw new InvalidRequestException("You must pass either the card or the customer"); } return $data; } /** * @inheritdoc * * @return string The endpoint for the create token request. */ public function getEndpoint() { return $this->endpoint . '/tokens'; } }