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 MobilePaymentData|null
37: */
38: public ?MobilePaymentData $paymentData = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $schemeTransactionId = null;
44:
45: /**
46: * @var ThreeDSecureResults|null
47: */
48: public ?ThreeDSecureResults $threeDSecureResults = null;
49:
50: /**
51: * @var string|null
52: */
53: public ?string $token = null;
54:
55: /**
56: * @return object
57: */
58: public function toObject(): object
59: {
60: $object = parent::toObject();
61: if (!is_null($this->authorisationCode)) {
62: $object->authorisationCode = $this->authorisationCode;
63: }
64: if (!is_null($this->fraudResults)) {
65: $object->fraudResults = $this->fraudResults->toObject();
66: }
67: if (!is_null($this->initialSchemeTransactionId)) {
68: $object->initialSchemeTransactionId = $this->initialSchemeTransactionId;
69: }
70: if (!is_null($this->network)) {
71: $object->network = $this->network;
72: }
73: if (!is_null($this->paymentData)) {
74: $object->paymentData = $this->paymentData->toObject();
75: }
76: if (!is_null($this->schemeTransactionId)) {
77: $object->schemeTransactionId = $this->schemeTransactionId;
78: }
79: if (!is_null($this->threeDSecureResults)) {
80: $object->threeDSecureResults = $this->threeDSecureResults->toObject();
81: }
82: if (!is_null($this->token)) {
83: $object->token = $this->token;
84: }
85: return $object;
86: }
87:
88: /**
89: * @param object $object
90: *
91: * @return $this
92: * @throws UnexpectedValueException
93: */
94: public function fromObject(object $object): MobilePaymentMethodSpecificOutput
95: {
96: parent::fromObject($object);
97: if (property_exists($object, 'authorisationCode')) {
98: $this->authorisationCode = $object->authorisationCode;
99: }
100: if (property_exists($object, 'fraudResults')) {
101: if (!is_object($object->fraudResults)) {
102: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
103: }
104: $value = new CardFraudResults();
105: $this->fraudResults = $value->fromObject($object->fraudResults);
106: }
107: if (property_exists($object, 'initialSchemeTransactionId')) {
108: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
109: }
110: if (property_exists($object, 'network')) {
111: $this->network = $object->network;
112: }
113: if (property_exists($object, 'paymentData')) {
114: if (!is_object($object->paymentData)) {
115: throw new UnexpectedValueException('value \'' . print_r($object->paymentData, true) . '\' is not an object');
116: }
117: $value = new MobilePaymentData();
118: $this->paymentData = $value->fromObject($object->paymentData);
119: }
120: if (property_exists($object, 'schemeTransactionId')) {
121: $this->schemeTransactionId = $object->schemeTransactionId;
122: }
123: if (property_exists($object, 'threeDSecureResults')) {
124: if (!is_object($object->threeDSecureResults)) {
125: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
126: }
127: $value = new ThreeDSecureResults();
128: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
129: }
130: if (property_exists($object, 'token')) {
131: $this->token = $object->token;
132: }
133: return $this;
134: }
135: }
136: