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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class MobilePaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $authorisationCode = null;
19:
20: /**
21: * @var CardFraudResults|null
22: */
23: public ?CardFraudResults $fraudResults = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $initialSchemeTransactionId = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $network = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $originalTransactionLinkId = null;
39:
40: /**
41: * @var MobilePaymentData|null
42: */
43: public ?MobilePaymentData $paymentData = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $schemeTransactionId = null;
49:
50: /**
51: * @var ThreeDSecureResults|null
52: */
53: public ?ThreeDSecureResults $threeDSecureResults = null;
54:
55: /**
56: * @var string|null
57: */
58: public ?string $token = null;
59:
60: /**
61: * @var string|null
62: */
63: public ?string $transactionLinkId = null;
64:
65: /**
66: * @return object
67: */
68: public function toObject(): object
69: {
70: $object = parent::toObject();
71: if (!is_null($this->authorisationCode)) {
72: $object->authorisationCode = $this->authorisationCode;
73: }
74: if (!is_null($this->fraudResults)) {
75: $object->fraudResults = $this->fraudResults->toObject();
76: }
77: if (!is_null($this->initialSchemeTransactionId)) {
78: $object->initialSchemeTransactionId = $this->initialSchemeTransactionId;
79: }
80: if (!is_null($this->network)) {
81: $object->network = $this->network;
82: }
83: if (!is_null($this->originalTransactionLinkId)) {
84: $object->originalTransactionLinkId = $this->originalTransactionLinkId;
85: }
86: if (!is_null($this->paymentData)) {
87: $object->paymentData = $this->paymentData->toObject();
88: }
89: if (!is_null($this->schemeTransactionId)) {
90: $object->schemeTransactionId = $this->schemeTransactionId;
91: }
92: if (!is_null($this->threeDSecureResults)) {
93: $object->threeDSecureResults = $this->threeDSecureResults->toObject();
94: }
95: if (!is_null($this->token)) {
96: $object->token = $this->token;
97: }
98: if (!is_null($this->transactionLinkId)) {
99: $object->transactionLinkId = $this->transactionLinkId;
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): MobilePaymentMethodSpecificOutput
111: {
112: parent::fromObject($object);
113: if (property_exists($object, 'authorisationCode')) {
114: $this->authorisationCode = $object->authorisationCode;
115: }
116: if (property_exists($object, 'fraudResults')) {
117: if (!is_object($object->fraudResults)) {
118: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
119: }
120: $value = new CardFraudResults();
121: $this->fraudResults = $value->fromObject($object->fraudResults);
122: }
123: if (property_exists($object, 'initialSchemeTransactionId')) {
124: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
125: }
126: if (property_exists($object, 'network')) {
127: $this->network = $object->network;
128: }
129: if (property_exists($object, 'originalTransactionLinkId')) {
130: $this->originalTransactionLinkId = $object->originalTransactionLinkId;
131: }
132: if (property_exists($object, 'paymentData')) {
133: if (!is_object($object->paymentData)) {
134: throw new UnexpectedValueException('value \'' . print_r($object->paymentData, true) . '\' is not an object');
135: }
136: $value = new MobilePaymentData();
137: $this->paymentData = $value->fromObject($object->paymentData);
138: }
139: if (property_exists($object, 'schemeTransactionId')) {
140: $this->schemeTransactionId = $object->schemeTransactionId;
141: }
142: if (property_exists($object, 'threeDSecureResults')) {
143: if (!is_object($object->threeDSecureResults)) {
144: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
145: }
146: $value = new ThreeDSecureResults();
147: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
148: }
149: if (property_exists($object, 'token')) {
150: $this->token = $object->token;
151: }
152: if (property_exists($object, 'transactionLinkId')) {
153: $this->transactionLinkId = $object->transactionLinkId;
154: }
155: return $this;
156: }
157: }
158: