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 PointOfSaleData|null
52: */
53: public ?PointOfSaleData $pointOfSaleData = null;
54:
55: /**
56: * @var string|null
57: */
58: public ?string $walletId = null;
59:
60: /**
61: * @return object
62: */
63: public function toObject(): object
64: {
65: $object = parent::toObject();
66: if (!is_null($this->brand)) {
67: $object->brand = $this->brand;
68: }
69: if (!is_null($this->brandSelector)) {
70: $object->brandSelector = $this->brandSelector;
71: }
72: if (!is_null($this->captureImmediately)) {
73: $object->captureImmediately = $this->captureImmediately;
74: }
75: if (!is_null($this->cardData)) {
76: $object->cardData = $this->cardData->toObject();
77: }
78: if (!is_null($this->cardEntryMode)) {
79: $object->cardEntryMode = $this->cardEntryMode;
80: }
81: if (!is_null($this->cardholderVerificationMethod)) {
82: $object->cardholderVerificationMethod = $this->cardholderVerificationMethod;
83: }
84: if (!is_null($this->networkTokenData)) {
85: $object->networkTokenData = $this->networkTokenData->toObject();
86: }
87: if (!is_null($this->pointOfSaleData)) {
88: $object->pointOfSaleData = $this->pointOfSaleData->toObject();
89: }
90: if (!is_null($this->walletId)) {
91: $object->walletId = $this->walletId;
92: }
93: return $object;
94: }
95:
96: /**
97: * @param object $object
98: *
99: * @return $this
100: * @throws UnexpectedValueException
101: */
102: public function fromObject(object $object): CardPaymentDataForRefund
103: {
104: parent::fromObject($object);
105: if (property_exists($object, 'brand')) {
106: $this->brand = $object->brand;
107: }
108: if (property_exists($object, 'brandSelector')) {
109: $this->brandSelector = $object->brandSelector;
110: }
111: if (property_exists($object, 'captureImmediately')) {
112: $this->captureImmediately = $object->captureImmediately;
113: }
114: if (property_exists($object, 'cardData')) {
115: if (!is_object($object->cardData)) {
116: throw new UnexpectedValueException('value \'' . print_r($object->cardData, true) . '\' is not an object');
117: }
118: $value = new PlainCardData();
119: $this->cardData = $value->fromObject($object->cardData);
120: }
121: if (property_exists($object, 'cardEntryMode')) {
122: $this->cardEntryMode = $object->cardEntryMode;
123: }
124: if (property_exists($object, 'cardholderVerificationMethod')) {
125: $this->cardholderVerificationMethod = $object->cardholderVerificationMethod;
126: }
127: if (property_exists($object, 'networkTokenData')) {
128: if (!is_object($object->networkTokenData)) {
129: throw new UnexpectedValueException('value \'' . print_r($object->networkTokenData, true) . '\' is not an object');
130: }
131: $value = new NetworkTokenData();
132: $this->networkTokenData = $value->fromObject($object->networkTokenData);
133: }
134: if (property_exists($object, 'pointOfSaleData')) {
135: if (!is_object($object->pointOfSaleData)) {
136: throw new UnexpectedValueException('value \'' . print_r($object->pointOfSaleData, true) . '\' is not an object');
137: }
138: $value = new PointOfSaleData();
139: $this->pointOfSaleData = $value->fromObject($object->pointOfSaleData);
140: }
141: if (property_exists($object, 'walletId')) {
142: $this->walletId = $object->walletId;
143: }
144: return $this;
145: }
146: }
147: