Skip to content

Commit dbab96b

Browse files
Moussa Sidibesidibos
authored andcommitted
SDK-603: Add a setter for DocumentDetails with string value
1 parent 57346da commit dbab96b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sandbox/src/Http/RequestBuilder.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,25 @@ public function setDocumentDetails(SandboxDocumentDetails $documentDetails, $opt
178178
return $this;
179179
}
180180

181+
public function setDocumentDetailsWithString($value, $optional = 'true', array $anchors = [])
182+
{
183+
$this->addAttribute($this->createAttribute(
184+
Profile::ATTR_DOCUMENT_DETAILS,
185+
$value,
186+
'',
187+
$optional,
188+
$anchors
189+
));
190+
return $this;
191+
}
192+
181193
public function setAgeVerification(SandboxAgeVerification $ageVerification)
182194
{
183195
$this->addAttribute($ageVerification);
184196
return $this;
185197
}
186198

187-
private function addAttribute(SandboxAttribute $attribute)
199+
public function addAttribute(SandboxAttribute $attribute)
188200
{
189201
$this->sandboxAttributes[] = [
190202
'name' => $attribute->getName(),
@@ -193,6 +205,7 @@ private function addAttribute(SandboxAttribute $attribute)
193205
'optional' => $attribute->getOptional(),
194206
'anchors' => $this->formatAnchors($attribute->getAnchors())
195207
];
208+
return $this;
196209
}
197210

198211
private function formatAnchors(array $anchors)

0 commit comments

Comments
 (0)