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