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: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class CreatedPaymentOutput extends DataObject
15: {
16: /**
17: * @var DisplayedData|null
18: */
19: public ?DisplayedData $displayedData = null;
20:
21: /**
22: * @var bool|null
23: */
24: public ?bool $isCheckedRememberMe = null;
25:
26: /**
27: * @var Payment|null
28: */
29: public ?Payment $payment = null;
30:
31: /**
32: * @var PaymentCreationReferences|null
33: */
34: public ?PaymentCreationReferences $paymentCreationReferences = null;
35:
36: /**
37: * @var string|null
38: *
39: * @deprecated Use Payment.statusOutput.statusCategory instead
40: */
41: public ?string $paymentStatusCategory = null;
42:
43: /**
44: * @var bool|null
45: */
46: public ?bool $tokenizationSucceeded = null;
47:
48: /**
49: * @var string|null
50: */
51: public ?string $tokens = null;
52:
53: /**
54: * @return object
55: */
56: public function toObject(): object
57: {
58: $object = parent::toObject();
59: if (!is_null($this->displayedData)) {
60: $object->displayedData = $this->displayedData->toObject();
61: }
62: if (!is_null($this->isCheckedRememberMe)) {
63: $object->isCheckedRememberMe = $this->isCheckedRememberMe;
64: }
65: if (!is_null($this->payment)) {
66: $object->payment = $this->payment->toObject();
67: }
68: if (!is_null($this->paymentCreationReferences)) {
69: $object->paymentCreationReferences = $this->paymentCreationReferences->toObject();
70: }
71: if (!is_null($this->paymentStatusCategory)) {
72: $object->paymentStatusCategory = $this->paymentStatusCategory;
73: }
74: if (!is_null($this->tokenizationSucceeded)) {
75: $object->tokenizationSucceeded = $this->tokenizationSucceeded;
76: }
77: if (!is_null($this->tokens)) {
78: $object->tokens = $this->tokens;
79: }
80: return $object;
81: }
82:
83: /**
84: * @param object $object
85: *
86: * @return $this
87: * @throws UnexpectedValueException
88: */
89: public function fromObject(object $object): CreatedPaymentOutput
90: {
91: parent::fromObject($object);
92: if (property_exists($object, 'displayedData')) {
93: if (!is_object($object->displayedData)) {
94: throw new UnexpectedValueException('value \'' . print_r($object->displayedData, true) . '\' is not an object');
95: }
96: $value = new DisplayedData();
97: $this->displayedData = $value->fromObject($object->displayedData);
98: }
99: if (property_exists($object, 'isCheckedRememberMe')) {
100: $this->isCheckedRememberMe = $object->isCheckedRememberMe;
101: }
102: if (property_exists($object, 'payment')) {
103: if (!is_object($object->payment)) {
104: throw new UnexpectedValueException('value \'' . print_r($object->payment, true) . '\' is not an object');
105: }
106: $value = new Payment();
107: $this->payment = $value->fromObject($object->payment);
108: }
109: if (property_exists($object, 'paymentCreationReferences')) {
110: if (!is_object($object->paymentCreationReferences)) {
111: throw new UnexpectedValueException('value \'' . print_r($object->paymentCreationReferences, true) . '\' is not an object');
112: }
113: $value = new PaymentCreationReferences();
114: $this->paymentCreationReferences = $value->fromObject($object->paymentCreationReferences);
115: }
116: if (property_exists($object, 'paymentStatusCategory')) {
117: $this->paymentStatusCategory = $object->paymentStatusCategory;
118: }
119: if (property_exists($object, 'tokenizationSucceeded')) {
120: $this->tokenizationSucceeded = $object->tokenizationSucceeded;
121: }
122: if (property_exists($object, 'tokens')) {
123: $this->tokens = $object->tokens;
124: }
125: return $this;
126: }
127: }
128: