1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | |
10: | |
11: | |
12: | |
13: | class SepaDirectDebitPaymentMethodSpecificInput extends AbstractSepaDirectDebitPaymentMethodSpecificInput |
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 $paymentProduct771SpecificInput = null; |
34: | |
35: | |
36: | |
37: | |
38: | public $recurringPaymentSequenceIndicator = null; |
39: | |
40: | |
41: | |
42: | |
43: | public $requiresApproval = null; |
44: | |
45: | |
46: | |
47: | |
48: | public $token = null; |
49: | |
50: | |
51: | |
52: | |
53: | public $tokenize = null; |
54: | |
55: | |
56: | |
57: | |
58: | public function toObject() |
59: | { |
60: | $object = parent::toObject(); |
61: | if (!is_null($this->dateCollect)) { |
62: | $object->dateCollect = $this->dateCollect; |
63: | } |
64: | if (!is_null($this->directDebitText)) { |
65: | $object->directDebitText = $this->directDebitText; |
66: | } |
67: | if (!is_null($this->isRecurring)) { |
68: | $object->isRecurring = $this->isRecurring; |
69: | } |
70: | if (!is_null($this->paymentProduct771SpecificInput)) { |
71: | $object->paymentProduct771SpecificInput = $this->paymentProduct771SpecificInput->toObject(); |
72: | } |
73: | if (!is_null($this->recurringPaymentSequenceIndicator)) { |
74: | $object->recurringPaymentSequenceIndicator = $this->recurringPaymentSequenceIndicator; |
75: | } |
76: | if (!is_null($this->requiresApproval)) { |
77: | $object->requiresApproval = $this->requiresApproval; |
78: | } |
79: | if (!is_null($this->token)) { |
80: | $object->token = $this->token; |
81: | } |
82: | if (!is_null($this->tokenize)) { |
83: | $object->tokenize = $this->tokenize; |
84: | } |
85: | return $object; |
86: | } |
87: | |
88: | |
89: | |
90: | |
91: | |
92: | |
93: | public function fromObject($object) |
94: | { |
95: | parent::fromObject($object); |
96: | if (property_exists($object, 'dateCollect')) { |
97: | $this->dateCollect = $object->dateCollect; |
98: | } |
99: | if (property_exists($object, 'directDebitText')) { |
100: | $this->directDebitText = $object->directDebitText; |
101: | } |
102: | if (property_exists($object, 'isRecurring')) { |
103: | $this->isRecurring = $object->isRecurring; |
104: | } |
105: | if (property_exists($object, 'paymentProduct771SpecificInput')) { |
106: | if (!is_object($object->paymentProduct771SpecificInput)) { |
107: | throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct771SpecificInput, true) . '\' is not an object'); |
108: | } |
109: | $value = new SepaDirectDebitPaymentProduct771SpecificInput(); |
110: | $this->paymentProduct771SpecificInput = $value->fromObject($object->paymentProduct771SpecificInput); |
111: | } |
112: | if (property_exists($object, 'recurringPaymentSequenceIndicator')) { |
113: | $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator; |
114: | } |
115: | if (property_exists($object, 'requiresApproval')) { |
116: | $this->requiresApproval = $object->requiresApproval; |
117: | } |
118: | if (property_exists($object, 'token')) { |
119: | $this->token = $object->token; |
120: | } |
121: | if (property_exists($object, 'tokenize')) { |
122: | $this->tokenize = $object->tokenize; |
123: | } |
124: | return $this; |
125: | } |
126: | } |
127: | |