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