Skip to content

Commit 1d6ca5f

Browse files
authored
PHPSDK-128: Improvement over MerchantSessionRequest object (#335)
1 parent 76c73bf commit 1d6ca5f

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

src/Api/Wallets/ApplePay/MerchantSessionRequest.php

+37-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,47 @@
1414
*/
1515
class MerchantSessionRequest extends RequestBody
1616
{
17+
/**
18+
* @var string
19+
*/
20+
private $validationUrl;
21+
22+
/**
23+
* @var string
24+
*/
25+
private $originDomain;
26+
1727
/**
1828
* @return array
1929
*/
2030
public function getData(): array
2131
{
22-
return $this->removeNullRecursive($this->data);
32+
return $this->removeNullRecursive(array_merge(
33+
[
34+
'validation_url' => $this->validationUrl ?? null,
35+
'origin_domain' => $this->originDomain ?? null,
36+
],
37+
$this->data
38+
));
39+
}
40+
41+
/**
42+
* @param string $validationUrl
43+
* @return MerchantSessionRequest
44+
*/
45+
public function addValidationUrl(string $validationUrl): MerchantSessionRequest
46+
{
47+
$this->validationUrl = $validationUrl;
48+
return $this;
49+
}
50+
51+
/**
52+
* @param string $originDomain
53+
* @return MerchantSessionRequest
54+
*/
55+
public function addOriginDomain(string $originDomain): MerchantSessionRequest
56+
{
57+
$this->originDomain = $originDomain;
58+
return $this;
2359
}
2460
}

0 commit comments

Comments
 (0)