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 CaptureStatusOutput extends DataObject
15: {
16: /**
17: * @var bool
18: */
19: public $isFinal = null;
20:
21: /**
22: * @var bool
23: */
24: public $isRefundable = null;
25:
26: /**
27: * @var bool
28: */
29: public $isRetriable = null;
30:
31: /**
32: * @var KeyValuePair[]
33: */
34: public $providerRawOutput = null;
35:
36: /**
37: * @var int
38: */
39: public $statusCode = null;
40:
41: /**
42: * @var string
43: */
44: public $statusCodeChangeDateTime = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject()
50: {
51: $object = parent::toObject();
52: if (!is_null($this->isFinal)) {
53: $object->isFinal = $this->isFinal;
54: }
55: if (!is_null($this->isRefundable)) {
56: $object->isRefundable = $this->isRefundable;
57: }
58: if (!is_null($this->isRetriable)) {
59: $object->isRetriable = $this->isRetriable;
60: }
61: if (!is_null($this->providerRawOutput)) {
62: $object->providerRawOutput = [];
63: foreach ($this->providerRawOutput as $element) {
64: if (!is_null($element)) {
65: $object->providerRawOutput[] = $element->toObject();
66: }
67: }
68: }
69: if (!is_null($this->statusCode)) {
70: $object->statusCode = $this->statusCode;
71: }
72: if (!is_null($this->statusCodeChangeDateTime)) {
73: $object->statusCodeChangeDateTime = $this->statusCodeChangeDateTime;
74: }
75: return $object;
76: }
77:
78: /**
79: * @param object $object
80: * @return $this
81: * @throws UnexpectedValueException
82: */
83: public function fromObject($object)
84: {
85: parent::fromObject($object);
86: if (property_exists($object, 'isFinal')) {
87: $this->isFinal = $object->isFinal;
88: }
89: if (property_exists($object, 'isRefundable')) {
90: $this->isRefundable = $object->isRefundable;
91: }
92: if (property_exists($object, 'isRetriable')) {
93: $this->isRetriable = $object->isRetriable;
94: }
95: if (property_exists($object, 'providerRawOutput')) {
96: if (!is_array($object->providerRawOutput) && !is_object($object->providerRawOutput)) {
97: throw new UnexpectedValueException('value \'' . print_r($object->providerRawOutput, true) . '\' is not an array or object');
98: }
99: $this->providerRawOutput = [];
100: foreach ($object->providerRawOutput as $element) {
101: $value = new KeyValuePair();
102: $this->providerRawOutput[] = $value->fromObject($element);
103: }
104: }
105: if (property_exists($object, 'statusCode')) {
106: $this->statusCode = $object->statusCode;
107: }
108: if (property_exists($object, 'statusCodeChangeDateTime')) {
109: $this->statusCodeChangeDateTime = $object->statusCodeChangeDateTime;
110: }
111: return $this;
112: }
113: }
114: