commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodInfoDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
22use stdClass;
23
28{
33 private $paymentInterface;
34
39 private $method;
40
45 private $name;
46
51 private $token;
52
57 private $interfaceAccount;
58
63 private $custom;
64
73 public function getPaymentInterface()
74 {
75 return $this->paymentInterface;
76 }
77
84 public function getMethod()
85 {
86 return $this->method;
87 }
88
95 public function getName()
96 {
97 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
98 }
99
106 public function getToken()
107 {
108 return $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token;
109 }
110
117 public function getInterfaceAccount()
118 {
119 return $this->interfaceAccount;
120 }
121
128 public function getCustom()
129 {
130 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
131 }
132
137 public function withPaymentInterface(?string $paymentInterface)
138 {
139 $this->paymentInterface = $paymentInterface;
140
141 return $this;
142 }
143
148 public function withMethod(?string $method)
149 {
150 $this->method = $method;
151
152 return $this;
153 }
154
159 public function withName(?LocalizedString $name)
160 {
161 $this->name = $name;
162
163 return $this;
164 }
165
170 public function withToken(?PaymentMethodToken $token)
171 {
172 $this->token = $token;
173
174 return $this;
175 }
176
181 public function withInterfaceAccount(?string $interfaceAccount)
182 {
183 $this->interfaceAccount = $interfaceAccount;
184
185 return $this;
186 }
187
192 public function withCustom(?CustomFieldsDraft $custom)
193 {
194 $this->custom = $custom;
195
196 return $this;
197 }
198
204 {
205 $this->name = $name;
206
207 return $this;
208 }
209
215 {
216 $this->token = $token;
217
218 return $this;
219 }
220
226 {
227 $this->custom = $custom;
228
229 return $this;
230 }
231
232 public function build(): PaymentMethodInfoDraft
233 {
235 $this->paymentInterface,
236 $this->method,
237 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
238 $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token,
239 $this->interfaceAccount,
240 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
241 );
242 }
243
244 public static function of(): PaymentMethodInfoDraftBuilder
245 {
246 return new self();
247 }
248}