commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodDraftModel.php
1<?php
2
3declare(strict_types=1);
10
23use stdClass;
24
29{
34 protected $key;
35
40 protected $name;
41
46 protected $customer;
47
52 protected $businessUnit;
53
58 protected $method;
59
65
71
76 protected $token;
77
83
88 protected $default;
89
94 protected $custom;
95
96
100 public function __construct(
101 ?string $key = null,
102 ?LocalizedString $name = null,
105 ?string $method = null,
106 ?string $paymentInterface = null,
107 ?string $interfaceAccount = null,
109 ?string $paymentMethodStatus = null,
110 ?bool $default = null,
112 ) {
113 $this->key = $key;
114 $this->name = $name;
115 $this->customer = $customer;
116 $this->businessUnit = $businessUnit;
117 $this->method = $method;
118 $this->paymentInterface = $paymentInterface;
119 $this->interfaceAccount = $interfaceAccount;
120 $this->token = $token;
121 $this->paymentMethodStatus = $paymentMethodStatus;
122 $this->default = $default;
123 $this->custom = $custom;
124 }
125
132 public function getKey()
133 {
134 if (is_null($this->key)) {
136 $data = $this->raw(self::FIELD_KEY);
137 if (is_null($data)) {
138 return null;
139 }
140 $this->key = (string) $data;
141 }
142
143 return $this->key;
144 }
145
152 public function getName()
153 {
154 if (is_null($this->name)) {
156 $data = $this->raw(self::FIELD_NAME);
157 if (is_null($data)) {
158 return null;
159 }
160
161 $this->name = LocalizedStringModel::of($data);
162 }
163
164 return $this->name;
165 }
166
174 public function getCustomer()
175 {
176 if (is_null($this->customer)) {
178 $data = $this->raw(self::FIELD_CUSTOMER);
179 if (is_null($data)) {
180 return null;
181 }
182
183 $this->customer = CustomerResourceIdentifierModel::of($data);
184 }
185
186 return $this->customer;
187 }
188
196 public function getBusinessUnit()
197 {
198 if (is_null($this->businessUnit)) {
200 $data = $this->raw(self::FIELD_BUSINESS_UNIT);
201 if (is_null($data)) {
202 return null;
203 }
204
205 $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data);
206 }
207
208 return $this->businessUnit;
209 }
210
217 public function getMethod()
218 {
219 if (is_null($this->method)) {
221 $data = $this->raw(self::FIELD_METHOD);
222 if (is_null($data)) {
223 return null;
224 }
225 $this->method = (string) $data;
226 }
227
228 return $this->method;
229 }
230
237 public function getPaymentInterface()
238 {
239 if (is_null($this->paymentInterface)) {
241 $data = $this->raw(self::FIELD_PAYMENT_INTERFACE);
242 if (is_null($data)) {
243 return null;
244 }
245 $this->paymentInterface = (string) $data;
246 }
247
249 }
250
257 public function getInterfaceAccount()
258 {
259 if (is_null($this->interfaceAccount)) {
261 $data = $this->raw(self::FIELD_INTERFACE_ACCOUNT);
262 if (is_null($data)) {
263 return null;
264 }
265 $this->interfaceAccount = (string) $data;
266 }
267
269 }
270
277 public function getToken()
278 {
279 if (is_null($this->token)) {
281 $data = $this->raw(self::FIELD_TOKEN);
282 if (is_null($data)) {
283 return null;
284 }
285
286 $this->token = PaymentMethodTokenModel::of($data);
287 }
288
289 return $this->token;
290 }
291
298 public function getPaymentMethodStatus()
299 {
300 if (is_null($this->paymentMethodStatus)) {
302 $data = $this->raw(self::FIELD_PAYMENT_METHOD_STATUS);
303 if (is_null($data)) {
304 return null;
305 }
306 $this->paymentMethodStatus = (string) $data;
307 }
308
310 }
311
319 public function getDefault()
320 {
321 if (is_null($this->default)) {
323 $data = $this->raw(self::FIELD_DEFAULT);
324 if (is_null($data)) {
325 return null;
326 }
327 $this->default = (bool) $data;
328 }
329
330 return $this->default;
331 }
332
339 public function getCustom()
340 {
341 if (is_null($this->custom)) {
343 $data = $this->raw(self::FIELD_CUSTOM);
344 if (is_null($data)) {
345 return null;
346 }
347
348 $this->custom = CustomFieldsDraftModel::of($data);
349 }
350
351 return $this->custom;
352 }
353
354
358 public function setKey(?string $key): void
359 {
360 $this->key = $key;
361 }
362
366 public function setName(?LocalizedString $name): void
367 {
368 $this->name = $name;
369 }
370
375 {
376 $this->customer = $customer;
377 }
378
383 {
384 $this->businessUnit = $businessUnit;
385 }
386
390 public function setMethod(?string $method): void
391 {
392 $this->method = $method;
393 }
394
398 public function setPaymentInterface(?string $paymentInterface): void
399 {
400 $this->paymentInterface = $paymentInterface;
401 }
402
406 public function setInterfaceAccount(?string $interfaceAccount): void
407 {
408 $this->interfaceAccount = $interfaceAccount;
409 }
410
414 public function setToken(?PaymentMethodToken $token): void
415 {
416 $this->token = $token;
417 }
418
422 public function setPaymentMethodStatus(?string $paymentMethodStatus): void
423 {
424 $this->paymentMethodStatus = $paymentMethodStatus;
425 }
426
430 public function setDefault(?bool $default): void
431 {
432 $this->default = $default;
433 }
434
438 public function setCustom(?CustomFieldsDraft $custom): void
439 {
440 $this->custom = $custom;
441 }
442}
setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
__construct(?string $key=null, ?LocalizedString $name=null, ?CustomerResourceIdentifier $customer=null, ?BusinessUnitResourceIdentifier $businessUnit=null, ?string $method=null, ?string $paymentInterface=null, ?string $interfaceAccount=null, ?PaymentMethodToken $token=null, ?string $paymentMethodStatus=null, ?bool $default=null, ?CustomFieldsDraft $custom=null)