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 DisputeSummary extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $acquirerDisputeReference = null;
19:
20: /**
21: * @var DisputeMerchantDataBase|null
22: */
23: public ?DisputeMerchantDataBase $merchantData = null;
24:
25: /**
26: * @var OriginalTransactionSummaryData|null
27: */
28: public ?OriginalTransactionSummaryData $originalTransactionData = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $schemeReason = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $schemeReasonDescription = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $unifiedCategory = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $unifiedReason = null;
49:
50: /**
51: * @return object
52: */
53: public function toObject(): object
54: {
55: $object = parent::toObject();
56: if (!is_null($this->acquirerDisputeReference)) {
57: $object->acquirerDisputeReference = $this->acquirerDisputeReference;
58: }
59: if (!is_null($this->merchantData)) {
60: $object->merchantData = $this->merchantData->toObject();
61: }
62: if (!is_null($this->originalTransactionData)) {
63: $object->originalTransactionData = $this->originalTransactionData->toObject();
64: }
65: if (!is_null($this->schemeReason)) {
66: $object->schemeReason = $this->schemeReason;
67: }
68: if (!is_null($this->schemeReasonDescription)) {
69: $object->schemeReasonDescription = $this->schemeReasonDescription;
70: }
71: if (!is_null($this->unifiedCategory)) {
72: $object->unifiedCategory = $this->unifiedCategory;
73: }
74: if (!is_null($this->unifiedReason)) {
75: $object->unifiedReason = $this->unifiedReason;
76: }
77: return $object;
78: }
79:
80: /**
81: * @param object $object
82: *
83: * @return $this
84: * @throws UnexpectedValueException
85: */
86: public function fromObject(object $object): DisputeSummary
87: {
88: parent::fromObject($object);
89: if (property_exists($object, 'acquirerDisputeReference')) {
90: $this->acquirerDisputeReference = $object->acquirerDisputeReference;
91: }
92: if (property_exists($object, 'merchantData')) {
93: if (!is_object($object->merchantData)) {
94: throw new UnexpectedValueException('value \'' . print_r($object->merchantData, true) . '\' is not an object');
95: }
96: $value = new DisputeMerchantDataBase();
97: $this->merchantData = $value->fromObject($object->merchantData);
98: }
99: if (property_exists($object, 'originalTransactionData')) {
100: if (!is_object($object->originalTransactionData)) {
101: throw new UnexpectedValueException('value \'' . print_r($object->originalTransactionData, true) . '\' is not an object');
102: }
103: $value = new OriginalTransactionSummaryData();
104: $this->originalTransactionData = $value->fromObject($object->originalTransactionData);
105: }
106: if (property_exists($object, 'schemeReason')) {
107: $this->schemeReason = $object->schemeReason;
108: }
109: if (property_exists($object, 'schemeReasonDescription')) {
110: $this->schemeReasonDescription = $object->schemeReasonDescription;
111: }
112: if (property_exists($object, 'unifiedCategory')) {
113: $this->unifiedCategory = $object->unifiedCategory;
114: }
115: if (property_exists($object, 'unifiedReason')) {
116: $this->unifiedReason = $object->unifiedReason;
117: }
118: return $this;
119: }
120: }
121: