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 CardPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput
14: {
15: /**
16: * @var string
17: */
18: public $authorisationCode = null;
19:
20: /**
21: * @var CardEssentials
22: */
23: public $card = null;
24:
25: /**
26: * @var bool
27: */
28: public $clickToPayUsed = null;
29:
30: /**
31: * @var CardFraudResults
32: */
33: public $fraudResults = null;
34:
35: /**
36: * @var string
37: */
38: public $initialSchemeTransactionId = null;
39:
40: /**
41: * @var NetworkTokenData
42: */
43: public $networkTokenData = null;
44:
45: /**
46: * @var bool
47: */
48: public $networkTokenUsed = null;
49:
50: /**
51: * @var string
52: */
53: public $paymentAccountReference = null;
54:
55: /**
56: * @var string
57: */
58: public $schemeTransactionId = null;
59:
60: /**
61: * @var ThreeDSecureResults
62: */
63: public $threeDSecureResults = null;
64:
65: /**
66: * @var string
67: */
68: public $token = null;
69:
70: /**
71: * @return object
72: */
73: public function toObject()
74: {
75: $object = parent::toObject();
76: if (!is_null($this->authorisationCode)) {
77: $object->authorisationCode = $this->authorisationCode;
78: }
79: if (!is_null($this->card)) {
80: $object->card = $this->card->toObject();
81: }
82: if (!is_null($this->clickToPayUsed)) {
83: $object->clickToPayUsed = $this->clickToPayUsed;
84: }
85: if (!is_null($this->fraudResults)) {
86: $object->fraudResults = $this->fraudResults->toObject();
87: }
88: if (!is_null($this->initialSchemeTransactionId)) {
89: $object->initialSchemeTransactionId = $this->initialSchemeTransactionId;
90: }
91: if (!is_null($this->networkTokenData)) {
92: $object->networkTokenData = $this->networkTokenData->toObject();
93: }
94: if (!is_null($this->networkTokenUsed)) {
95: $object->networkTokenUsed = $this->networkTokenUsed;
96: }
97: if (!is_null($this->paymentAccountReference)) {
98: $object->paymentAccountReference = $this->paymentAccountReference;
99: }
100: if (!is_null($this->schemeTransactionId)) {
101: $object->schemeTransactionId = $this->schemeTransactionId;
102: }
103: if (!is_null($this->threeDSecureResults)) {
104: $object->threeDSecureResults = $this->threeDSecureResults->toObject();
105: }
106: if (!is_null($this->token)) {
107: $object->token = $this->token;
108: }
109: return $object;
110: }
111:
112: /**
113: * @param object $object
114: * @return $this
115: * @throws UnexpectedValueException
116: */
117: public function fromObject($object)
118: {
119: parent::fromObject($object);
120: if (property_exists($object, 'authorisationCode')) {
121: $this->authorisationCode = $object->authorisationCode;
122: }
123: if (property_exists($object, 'card')) {
124: if (!is_object($object->card)) {
125: throw new UnexpectedValueException('value \'' . print_r($object->card, true) . '\' is not an object');
126: }
127: $value = new CardEssentials();
128: $this->card = $value->fromObject($object->card);
129: }
130: if (property_exists($object, 'clickToPayUsed')) {
131: $this->clickToPayUsed = $object->clickToPayUsed;
132: }
133: if (property_exists($object, 'fraudResults')) {
134: if (!is_object($object->fraudResults)) {
135: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
136: }
137: $value = new CardFraudResults();
138: $this->fraudResults = $value->fromObject($object->fraudResults);
139: }
140: if (property_exists($object, 'initialSchemeTransactionId')) {
141: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
142: }
143: if (property_exists($object, 'networkTokenData')) {
144: if (!is_object($object->networkTokenData)) {
145: throw new UnexpectedValueException('value \'' . print_r($object->networkTokenData, true) . '\' is not an object');
146: }
147: $value = new NetworkTokenData();
148: $this->networkTokenData = $value->fromObject($object->networkTokenData);
149: }
150: if (property_exists($object, 'networkTokenUsed')) {
151: $this->networkTokenUsed = $object->networkTokenUsed;
152: }
153: if (property_exists($object, 'paymentAccountReference')) {
154: $this->paymentAccountReference = $object->paymentAccountReference;
155: }
156: if (property_exists($object, 'schemeTransactionId')) {
157: $this->schemeTransactionId = $object->schemeTransactionId;
158: }
159: if (property_exists($object, 'threeDSecureResults')) {
160: if (!is_object($object->threeDSecureResults)) {
161: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
162: }
163: $value = new ThreeDSecureResults();
164: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
165: }
166: if (property_exists($object, 'token')) {
167: $this->token = $object->token;
168: }
169: return $this;
170: }
171: }
172: