Skip to content

Commit 936bf09

Browse files
authored
Merge pull request #76 from jsampedro77/accept-source-param
Allow 'source' parameter when creating a customer
2 parents 65f3b98 + 4d1dc6a commit 936bf09

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Message/CreateCustomerRequest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,24 @@ public function setEmail($value)
104104
return $this->setParameter('email', $value);
105105
}
106106

107+
public function getSource()
108+
{
109+
return $this->getParameter('source');
110+
}
111+
112+
public function setSource($value)
113+
{
114+
$this->setParameter('source', $value);
115+
}
116+
107117
public function getData()
108118
{
109119
$data = array();
110120
$data['description'] = $this->getDescription();
111121

112122
if ($this->getToken()) {
113123
$data['card'] = $this->getToken();
114-
124+
115125
if ($this->getEmail()) {
116126
$data['email'] = $this->getEmail();
117127
}
@@ -126,6 +136,10 @@ public function getData()
126136
$data['metadata'] = $this->getMetadata();
127137
}
128138

139+
if ($this->getSource()) {
140+
$data['source'] = $this->getSource();
141+
}
142+
129143
return $data;
130144
}
131145

0 commit comments

Comments
 (0)