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 $network = null;
29:
30: /**
31: * @var MobilePaymentData
32: */
33: public $paymentData = null;
34:
35: /**
36: * @var ThreeDSecureResults
37: */
38: public $threeDSecureResults = null;
39:
40: /**
41: * @return object
42: */
43: public function toObject()
44: {
45: $object = parent::toObject();
46: if (!is_null($this->authorisationCode)) {
47: $object->authorisationCode = $this->authorisationCode;
48: }
49: if (!is_null($this->fraudResults)) {
50: $object->fraudResults = $this->fraudResults->toObject();
51: }
52: if (!is_null($this->network)) {
53: $object->network = $this->network;
54: }
55: if (!is_null($this->paymentData)) {
56: $object->paymentData = $this->paymentData->toObject();
57: }
58: if (!is_null($this->threeDSecureResults)) {
59: $object->threeDSecureResults = $this->threeDSecureResults->toObject();
60: }
61: return $object;
62: }
63:
64: /**
65: * @param object $object
66: * @return $this
67: * @throws UnexpectedValueException
68: */
69: public function fromObject($object)
70: {
71: parent::fromObject($object);
72: if (property_exists($object, 'authorisationCode')) {
73: $this->authorisationCode = $object->authorisationCode;
74: }
75: if (property_exists($object, 'fraudResults')) {
76: if (!is_object($object->fraudResults)) {
77: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
78: }
79: $value = new CardFraudResults();
80: $this->fraudResults = $value->fromObject($object->fraudResults);
81: }
82: if (property_exists($object, 'network')) {
83: $this->network = $object->network;
84: }
85: if (property_exists($object, 'paymentData')) {
86: if (!is_object($object->paymentData)) {
87: throw new UnexpectedValueException('value \'' . print_r($object->paymentData, true) . '\' is not an object');
88: }
89: $value = new MobilePaymentData();
90: $this->paymentData = $value->fromObject($object->paymentData);
91: }
92: if (property_exists($object, 'threeDSecureResults')) {
93: if (!is_object($object->threeDSecureResults)) {
94: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
95: }
96: $value = new ThreeDSecureResults();
97: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
98: }
99: return $this;
100: }
101: }
102: