PluginProbe
MONEI Payments for WooCommerce / 4.2.0
MONEI Payments for WooCommerce v4.2.0
7.3.3 7.3.2 7.3.1 7.3.0 7.2.4 7.2.3 7.2.2 7.2.0 7.2.1 7.1.3 2.1.0 3.0.0 3.1.0 3.1.1 4.0.0 4.1.0 4.1.1 4.2.0 4.2.1 5.0 5.1.0 5.1.1 5.1.2 5.2.2 5.2.3 All 87 releases
monei / includes / lib / Model / PaymentPaymentMethod.php

PaymentPaymentMethod.php in MONEI Payments for WooCommerce 4.2.0, at includes/lib/Model/PaymentPaymentMethod.php

599 lines 14.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PaymentPaymentMethod
4 *
5 * PHP version 5
6 *
7 * @category Class
8 * @package OpenAPI\Client
9 * @author OpenAPI Generator team
10 * @link https://openapi-generator.tech
11 */
12
13 /**
14 * MONEI API v1
15 *
16 * The MONEI API is organized around [REST](https://en.wikipedia.org/wiki/Representational_State_Transfer). Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
17 *
18 * The version of the OpenAPI document: 1.0.0
19 *
20 * Generated by: https://openapi-generator.tech
21 * OpenAPI Generator version: 4.3.1
22 */
23
24 /**
25 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 * https://openapi-generator.tech
27 * Do not edit the class manually.
28 */
29
30 namespace OpenAPI\Client\Model;
31
32 use \ArrayAccess;
33 use \OpenAPI\Client\ObjectSerializer;
34
35 /**
36 * PaymentPaymentMethod Class Doc Comment
37 *
38 * @category Class
39 * @description Details about the payment method at the time of the transaction.
40 * @package OpenAPI\Client
41 * @author OpenAPI Generator team
42 * @link https://openapi-generator.tech
43 */
44 class PaymentPaymentMethod implements ModelInterface, ArrayAccess
45 {
46 const DISCRIMINATOR = null;
47
48 /**
49 * The original name of the model.
50 *
51 * @var string
52 */
53 protected static $openAPIModelName = 'Payment-PaymentMethod';
54
55 /**
56 * Array of property to type mappings. Used for (de)serialization
57 *
58 * @var string[]
59 */
60 protected static $openAPITypes = [
61 'country' => 'string',
62 'brand' => 'string',
63 'type' => 'string',
64 'three_d_secure' => 'bool',
65 'phone_number' => 'string',
66 'last4' => 'string',
67 'method' => 'string'
68 ];
69
70 /**
71 * Array of property to format mappings. Used for (de)serialization
72 *
73 * @var string[]
74 */
75 protected static $openAPIFormats = [
76 'country' => null,
77 'brand' => null,
78 'type' => null,
79 'three_d_secure' => null,
80 'phone_number' => null,
81 'last4' => null,
82 'method' => null
83 ];
84
85 /**
86 * Array of property to type mappings. Used for (de)serialization
87 *
88 * @return array
89 */
90 public static function openAPITypes()
91 {
92 return self::$openAPITypes;
93 }
94
95 /**
96 * Array of property to format mappings. Used for (de)serialization
97 *
98 * @return array
99 */
100 public static function openAPIFormats()
101 {
102 return self::$openAPIFormats;
103 }
104
105 /**
106 * Array of attributes where the key is the local name,
107 * and the value is the original name
108 *
109 * @var string[]
110 */
111 protected static $attributeMap = [
112 'country' => 'country',
113 'brand' => 'brand',
114 'type' => 'type',
115 'three_d_secure' => 'threeDSecure',
116 'phone_number' => 'phoneNumber',
117 'last4' => 'last4',
118 'method' => 'method'
119 ];
120
121 /**
122 * Array of attributes to setter functions (for deserialization of responses)
123 *
124 * @var string[]
125 */
126 protected static $setters = [
127 'country' => 'setCountry',
128 'brand' => 'setBrand',
129 'type' => 'setType',
130 'three_d_secure' => 'setThreeDSecure',
131 'phone_number' => 'setPhoneNumber',
132 'last4' => 'setLast4',
133 'method' => 'setMethod'
134 ];
135
136 /**
137 * Array of attributes to getter functions (for serialization of requests)
138 *
139 * @var string[]
140 */
141 protected static $getters = [
142 'country' => 'getCountry',
143 'brand' => 'getBrand',
144 'type' => 'getType',
145 'three_d_secure' => 'getThreeDSecure',
146 'phone_number' => 'getPhoneNumber',
147 'last4' => 'getLast4',
148 'method' => 'getMethod'
149 ];
150
151 /**
152 * Array of attributes where the key is the local name,
153 * and the value is the original name
154 *
155 * @return array
156 */
157 public static function attributeMap()
158 {
159 return self::$attributeMap;
160 }
161
162 /**
163 * Array of attributes to setter functions (for deserialization of responses)
164 *
165 * @return array
166 */
167 public static function setters()
168 {
169 return self::$setters;
170 }
171
172 /**
173 * Array of attributes to getter functions (for serialization of requests)
174 *
175 * @return array
176 */
177 public static function getters()
178 {
179 return self::$getters;
180 }
181
182 /**
183 * The original name of the model.
184 *
185 * @return string
186 */
187 public function getModelName()
188 {
189 return self::$openAPIModelName;
190 }
191
192 const BRAND_VISA = 'visa';
193 const BRAND_MASTERCARD = 'mastercard';
194 const BRAND_DINERS = 'diners';
195 const BRAND_AMEX = 'amex';
196 const BRAND_JCB = 'jcb';
197 const BRAND_UNIONPAY = 'unionpay';
198 const BRAND_UNKNOWN = 'unknown';
199 const TYPE_DEBIT = 'debit';
200 const TYPE_CREDIT = 'credit';
201 const METHOD_CARD = 'card';
202 const METHOD_BIZUM = 'bizum';
203 const METHOD_GOOGLE_PAY = 'googlePay';
204 const METHOD_APPLE_PAY = 'applePay';
205
206
207
208 /**
209 * Gets allowable values of the enum
210 *
211 * @return string[]
212 */
213 public function getBrandAllowableValues()
214 {
215 return [
216 self::BRAND_VISA,
217 self::BRAND_MASTERCARD,
218 self::BRAND_DINERS,
219 self::BRAND_AMEX,
220 self::BRAND_JCB,
221 self::BRAND_UNIONPAY,
222 self::BRAND_UNKNOWN,
223 ];
224 }
225
226 /**
227 * Gets allowable values of the enum
228 *
229 * @return string[]
230 */
231 public function getTypeAllowableValues()
232 {
233 return [
234 self::TYPE_DEBIT,
235 self::TYPE_CREDIT,
236 ];
237 }
238
239 /**
240 * Gets allowable values of the enum
241 *
242 * @return string[]
243 */
244 public function getMethodAllowableValues()
245 {
246 return [
247 self::METHOD_CARD,
248 self::METHOD_BIZUM,
249 self::METHOD_GOOGLE_PAY,
250 self::METHOD_APPLE_PAY,
251 ];
252 }
253
254
255 /**
256 * Associative array for storing property values
257 *
258 * @var mixed[]
259 */
260 protected $container = [];
261
262 /**
263 * Constructor
264 *
265 * @param mixed[] $data Associated array of property values
266 * initializing the model
267 */
268 public function __construct(array $data = null)
269 {
270 $this->container['country'] = isset($data['country']) ? $data['country'] : null;
271 $this->container['brand'] = isset($data['brand']) ? $data['brand'] : null;
272 $this->container['type'] = isset($data['type']) ? $data['type'] : null;
273 $this->container['three_d_secure'] = isset($data['three_d_secure']) ? $data['three_d_secure'] : null;
274 $this->container['phone_number'] = isset($data['phone_number']) ? $data['phone_number'] : null;
275 $this->container['last4'] = isset($data['last4']) ? $data['last4'] : null;
276 $this->container['method'] = isset($data['method']) ? $data['method'] : null;
277 }
278
279 /**
280 * Show all the invalid properties with reasons.
281 *
282 * @return array invalid properties with reasons
283 */
284 public function listInvalidProperties()
285 {
286 $invalidProperties = [];
287
288 $allowedValues = $this->getBrandAllowableValues();
289 if (!is_null($this->container['brand']) && !in_array($this->container['brand'], $allowedValues, true)) {
290 $invalidProperties[] = sprintf(
291 "invalid value for 'brand', must be one of '%s'",
292 implode("', '", $allowedValues)
293 );
294 }
295
296 $allowedValues = $this->getTypeAllowableValues();
297 if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
298 $invalidProperties[] = sprintf(
299 "invalid value for 'type', must be one of '%s'",
300 implode("', '", $allowedValues)
301 );
302 }
303
304 $allowedValues = $this->getMethodAllowableValues();
305 if (!is_null($this->container['method']) && !in_array($this->container['method'], $allowedValues, true)) {
306 $invalidProperties[] = sprintf(
307 "invalid value for 'method', must be one of '%s'",
308 implode("', '", $allowedValues)
309 );
310 }
311
312 return $invalidProperties;
313 }
314
315 /**
316 * Validate all the properties in the model
317 * return true if all passed
318 *
319 * @return bool True if all properties are valid
320 */
321 public function valid()
322 {
323 return count($this->listInvalidProperties()) === 0;
324 }
325
326
327 /**
328 * Gets country
329 *
330 * @return string|null
331 */
332 public function getCountry()
333 {
334 return $this->container['country'];
335 }
336
337 /**
338 * Sets country
339 *
340 * @param string|null $country Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
341 *
342 * @return $this
343 */
344 public function setCountry($country)
345 {
346 $this->container['country'] = $country;
347
348 return $this;
349 }
350
351 /**
352 * Gets brand
353 *
354 * @return string|null
355 */
356 public function getBrand()
357 {
358 return $this->container['brand'];
359 }
360
361 /**
362 * Sets brand
363 *
364 * @param string|null $brand Card brand.
365 *
366 * @return $this
367 */
368 public function setBrand($brand)
369 {
370 $allowedValues = $this->getBrandAllowableValues();
371 if (!is_null($brand) && !in_array($brand, $allowedValues, true)) {
372 throw new \InvalidArgumentException(
373 sprintf(
374 "Invalid value for 'brand', must be one of '%s'",
375 implode("', '", $allowedValues)
376 )
377 );
378 }
379 $this->container['brand'] = $brand;
380
381 return $this;
382 }
383
384 /**
385 * Gets type
386 *
387 * @return string|null
388 */
389 public function getType()
390 {
391 return $this->container['type'];
392 }
393
394 /**
395 * Sets type
396 *
397 * @param string|null $type Card type `debit` or `credit`.
398 *
399 * @return $this
400 */
401 public function setType($type)
402 {
403 $allowedValues = $this->getTypeAllowableValues();
404 if (!is_null($type) && !in_array($type, $allowedValues, true)) {
405 throw new \InvalidArgumentException(
406 sprintf(
407 "Invalid value for 'type', must be one of '%s'",
408 implode("', '", $allowedValues)
409 )
410 );
411 }
412 $this->container['type'] = $type;
413
414 return $this;
415 }
416
417 /**
418 * Gets three_d_secure
419 *
420 * @return bool|null
421 */
422 public function getThreeDSecure()
423 {
424 return $this->container['three_d_secure'];
425 }
426
427 /**
428 * Sets three_d_secure
429 *
430 * @param bool|null $three_d_secure Wether this transaction used 3D Secure authentication.
431 *
432 * @return $this
433 */
434 public function setThreeDSecure($three_d_secure)
435 {
436 $this->container['three_d_secure'] = $three_d_secure;
437
438 return $this;
439 }
440
441 /**
442 * Gets phone_number
443 *
444 * @return string|null
445 */
446 public function getPhoneNumber()
447 {
448 return $this->container['phone_number'];
449 }
450
451 /**
452 * Sets phone_number
453 *
454 * @param string|null $phone_number The phone number used to pay with `bizum`.
455 *
456 * @return $this
457 */
458 public function setPhoneNumber($phone_number)
459 {
460 $this->container['phone_number'] = $phone_number;
461
462 return $this;
463 }
464
465 /**
466 * Gets last4
467 *
468 * @return string|null
469 */
470 public function getLast4()
471 {
472 return $this->container['last4'];
473 }
474
475 /**
476 * Sets last4
477 *
478 * @param string|null $last4 The last four digits of the card.
479 *
480 * @return $this
481 */
482 public function setLast4($last4)
483 {
484 $this->container['last4'] = $last4;
485
486 return $this;
487 }
488
489 /**
490 * Gets method
491 *
492 * @return string|null
493 */
494 public function getMethod()
495 {
496 return $this->container['method'];
497 }
498
499 /**
500 * Sets method
501 *
502 * @param string|null $method Payment method type.
503 *
504 * @return $this
505 */
506 public function setMethod($method)
507 {
508 $allowedValues = $this->getMethodAllowableValues();
509 if (!is_null($method) && !in_array($method, $allowedValues, true)) {
510 throw new \InvalidArgumentException(
511 sprintf(
512 "Invalid value for 'method', must be one of '%s'",
513 implode("', '", $allowedValues)
514 )
515 );
516 }
517 $this->container['method'] = $method;
518
519 return $this;
520 }
521 /**
522 * Returns true if offset exists. False otherwise.
523 *
524 * @param integer $offset Offset
525 *
526 * @return boolean
527 */
528 public function offsetExists($offset)
529 {
530 return isset($this->container[$offset]);
531 }
532
533 /**
534 * Gets offset.
535 *
536 * @param integer $offset Offset
537 *
538 * @return mixed
539 */
540 public function offsetGet($offset)
541 {
542 return isset($this->container[$offset]) ? $this->container[$offset] : null;
543 }
544
545 /**
546 * Sets value based on offset.
547 *
548 * @param integer $offset Offset
549 * @param mixed $value Value to be set
550 *
551 * @return void
552 */
553 public function offsetSet($offset, $value)
554 {
555 if (is_null($offset)) {
556 $this->container[] = $value;
557 } else {
558 $this->container[$offset] = $value;
559 }
560 }
561
562 /**
563 * Unsets offset.
564 *
565 * @param integer $offset Offset
566 *
567 * @return void
568 */
569 public function offsetUnset($offset)
570 {
571 unset($this->container[$offset]);
572 }
573
574 /**
575 * Gets the string presentation of the object
576 *
577 * @return string
578 */
579 public function __toString()
580 {
581 return json_encode(
582 ObjectSerializer::sanitizeForSerialization($this),
583 JSON_PRETTY_PRINT
584 );
585 }
586
587 /**
588 * Gets a header-safe presentation of the object
589 *
590 * @return string
591 */
592 public function toHeaderValue()
593 {
594 return json_encode(ObjectSerializer::sanitizeForSerialization($this));
595 }
596 }
597
598
599