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 OriginalTransactionData extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $cardholderVerificationMethod = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $localTransactionDateTime = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $paymentCategory = null;
29:
30: /**
31: * @var PaymentMethodData|null
32: */
33: public ?PaymentMethodData $paymentMethodData = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $pointOfSaleEntryMode = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $schemeProcessedDateTime = null;
44:
45: /**
46: * @var AmountData|null
47: */
48: public ?AmountData $settlementAmount = null;
49:
50: /**
51: * @var AmountData|null
52: */
53: public ?AmountData $transactionAmount = null;
54:
55: /**
56: * @var TransactionReferencesDispute|null
57: */
58: public ?TransactionReferencesDispute $transactionReferences = null;
59:
60: /**
61: * @return object
62: */
63: public function toObject(): object
64: {
65: $object = parent::toObject();
66: if (!is_null($this->cardholderVerificationMethod)) {
67: $object->cardholderVerificationMethod = $this->cardholderVerificationMethod;
68: }
69: if (!is_null($this->localTransactionDateTime)) {
70: $object->localTransactionDateTime = $this->localTransactionDateTime;
71: }
72: if (!is_null($this->paymentCategory)) {
73: $object->paymentCategory = $this->paymentCategory;
74: }
75: if (!is_null($this->paymentMethodData)) {
76: $object->paymentMethodData = $this->paymentMethodData->toObject();
77: }
78: if (!is_null($this->pointOfSaleEntryMode)) {
79: $object->pointOfSaleEntryMode = $this->pointOfSaleEntryMode;
80: }
81: if (!is_null($this->schemeProcessedDateTime)) {
82: $object->schemeProcessedDateTime = $this->schemeProcessedDateTime;
83: }
84: if (!is_null($this->settlementAmount)) {
85: $object->settlementAmount = $this->settlementAmount->toObject();
86: }
87: if (!is_null($this->transactionAmount)) {
88: $object->transactionAmount = $this->transactionAmount->toObject();
89: }
90: if (!is_null($this->transactionReferences)) {
91: $object->transactionReferences = $this->transactionReferences->toObject();
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): OriginalTransactionData
103: {
104: parent::fromObject($object);
105: if (property_exists($object, 'cardholderVerificationMethod')) {
106: $this->cardholderVerificationMethod = $object->cardholderVerificationMethod;
107: }
108: if (property_exists($object, 'localTransactionDateTime')) {
109: $this->localTransactionDateTime = $object->localTransactionDateTime;
110: }
111: if (property_exists($object, 'paymentCategory')) {
112: $this->paymentCategory = $object->paymentCategory;
113: }
114: if (property_exists($object, 'paymentMethodData')) {
115: if (!is_object($object->paymentMethodData)) {
116: throw new UnexpectedValueException('value \'' . print_r($object->paymentMethodData, true) . '\' is not an object');
117: }
118: $value = new PaymentMethodData();
119: $this->paymentMethodData = $value->fromObject($object->paymentMethodData);
120: }
121: if (property_exists($object, 'pointOfSaleEntryMode')) {
122: $this->pointOfSaleEntryMode = $object->pointOfSaleEntryMode;
123: }
124: if (property_exists($object, 'schemeProcessedDateTime')) {
125: $this->schemeProcessedDateTime = $object->schemeProcessedDateTime;
126: }
127: if (property_exists($object, 'settlementAmount')) {
128: if (!is_object($object->settlementAmount)) {
129: throw new UnexpectedValueException('value \'' . print_r($object->settlementAmount, true) . '\' is not an object');
130: }
131: $value = new AmountData();
132: $this->settlementAmount = $value->fromObject($object->settlementAmount);
133: }
134: if (property_exists($object, 'transactionAmount')) {
135: if (!is_object($object->transactionAmount)) {
136: throw new UnexpectedValueException('value \'' . print_r($object->transactionAmount, true) . '\' is not an object');
137: }
138: $value = new AmountData();
139: $this->transactionAmount = $value->fromObject($object->transactionAmount);
140: }
141: if (property_exists($object, 'transactionReferences')) {
142: if (!is_object($object->transactionReferences)) {
143: throw new UnexpectedValueException('value \'' . print_r($object->transactionReferences, true) . '\' is not an object');
144: }
145: $value = new TransactionReferencesDispute();
146: $this->transactionReferences = $value->fromObject($object->transactionReferences);
147: }
148: return $this;
149: }
150: }
151: