commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodInfoDraftModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
33
38 protected $method;
39
44 protected $name;
45
50 protected $token;
51
57
62 protected $custom;
63
64
68 public function __construct(
69 ?string $paymentInterface = null,
70 ?string $method = null,
71 ?LocalizedString $name = null,
73 ?string $interfaceAccount = null,
75 ) {
76 $this->paymentInterface = $paymentInterface;
77 $this->method = $method;
78 $this->name = $name;
79 $this->token = $token;
80 $this->interfaceAccount = $interfaceAccount;
81 $this->custom = $custom;
82 }
83
92 public function getPaymentInterface()
93 {
94 if (is_null($this->paymentInterface)) {
96 $data = $this->raw(self::FIELD_PAYMENT_INTERFACE);
97 if (is_null($data)) {
98 return null;
99 }
100 $this->paymentInterface = (string) $data;
101 }
102
104 }
105
112 public function getMethod()
113 {
114 if (is_null($this->method)) {
116 $data = $this->raw(self::FIELD_METHOD);
117 if (is_null($data)) {
118 return null;
119 }
120 $this->method = (string) $data;
121 }
122
123 return $this->method;
124 }
125
132 public function getName()
133 {
134 if (is_null($this->name)) {
136 $data = $this->raw(self::FIELD_NAME);
137 if (is_null($data)) {
138 return null;
139 }
140
141 $this->name = LocalizedStringModel::of($data);
142 }
143
144 return $this->name;
145 }
146
153 public function getToken()
154 {
155 if (is_null($this->token)) {
157 $data = $this->raw(self::FIELD_TOKEN);
158 if (is_null($data)) {
159 return null;
160 }
161
162 $this->token = PaymentMethodTokenModel::of($data);
163 }
164
165 return $this->token;
166 }
167
174 public function getInterfaceAccount()
175 {
176 if (is_null($this->interfaceAccount)) {
178 $data = $this->raw(self::FIELD_INTERFACE_ACCOUNT);
179 if (is_null($data)) {
180 return null;
181 }
182 $this->interfaceAccount = (string) $data;
183 }
184
186 }
187
194 public function getCustom()
195 {
196 if (is_null($this->custom)) {
198 $data = $this->raw(self::FIELD_CUSTOM);
199 if (is_null($data)) {
200 return null;
201 }
202
203 $this->custom = CustomFieldsDraftModel::of($data);
204 }
205
206 return $this->custom;
207 }
208
209
213 public function setPaymentInterface(?string $paymentInterface): void
214 {
215 $this->paymentInterface = $paymentInterface;
216 }
217
221 public function setMethod(?string $method): void
222 {
223 $this->method = $method;
224 }
225
229 public function setName(?LocalizedString $name): void
230 {
231 $this->name = $name;
232 }
233
237 public function setToken(?PaymentMethodToken $token): void
238 {
239 $this->token = $token;
240 }
241
245 public function setInterfaceAccount(?string $interfaceAccount): void
246 {
247 $this->interfaceAccount = $interfaceAccount;
248 }
249
253 public function setCustom(?CustomFieldsDraft $custom): void
254 {
255 $this->custom = $custom;
256 }
257}
__construct(?string $paymentInterface=null, ?string $method=null, ?LocalizedString $name=null, ?PaymentMethodToken $token=null, ?string $interfaceAccount=null, ?CustomFieldsDraft $custom=null)