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