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 HostedCheckoutSpecificInput extends DataObject
15: {
16: /**
17: * @var bool|null
18: */
19: public ?bool $allowClickToPay = null;
20:
21: /**
22: * @var bool|null
23: */
24: public ?bool $isRecurring = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $locale = null;
30:
31: /**
32: * @var PaymentProductFiltersHostedCheckout|null
33: */
34: public ?PaymentProductFiltersHostedCheckout $paymentProductFilters = null;
35:
36: /**
37: * @var RecurringPaymentsData|null
38: */
39: public ?RecurringPaymentsData $recurringPaymentsData = null;
40:
41: /**
42: * @var bool|null
43: */
44: public ?bool $returnCancelState = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $returnUrl = null;
50:
51: /**
52: * @var bool|null
53: */
54: public ?bool $showResultPage = null;
55:
56: /**
57: * @var string|null
58: */
59: public ?string $tokens = null;
60:
61: /**
62: * @var bool|null
63: */
64: public ?bool $validateShoppingCart = null;
65:
66: /**
67: * @var string|null
68: */
69: public ?string $variant = null;
70:
71: /**
72: * @return object
73: */
74: public function toObject(): object
75: {
76: $object = parent::toObject();
77: if (!is_null($this->allowClickToPay)) {
78: $object->allowClickToPay = $this->allowClickToPay;
79: }
80: if (!is_null($this->isRecurring)) {
81: $object->isRecurring = $this->isRecurring;
82: }
83: if (!is_null($this->locale)) {
84: $object->locale = $this->locale;
85: }
86: if (!is_null($this->paymentProductFilters)) {
87: $object->paymentProductFilters = $this->paymentProductFilters->toObject();
88: }
89: if (!is_null($this->recurringPaymentsData)) {
90: $object->recurringPaymentsData = $this->recurringPaymentsData->toObject();
91: }
92: if (!is_null($this->returnCancelState)) {
93: $object->returnCancelState = $this->returnCancelState;
94: }
95: if (!is_null($this->returnUrl)) {
96: $object->returnUrl = $this->returnUrl;
97: }
98: if (!is_null($this->showResultPage)) {
99: $object->showResultPage = $this->showResultPage;
100: }
101: if (!is_null($this->tokens)) {
102: $object->tokens = $this->tokens;
103: }
104: if (!is_null($this->validateShoppingCart)) {
105: $object->validateShoppingCart = $this->validateShoppingCart;
106: }
107: if (!is_null($this->variant)) {
108: $object->variant = $this->variant;
109: }
110: return $object;
111: }
112:
113: /**
114: * @param object $object
115: *
116: * @return $this
117: * @throws UnexpectedValueException
118: */
119: public function fromObject(object $object): HostedCheckoutSpecificInput
120: {
121: parent::fromObject($object);
122: if (property_exists($object, 'allowClickToPay')) {
123: $this->allowClickToPay = $object->allowClickToPay;
124: }
125: if (property_exists($object, 'isRecurring')) {
126: $this->isRecurring = $object->isRecurring;
127: }
128: if (property_exists($object, 'locale')) {
129: $this->locale = $object->locale;
130: }
131: if (property_exists($object, 'paymentProductFilters')) {
132: if (!is_object($object->paymentProductFilters)) {
133: throw new UnexpectedValueException('value \'' . print_r($object->paymentProductFilters, true) . '\' is not an object');
134: }
135: $value = new PaymentProductFiltersHostedCheckout();
136: $this->paymentProductFilters = $value->fromObject($object->paymentProductFilters);
137: }
138: if (property_exists($object, 'recurringPaymentsData')) {
139: if (!is_object($object->recurringPaymentsData)) {
140: throw new UnexpectedValueException('value \'' . print_r($object->recurringPaymentsData, true) . '\' is not an object');
141: }
142: $value = new RecurringPaymentsData();
143: $this->recurringPaymentsData = $value->fromObject($object->recurringPaymentsData);
144: }
145: if (property_exists($object, 'returnCancelState')) {
146: $this->returnCancelState = $object->returnCancelState;
147: }
148: if (property_exists($object, 'returnUrl')) {
149: $this->returnUrl = $object->returnUrl;
150: }
151: if (property_exists($object, 'showResultPage')) {
152: $this->showResultPage = $object->showResultPage;
153: }
154: if (property_exists($object, 'tokens')) {
155: $this->tokens = $object->tokens;
156: }
157: if (property_exists($object, 'validateShoppingCart')) {
158: $this->validateShoppingCart = $object->validateShoppingCart;
159: }
160: if (property_exists($object, 'variant')) {
161: $this->variant = $object->variant;
162: }
163: return $this;
164: }
165: }
166: