commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
24use stdClass;
25
29final class PaymentMethodDraftBuilder implements Builder
30{
35 private $key;
36
41 private $name;
42
47 private $customer;
48
53 private $businessUnit;
54
59 private $method;
60
65 private $paymentInterface;
66
71 private $interfaceAccount;
72
77 private $token;
78
83 private $paymentMethodStatus;
84
89 private $default;
90
95 private $custom;
96
103 public function getKey()
104 {
105 return $this->key;
106 }
107
114 public function getName()
115 {
116 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
117 }
118
126 public function getCustomer()
127 {
128 return $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer;
129 }
130
138 public function getBusinessUnit()
139 {
140 return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit;
141 }
142
149 public function getMethod()
150 {
151 return $this->method;
152 }
153
160 public function getPaymentInterface()
161 {
162 return $this->paymentInterface;
163 }
164
171 public function getInterfaceAccount()
172 {
173 return $this->interfaceAccount;
174 }
175
182 public function getToken()
183 {
184 return $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token;
185 }
186
193 public function getPaymentMethodStatus()
194 {
195 return $this->paymentMethodStatus;
196 }
197
205 public function getDefault()
206 {
207 return $this->default;
208 }
209
216 public function getCustom()
217 {
218 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
219 }
220
225 public function withKey(?string $key)
226 {
227 $this->key = $key;
228
229 return $this;
230 }
231
236 public function withName(?LocalizedString $name)
237 {
238 $this->name = $name;
239
240 return $this;
241 }
242
247 public function withCustomer(?CustomerResourceIdentifier $customer)
248 {
249 $this->customer = $customer;
250
251 return $this;
252 }
253
258 public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit)
259 {
260 $this->businessUnit = $businessUnit;
261
262 return $this;
263 }
264
269 public function withMethod(?string $method)
270 {
271 $this->method = $method;
272
273 return $this;
274 }
275
280 public function withPaymentInterface(?string $paymentInterface)
281 {
282 $this->paymentInterface = $paymentInterface;
283
284 return $this;
285 }
286
291 public function withInterfaceAccount(?string $interfaceAccount)
292 {
293 $this->interfaceAccount = $interfaceAccount;
294
295 return $this;
296 }
297
302 public function withToken(?PaymentMethodToken $token)
303 {
304 $this->token = $token;
305
306 return $this;
307 }
308
313 public function withPaymentMethodStatus(?string $paymentMethodStatus)
314 {
315 $this->paymentMethodStatus = $paymentMethodStatus;
316
317 return $this;
318 }
319
324 public function withDefault(?bool $default)
325 {
326 $this->default = $default;
327
328 return $this;
329 }
330
335 public function withCustom(?CustomFieldsDraft $custom)
336 {
337 $this->custom = $custom;
338
339 return $this;
340 }
341
347 {
348 $this->name = $name;
349
350 return $this;
351 }
352
358 {
359 $this->customer = $customer;
360
361 return $this;
362 }
363
369 {
370 $this->businessUnit = $businessUnit;
371
372 return $this;
373 }
374
380 {
381 $this->token = $token;
382
383 return $this;
384 }
385
391 {
392 $this->custom = $custom;
393
394 return $this;
395 }
396
397 public function build(): PaymentMethodDraft
398 {
399 return new PaymentMethodDraftModel(
400 $this->key,
401 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
402 $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer,
403 $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit,
404 $this->method,
405 $this->paymentInterface,
406 $this->interfaceAccount,
407 $this->token instanceof PaymentMethodTokenBuilder ? $this->token->build() : $this->token,
408 $this->paymentMethodStatus,
409 $this->default,
410 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
411 );
412 }
413
414 public static function of(): PaymentMethodDraftBuilder
415 {
416 return new self();
417 }
418}
withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit)