commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentSetMethodInfoActionModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
28 public const DISCRIMINATOR_VALUE = 'setMethodInfo';
33 protected $action;
34
40
45 protected $method;
46
51 protected $name;
52
57 protected $token;
58
64
69 protected $custom;
70
71
75 public function __construct(
76 ?string $paymentInterface = null,
77 ?string $method = null,
78 ?LocalizedString $name = null,
80 ?string $interfaceAccount = null,
82 ?string $action = null
83 ) {
84 $this->paymentInterface = $paymentInterface;
85 $this->method = $method;
86 $this->name = $name;
87 $this->token = $token;
88 $this->interfaceAccount = $interfaceAccount;
89 $this->custom = $custom;
90 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
91 }
92
97 public function getAction()
98 {
99 if (is_null($this->action)) {
101 $data = $this->raw(self::FIELD_ACTION);
102 if (is_null($data)) {
103 return null;
104 }
105 $this->action = (string) $data;
106 }
107
108 return $this->action;
109 }
110
120 public function getPaymentInterface()
121 {
122 if (is_null($this->paymentInterface)) {
124 $data = $this->raw(self::FIELD_PAYMENT_INTERFACE);
125 if (is_null($data)) {
126 return null;
127 }
128 $this->paymentInterface = (string) $data;
129 }
130
132 }
133
142 public function getMethod()
143 {
144 if (is_null($this->method)) {
146 $data = $this->raw(self::FIELD_METHOD);
147 if (is_null($data)) {
148 return null;
149 }
150 $this->method = (string) $data;
151 }
152
153 return $this->method;
154 }
155
164 public function getName()
165 {
166 if (is_null($this->name)) {
168 $data = $this->raw(self::FIELD_NAME);
169 if (is_null($data)) {
170 return null;
171 }
172
173 $this->name = LocalizedStringModel::of($data);
174 }
175
176 return $this->name;
177 }
178
187 public function getToken()
188 {
189 if (is_null($this->token)) {
191 $data = $this->raw(self::FIELD_TOKEN);
192 if (is_null($data)) {
193 return null;
194 }
195
196 $this->token = PaymentMethodTokenModel::of($data);
197 }
198
199 return $this->token;
200 }
201
210 public function getInterfaceAccount()
211 {
212 if (is_null($this->interfaceAccount)) {
214 $data = $this->raw(self::FIELD_INTERFACE_ACCOUNT);
215 if (is_null($data)) {
216 return null;
217 }
218 $this->interfaceAccount = (string) $data;
219 }
220
222 }
223
236 public function getCustom()
237 {
238 if (is_null($this->custom)) {
240 $data = $this->raw(self::FIELD_CUSTOM);
241 if (is_null($data)) {
242 return null;
243 }
244
245 $this->custom = CustomFieldsDraftModel::of($data);
246 }
247
248 return $this->custom;
249 }
250
251
255 public function setPaymentInterface(?string $paymentInterface): void
256 {
257 $this->paymentInterface = $paymentInterface;
258 }
259
263 public function setMethod(?string $method): void
264 {
265 $this->method = $method;
266 }
267
271 public function setName(?LocalizedString $name): void
272 {
273 $this->name = $name;
274 }
275
279 public function setToken(?PaymentMethodToken $token): void
280 {
281 $this->token = $token;
282 }
283
287 public function setInterfaceAccount(?string $interfaceAccount): void
288 {
289 $this->interfaceAccount = $interfaceAccount;
290 }
291
295 public function setCustom(?CustomFieldsDraft $custom): void
296 {
297 $this->custom = $custom;
298 }
299}
__construct(?string $paymentInterface=null, ?string $method=null, ?LocalizedString $name=null, ?PaymentMethodToken $token=null, ?string $interfaceAccount=null, ?CustomFieldsDraft $custom=null, ?string $action=null)