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
17: */
18: public $authorisationCode = null;
19:
20: /**
21: * @var CardFraudResults
22: */
23: public $fraudResults = null;
24:
25: /**
26: * @var string
27: */
28: public $initialSchemeTransactionId = null;
29:
30: /**
31: * @var string
32: */
33: public $network = null;
34:
35: /**
36: * @var MobilePaymentData
37: */
38: public $paymentData = null;
39:
40: /**
41: * @var string
42: */
43: public $schemeTransactionId = null;
44:
45: /**
46: * @var ThreeDSecureResults
47: */
48: public $threeDSecureResults = null;
49:
50: /**
51: * @var string
52: */
53: public $token = null;
54:
55: /**
56: * @return object
57: */
58: public function toObject()
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: * @return $this
91: * @throws UnexpectedValueException
92: */
93: public function fromObject($object)
94: {
95: parent::fromObject($object);
96: if (property_exists($object, 'authorisationCode')) {
97: $this->authorisationCode = $object->authorisationCode;
98: }
99: if (property_exists($object, 'fraudResults')) {
100: if (!is_object($object->fraudResults)) {
101: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
102: }
103: $value = new CardFraudResults();
104: $this->fraudResults = $value->fromObject($object->fraudResults);
105: }
106: if (property_exists($object, 'initialSchemeTransactionId')) {
107: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
108: }
109: if (property_exists($object, 'network')) {
110: $this->network = $object->network;
111: }
112: if (property_exists($object, 'paymentData')) {
113: if (!is_object($object->paymentData)) {
114: throw new UnexpectedValueException('value \'' . print_r($object->paymentData, true) . '\' is not an object');
115: }
116: $value = new MobilePaymentData();
117: $this->paymentData = $value->fromObject($object->paymentData);
118: }
119: if (property_exists($object, 'schemeTransactionId')) {
120: $this->schemeTransactionId = $object->schemeTransactionId;
121: }
122: if (property_exists($object, 'threeDSecureResults')) {
123: if (!is_object($object->threeDSecureResults)) {
124: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
125: }
126: $value = new ThreeDSecureResults();
127: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
128: }
129: if (property_exists($object, 'token')) {
130: $this->token = $object->token;
131: }
132: return $this;
133: }
134: }
135: