From 4d1dc6ace8472a7604f61b8ebca6f4c988617b63 Mon Sep 17 00:00:00 2001 From: Javier Sampedro Date: Thu, 18 May 2017 14:38:33 +0200 Subject: [PATCH] Allow 'source' parameter when creating a customer --- src/Message/CreateCustomerRequest.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Message/CreateCustomerRequest.php b/src/Message/CreateCustomerRequest.php index e7ce20e1..13d7953e 100644 --- a/src/Message/CreateCustomerRequest.php +++ b/src/Message/CreateCustomerRequest.php @@ -104,6 +104,16 @@ public function setEmail($value) return $this->setParameter('email', $value); } + public function getSource() + { + return $this->getParameter('source'); + } + + public function setSource($value) + { + $this->setParameter('source', $value); + } + public function getData() { $data = array(); @@ -111,7 +121,7 @@ public function getData() if ($this->getToken()) { $data['card'] = $this->getToken(); - + if ($this->getEmail()) { $data['email'] = $this->getEmail(); } @@ -126,6 +136,10 @@ public function getData() $data['metadata'] = $this->getMetadata(); } + if ($this->getSource()) { + $data['source'] = $this->getSource(); + } + return $data; }