1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class CardPaymentDataForRefund extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $brand = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $brandSelector = null;
24:
25: /**
26: * @var bool|null
27: */
28: public ?bool $captureImmediately = null;
29:
30: /**
31: * @var PlainCardData|null
32: */
33: public ?PlainCardData $cardData = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $cardEntryMode = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $cardholderVerificationMethod = null;
44:
45: /**
46: * @var NetworkTokenData|null
47: */
48: public ?NetworkTokenData $networkTokenData = null;
49:
50: /**
51: * @var OriginalTransactionReferences|null
52: */
53: public ?OriginalTransactionReferences $originalTransactionReferences = null;
54:
55: /**
56: * @var PointOfSaleData|null
57: */
58: public ?PointOfSaleData $pointOfSaleData = null;
59:
60: /**
61: * @var string|null
62: */
63: public ?string $walletId = null;
64:
65: /**
66: * @return object
67: */
68: public function toObject(): object
69: {
70: $object = parent::toObject();
71: if (!is_null($this->brand)) {
72: $object->brand = $this->brand;
73: }
74: if (!is_null($this->brandSelector)) {
75: $object->brandSelector = $this->brandSelector;
76: }
77: if (!is_null($this->captureImmediately)) {
78: $object->captureImmediately = $this->captureImmediately;
79: }
80: if (!is_null($this->cardData)) {
81: $object->cardData = $this->cardData->toObject();
82: }
83: if (!is_null($this->cardEntryMode)) {
84: $object->cardEntryMode = $this->cardEntryMode;
85: }
86: if (!is_null($this->cardholderVerificationMethod)) {
87: $object->cardholderVerificationMethod = $this->cardholderVerificationMethod;
88: }
89: if (!is_null($this->networkTokenData)) {
90: $object->networkTokenData = $this->networkTokenData->toObject();
91: }
92: if (!is_null($this->originalTransactionReferences)) {
93: $object->originalTransactionReferences = $this->originalTransactionReferences->toObject();
94: }
95: if (!is_null($this->pointOfSaleData)) {
96: $object->pointOfSaleData = $this->pointOfSaleData->toObject();
97: }
98: if (!is_null($this->walletId)) {
99: $object->walletId = $this->walletId;
100: }
101: return $object;
102: }
103:
104: /**
105: * @param object $object
106: *
107: * @return $this
108: * @throws UnexpectedValueException
109: */
110: public function fromObject(object $object): CardPaymentDataForRefund
111: {
112: parent::fromObject($object);
113: if (property_exists($object, 'brand')) {
114: $this->brand = $object->brand;
115: }
116: if (property_exists($object, 'brandSelector')) {
117: $this->brandSelector = $object->brandSelector;
118: }
119: if (property_exists($object, 'captureImmediately')) {
120: $this->captureImmediately = $object->captureImmediately;
121: }
122: if (property_exists($object, 'cardData')) {
123: if (!is_object($object->cardData)) {
124: throw new UnexpectedValueException('value \'' . print_r($object->cardData, true) . '\' is not an object');
125: }
126: $value = new PlainCardData();
127: $this->cardData = $value->fromObject($object->cardData);
128: }
129: if (property_exists($object, 'cardEntryMode')) {
130: $this->cardEntryMode = $object->cardEntryMode;
131: }
132: if (property_exists($object, 'cardholderVerificationMethod')) {
133: $this->cardholderVerificationMethod = $object->cardholderVerificationMethod;
134: }
135: if (property_exists($object, 'networkTokenData')) {
136: if (!is_object($object->networkTokenData)) {
137: throw new UnexpectedValueException('value \'' . print_r($object->networkTokenData, true) . '\' is not an object');
138: }
139: $value = new NetworkTokenData();
140: $this->networkTokenData = $value->fromObject($object->networkTokenData);
141: }
142: if (property_exists($object, 'originalTransactionReferences')) {
143: if (!is_object($object->originalTransactionReferences)) {
144: throw new UnexpectedValueException('value \'' . print_r($object->originalTransactionReferences, true) . '\' is not an object');
145: }
146: $value = new OriginalTransactionReferences();
147: $this->originalTransactionReferences = $value->fromObject($object->originalTransactionReferences);
148: }
149: if (property_exists($object, 'pointOfSaleData')) {
150: if (!is_object($object->pointOfSaleData)) {
151: throw new UnexpectedValueException('value \'' . print_r($object->pointOfSaleData, true) . '\' is not an object');
152: }
153: $value = new PointOfSaleData();
154: $this->pointOfSaleData = $value->fromObject($object->pointOfSaleData);
155: }
156: if (property_exists($object, 'walletId')) {
157: $this->walletId = $object->walletId;
158: }
159: return $this;
160: }
161: }
162: