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: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class DecryptedPaymentData extends DataObject
15: {
16: /**
17: * @var string|null
18: *
19: * @deprecated Use decryptedPaymentData.paymentMethod instead
20: */
21: public ?string $authMethod = null;
22:
23: /**
24: * @var string|null
25: */
26: public ?string $cardholderName = null;
27:
28: /**
29: * @var string|null
30: */
31: public ?string $cryptogram = null;
32:
33: /**
34: * @var string|null
35: */
36: public ?string $dpan = null;
37:
38: /**
39: * @var int|null
40: */
41: public ?int $eci = null;
42:
43: /**
44: * @var string|null
45: */
46: public ?string $expiryDate = null;
47:
48: /**
49: * @var string|null
50: */
51: public ?string $pan = null;
52:
53: /**
54: * @var string|null
55: */
56: public ?string $paymentMethod = null;
57:
58: /**
59: * @return object
60: */
61: public function toObject(): object
62: {
63: $object = parent::toObject();
64: if (!is_null($this->authMethod)) {
65: $object->authMethod = $this->authMethod;
66: }
67: if (!is_null($this->cardholderName)) {
68: $object->cardholderName = $this->cardholderName;
69: }
70: if (!is_null($this->cryptogram)) {
71: $object->cryptogram = $this->cryptogram;
72: }
73: if (!is_null($this->dpan)) {
74: $object->dpan = $this->dpan;
75: }
76: if (!is_null($this->eci)) {
77: $object->eci = $this->eci;
78: }
79: if (!is_null($this->expiryDate)) {
80: $object->expiryDate = $this->expiryDate;
81: }
82: if (!is_null($this->pan)) {
83: $object->pan = $this->pan;
84: }
85: if (!is_null($this->paymentMethod)) {
86: $object->paymentMethod = $this->paymentMethod;
87: }
88: return $object;
89: }
90:
91: /**
92: * @param object $object
93: *
94: * @return $this
95: * @throws UnexpectedValueException
96: */
97: public function fromObject(object $object): DecryptedPaymentData
98: {
99: parent::fromObject($object);
100: if (property_exists($object, 'authMethod')) {
101: $this->authMethod = $object->authMethod;
102: }
103: if (property_exists($object, 'cardholderName')) {
104: $this->cardholderName = $object->cardholderName;
105: }
106: if (property_exists($object, 'cryptogram')) {
107: $this->cryptogram = $object->cryptogram;
108: }
109: if (property_exists($object, 'dpan')) {
110: $this->dpan = $object->dpan;
111: }
112: if (property_exists($object, 'eci')) {
113: $this->eci = $object->eci;
114: }
115: if (property_exists($object, 'expiryDate')) {
116: $this->expiryDate = $object->expiryDate;
117: }
118: if (property_exists($object, 'pan')) {
119: $this->pan = $object->pan;
120: }
121: if (property_exists($object, 'paymentMethod')) {
122: $this->paymentMethod = $object->paymentMethod;
123: }
124: return $this;
125: }
126: }
127: