commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodInfoBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
23final class PaymentMethodInfoBuilder implements Builder
24{
29 private $paymentInterface;
30
35 private $method;
36
41 private $name;
42
51 public function getPaymentInterface()
52 {
53 return $this->paymentInterface;
54 }
55
62 public function getMethod()
63 {
64 return $this->method;
65 }
66
73 public function getName()
74 {
75 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
76 }
77
82 public function withPaymentInterface(?string $paymentInterface)
83 {
84 $this->paymentInterface = $paymentInterface;
85
86 return $this;
87 }
88
93 public function withMethod(?string $method)
94 {
95 $this->method = $method;
96
97 return $this;
98 }
99
104 public function withName(?LocalizedString $name)
105 {
106 $this->name = $name;
107
108 return $this;
109 }
110
116 {
117 $this->name = $name;
118
119 return $this;
120 }
121
122 public function build(): PaymentMethodInfo
123 {
124 return new PaymentMethodInfoModel(
125 $this->paymentInterface,
126 $this->method,
127 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name
128 );
129 }
130
131 public static function of(): PaymentMethodInfoBuilder
132 {
133 return new self();
134 }
135}