commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentMethodInfoModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
33
38 protected $method;
39
44 protected $name;
45
50 protected $token;
51
57
62 protected $custom;
63
64
68 public function __construct(
69 ?string $paymentInterface = null,
70 ?string $method = null,
71 ?LocalizedString $name = null,
73 ?string $interfaceAccount = null,
74 ?CustomFields $custom = null
75 ) {
76 $this->paymentInterface = $paymentInterface;
77 $this->method = $method;
78 $this->name = $name;
79 $this->token = $token;
80 $this->interfaceAccount = $interfaceAccount;
81 $this->custom = $custom;
82 }
83
91 public function getPaymentInterface()
92 {
93 if (is_null($this->paymentInterface)) {
95 $data = $this->raw(self::FIELD_PAYMENT_INTERFACE);
96 if (is_null($data)) {
97 return null;
98 }
99 $this->paymentInterface = (string) $data;
100 }
101
103 }
104
111 public function getMethod()
112 {
113 if (is_null($this->method)) {
115 $data = $this->raw(self::FIELD_METHOD);
116 if (is_null($data)) {
117 return null;
118 }
119 $this->method = (string) $data;
120 }
121
122 return $this->method;
123 }
124
131 public function getName()
132 {
133 if (is_null($this->name)) {
135 $data = $this->raw(self::FIELD_NAME);
136 if (is_null($data)) {
137 return null;
138 }
139
140 $this->name = LocalizedStringModel::of($data);
141 }
142
143 return $this->name;
144 }
145
152 public function getToken()
153 {
154 if (is_null($this->token)) {
156 $data = $this->raw(self::FIELD_TOKEN);
157 if (is_null($data)) {
158 return null;
159 }
160
161 $this->token = PaymentMethodTokenModel::of($data);
162 }
163
164 return $this->token;
165 }
166
173 public function getInterfaceAccount()
174 {
175 if (is_null($this->interfaceAccount)) {
177 $data = $this->raw(self::FIELD_INTERFACE_ACCOUNT);
178 if (is_null($data)) {
179 return null;
180 }
181 $this->interfaceAccount = (string) $data;
182 }
183
185 }
186
193 public function getCustom()
194 {
195 if (is_null($this->custom)) {
197 $data = $this->raw(self::FIELD_CUSTOM);
198 if (is_null($data)) {
199 return null;
200 }
201
202 $this->custom = CustomFieldsModel::of($data);
203 }
204
205 return $this->custom;
206 }
207
208
212 public function setPaymentInterface(?string $paymentInterface): void
213 {
214 $this->paymentInterface = $paymentInterface;
215 }
216
220 public function setMethod(?string $method): void
221 {
222 $this->method = $method;
223 }
224
228 public function setName(?LocalizedString $name): void
229 {
230 $this->name = $name;
231 }
232
236 public function setToken(?PaymentMethodToken $token): void
237 {
238 $this->token = $token;
239 }
240
244 public function setInterfaceAccount(?string $interfaceAccount): void
245 {
246 $this->interfaceAccount = $interfaceAccount;
247 }
248
252 public function setCustom(?CustomFields $custom): void
253 {
254 $this->custom = $custom;
255 }
256}
__construct(?string $paymentInterface=null, ?string $method=null, ?LocalizedString $name=null, ?PaymentMethodToken $token=null, ?string $interfaceAccount=null, ?CustomFields $custom=null)