commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentStatusBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class PaymentStatusBuilder implements Builder
24{
29 private $interfaceCode;
30
35 private $interfaceText;
36
41 private $state;
42
49 public function getInterfaceCode()
50 {
51 return $this->interfaceCode;
52 }
53
60 public function getInterfaceText()
61 {
62 return $this->interfaceText;
63 }
64
71 public function getState()
72 {
73 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
74 }
75
80 public function withInterfaceCode(?string $interfaceCode)
81 {
82 $this->interfaceCode = $interfaceCode;
83
84 return $this;
85 }
86
91 public function withInterfaceText(?string $interfaceText)
92 {
93 $this->interfaceText = $interfaceText;
94
95 return $this;
96 }
97
102 public function withState(?StateReference $state)
103 {
104 $this->state = $state;
105
106 return $this;
107 }
108
114 {
115 $this->state = $state;
116
117 return $this;
118 }
119
120 public function build(): PaymentStatus
121 {
122 return new PaymentStatusModel(
123 $this->interfaceCode,
124 $this->interfaceText,
125 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state
126 );
127 }
128
129 public static function of(): PaymentStatusBuilder
130 {
131 return new self();
132 }
133}