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 $paymentAccountReference = null;
54:
55: /**
56: * @var string|null
57: */
58: public ?string $schemeTransactionId = null;
59:
60: /**
61: * @var ThreeDSecureResults|null
62: */
63: public ?ThreeDSecureResults $threeDSecureResults = null;
64:
65: /**
66: * @var string|null
67: */
68: public ?string $token = null;
69:
70: /**
71: * @return object
72: */
73: public function toObject(): object
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: *
115: * @return $this
116: * @throws UnexpectedValueException
117: */
118: public function fromObject(object $object): CardPaymentMethodSpecificOutput
119: {
120: parent::fromObject($object);
121: if (property_exists($object, 'authorisationCode')) {
122: $this->authorisationCode = $object->authorisationCode;
123: }
124: if (property_exists($object, 'card')) {
125: if (!is_object($object->card)) {
126: throw new UnexpectedValueException('value \'' . print_r($object->card, true) . '\' is not an object');
127: }
128: $value = new CardEssentials();
129: $this->card = $value->fromObject($object->card);
130: }
131: if (property_exists($object, 'clickToPayUsed')) {
132: $this->clickToPayUsed = $object->clickToPayUsed;
133: }
134: if (property_exists($object, 'fraudResults')) {
135: if (!is_object($object->fraudResults)) {
136: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
137: }
138: $value = new CardFraudResults();
139: $this->fraudResults = $value->fromObject($object->fraudResults);
140: }
141: if (property_exists($object, 'initialSchemeTransactionId')) {
142: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
143: }
144: if (property_exists($object, 'networkTokenData')) {
145: if (!is_object($object->networkTokenData)) {
146: throw new UnexpectedValueException('value \'' . print_r($object->networkTokenData, true) . '\' is not an object');
147: }
148: $value = new NetworkTokenData();
149: $this->networkTokenData = $value->fromObject($object->networkTokenData);
150: }
151: if (property_exists($object, 'networkTokenUsed')) {
152: $this->networkTokenUsed = $object->networkTokenUsed;
153: }
154: if (property_exists($object, 'paymentAccountReference')) {
155: $this->paymentAccountReference = $object->paymentAccountReference;
156: }
157: if (property_exists($object, 'schemeTransactionId')) {
158: $this->schemeTransactionId = $object->schemeTransactionId;
159: }
160: if (property_exists($object, 'threeDSecureResults')) {
161: if (!is_object($object->threeDSecureResults)) {
162: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object');
163: }
164: $value = new ThreeDSecureResults();
165: $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults);
166: }
167: if (property_exists($object, 'token')) {
168: $this->token = $object->token;
169: }
170: return $this;
171: }
172: }
173: