1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class Card extends CardWithoutCvv
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $cvv = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $partialPin = null;
24:
25: /**
26: * @return object
27: */
28: public function toObject(): object
29: {
30: $object = parent::toObject();
31: if (!is_null($this->cvv)) {
32: $object->cvv = $this->cvv;
33: }
34: if (!is_null($this->partialPin)) {
35: $object->partialPin = $this->partialPin;
36: }
37: return $object;
38: }
39:
40: /**
41: * @param object $object
42: *
43: * @return $this
44: * @throws UnexpectedValueException
45: */
46: public function fromObject(object $object): Card
47: {
48: parent::fromObject($object);
49: if (property_exists($object, 'cvv')) {
50: $this->cvv = $object->cvv;
51: }
52: if (property_exists($object, 'partialPin')) {
53: $this->partialPin = $object->partialPin;
54: }
55: return $this;
56: }
57: }
58: