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