|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PaymentGateway\PayPalSdk\Subscriptions; |
|
4
|
|
|
|
|
5
|
|
|
class ShippingDetailAddressPortable |
|
6
|
|
|
{ |
|
7
|
|
|
private string $countryCode; |
|
8
|
|
|
private ?string $addressLine1 = null; |
|
9
|
|
|
private ?string $addressLine2 = null; |
|
10
|
|
|
private ?string $adminArea1 = null; |
|
11
|
|
|
private ?string $adminArea2 = null; |
|
12
|
|
|
private ?string $postalCode = null; |
|
13
|
|
|
|
|
14
|
|
|
public function __construct(string $countryCode) |
|
15
|
|
|
{ |
|
16
|
|
|
$this->countryCode = $countryCode; |
|
17
|
|
|
} |
|
18
|
|
|
|
|
19
|
|
|
public function getCountryCode(): string |
|
20
|
|
|
{ |
|
21
|
|
|
return $this->countryCode; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
public function setCountryCode(string $countryCode): self |
|
25
|
|
|
{ |
|
26
|
|
|
$this->countryCode = $countryCode; |
|
27
|
|
|
|
|
28
|
|
|
return $this; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getAddressLine1(): ?string |
|
32
|
|
|
{ |
|
33
|
|
|
return $this->addressLine1; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function setAddressLine1(?string $addressLine1): self |
|
37
|
|
|
{ |
|
38
|
|
|
$this->addressLine1 = $addressLine1; |
|
39
|
|
|
|
|
40
|
|
|
return $this; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function getAddressLine2(): ?string |
|
44
|
|
|
{ |
|
45
|
|
|
return $this->addressLine2; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function setAddressLine2(?string $addressLine2): self |
|
49
|
|
|
{ |
|
50
|
|
|
$this->addressLine2 = $addressLine2; |
|
51
|
|
|
|
|
52
|
|
|
return $this; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function getAdminArea1(): ?string |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->adminArea1; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function setAdminArea1(?string $adminArea1): self |
|
61
|
|
|
{ |
|
62
|
|
|
$this->adminArea1 = $adminArea1; |
|
63
|
|
|
|
|
64
|
|
|
return $this; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getAdminArea2(): ?string |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->adminArea2; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function setAdminArea2(?string $adminArea2): self |
|
73
|
|
|
{ |
|
74
|
|
|
$this->adminArea2 = $adminArea2; |
|
75
|
|
|
|
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function getPostalCode(): ?string |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->postalCode; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function setPostalCode(?string $postalCode): self |
|
85
|
|
|
{ |
|
86
|
|
|
$this->postalCode = $postalCode; |
|
87
|
|
|
|
|
88
|
|
|
return $this; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
public function toArray(): array |
|
92
|
|
|
{ |
|
93
|
|
|
return [ |
|
94
|
|
|
'country_code' => $this->countryCode, |
|
95
|
|
|
'address_line_1' => $this->addressLine1, |
|
96
|
|
|
'address_line_2' => $this->addressLine2, |
|
97
|
|
|
'admin_area_1' => $this->adminArea1, |
|
98
|
|
|
'admin_area_2' => $this->adminArea2, |
|
99
|
|
|
'postal_code' => $this->postalCode |
|
100
|
|
|
]; |
|
101
|
|
|
} |
|
102
|
|
|
} |
|
103
|
|
|
|