commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodBuilder.php
1<?php
2
3declare(strict_types=1);
10
30use DateTimeImmutable;
31use stdClass;
32
36final class PaymentMethodBuilder implements Builder
37{
42 private $id;
43
48 private $version;
49
54 private $createdAt;
55
60 private $lastModifiedAt;
61
66 private $key;
67
72 private $name;
73
78 private $customer;
79
84 private $businessUnit;
85
90 private $method;
91
96 private $paymentInterface;
97
102 private $interfaceAccount;
103
108 private $token;
109
114 private $paymentMethodStatus;
115
120 private $default;
121
126 private $custom;
127
132 private $lastModifiedBy;
133
138 private $createdBy;
139
146 public function getId()
147 {
148 return $this->id;
149 }
150
157 public function getVersion()
158 {
159 return $this->version;
160 }
161
168 public function getCreatedAt()
169 {
170 return $this->createdAt;
171 }
172
179 public function getLastModifiedAt()
180 {
181 return $this->lastModifiedAt;
182 }
183
190 public function getKey()
191 {
192 return $this->key;
193 }
194
201 public function getName()
202 {
203 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
204 }
205
213 public function getCustomer()
214 {
215 return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
216 }
217
225 public function getBusinessUnit()
226 {
227 return $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit;
228 }
229
236 public function getMethod()
237 {
238 return $this->method;
239 }
240
247 public function getPaymentInterface()
248 {
249 return $this->paymentInterface;
250 }
251
258 public function getInterfaceAccount()
259 {
260 return $this->interfaceAccount;
261 }
262
269 public function getToken()
270 {
271 return $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token;
272 }
273
280 public function getPaymentMethodStatus()
281 {
282 return $this->paymentMethodStatus;
283 }
284
292 public function getDefault()
293 {
294 return $this->default;
295 }
296
303 public function getCustom()
304 {
305 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
306 }
307
314 public function getLastModifiedBy()
315 {
316 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
317 }
318
325 public function getCreatedBy()
326 {
327 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
328 }
329
334 public function withId(?string $id)
335 {
336 $this->id = $id;
337
338 return $this;
339 }
340
345 public function withVersion(?int $version)
346 {
347 $this->version = $version;
348
349 return $this;
350 }
351
356 public function withCreatedAt(?DateTimeImmutable $createdAt)
357 {
358 $this->createdAt = $createdAt;
359
360 return $this;
361 }
362
367 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
368 {
369 $this->lastModifiedAt = $lastModifiedAt;
370
371 return $this;
372 }
373
378 public function withKey(?string $key)
379 {
380 $this->key = $key;
381
382 return $this;
383 }
384
389 public function withName(?LocalizedString $name)
390 {
391 $this->name = $name;
392
393 return $this;
394 }
395
400 public function withCustomer(?CustomerReference $customer)
401 {
402 $this->customer = $customer;
403
404 return $this;
405 }
406
411 public function withBusinessUnit(?BusinessUnitKeyReference $businessUnit)
412 {
413 $this->businessUnit = $businessUnit;
414
415 return $this;
416 }
417
422 public function withMethod(?string $method)
423 {
424 $this->method = $method;
425
426 return $this;
427 }
428
433 public function withPaymentInterface(?string $paymentInterface)
434 {
435 $this->paymentInterface = $paymentInterface;
436
437 return $this;
438 }
439
444 public function withInterfaceAccount(?string $interfaceAccount)
445 {
446 $this->interfaceAccount = $interfaceAccount;
447
448 return $this;
449 }
450
455 public function withToken(?PaymentMethodToken $token)
456 {
457 $this->token = $token;
458
459 return $this;
460 }
461
466 public function withPaymentMethodStatus(?string $paymentMethodStatus)
467 {
468 $this->paymentMethodStatus = $paymentMethodStatus;
469
470 return $this;
471 }
472
477 public function withDefault(?bool $default)
478 {
479 $this->default = $default;
480
481 return $this;
482 }
483
488 public function withCustom(?CustomFields $custom)
489 {
490 $this->custom = $custom;
491
492 return $this;
493 }
494
499 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
500 {
501 $this->lastModifiedBy = $lastModifiedBy;
502
503 return $this;
504 }
505
510 public function withCreatedBy(?CreatedBy $createdBy)
511 {
512 $this->createdBy = $createdBy;
513
514 return $this;
515 }
516
522 {
523 $this->name = $name;
524
525 return $this;
526 }
527
533 {
534 $this->customer = $customer;
535
536 return $this;
537 }
538
544 {
545 $this->businessUnit = $businessUnit;
546
547 return $this;
548 }
549
555 {
556 $this->token = $token;
557
558 return $this;
559 }
560
565 public function withCustomBuilder(?CustomFieldsBuilder $custom)
566 {
567 $this->custom = $custom;
568
569 return $this;
570 }
571
576 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
577 {
578 $this->lastModifiedBy = $lastModifiedBy;
579
580 return $this;
581 }
582
587 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
588 {
589 $this->createdBy = $createdBy;
590
591 return $this;
592 }
593
594 public function build(): PaymentMethod
595 {
596 return new PaymentMethodModel(
597 $this->id,
598 $this->version,
599 $this->createdAt,
600 $this->lastModifiedAt,
601 $this->key,
602 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
603 $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
604 $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit,
605 $this->method,
606 $this->paymentInterface,
607 $this->interfaceAccount,
608 $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token,
609 $this->paymentMethodStatus,
610 $this->default,
611 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
612 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
613 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy
614 );
615 }
616
617 public static function of(): PaymentMethodBuilder
618 {
619 return new self();
620 }
621}
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withBusinessUnitBuilder(?BusinessUnitKeyReferenceBuilder $businessUnit)