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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class NonSepaDirectDebitPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $dateCollect = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $directDebitText = null;
24:
25: /**
26: * @var bool|null
27: */
28: public ?bool $isRecurring = null;
29:
30: /**
31: * @var NonSepaDirectDebitPaymentProduct705SpecificInput|null
32: */
33: public ?NonSepaDirectDebitPaymentProduct705SpecificInput $paymentProduct705SpecificInput = null;
34:
35: /**
36: * @var NonSepaDirectDebitPaymentProduct730SpecificInput|null
37: */
38: public ?NonSepaDirectDebitPaymentProduct730SpecificInput $paymentProduct730SpecificInput = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $recurringPaymentSequenceIndicator = null;
44:
45: /**
46: * @var bool|null
47: */
48: public ?bool $requiresApproval = null;
49:
50: /**
51: * @var string|null
52: */
53: public ?string $token = null;
54:
55: /**
56: * @var bool|null
57: */
58: public ?bool $tokenize = null;
59:
60: /**
61: * @return object
62: */
63: public function toObject(): object
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: * @param object $object
98: *
99: * @return $this
100: * @throws UnexpectedValueException
101: */
102: public function fromObject(object $object): NonSepaDirectDebitPaymentMethodSpecificInput
103: {
104: parent::fromObject($object);
105: if (property_exists($object, 'dateCollect')) {
106: $this->dateCollect = $object->dateCollect;
107: }
108: if (property_exists($object, 'directDebitText')) {
109: $this->directDebitText = $object->directDebitText;
110: }
111: if (property_exists($object, 'isRecurring')) {
112: $this->isRecurring = $object->isRecurring;
113: }
114: if (property_exists($object, 'paymentProduct705SpecificInput')) {
115: if (!is_object($object->paymentProduct705SpecificInput)) {
116: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct705SpecificInput, true) . '\' is not an object');
117: }
118: $value = new NonSepaDirectDebitPaymentProduct705SpecificInput();
119: $this->paymentProduct705SpecificInput = $value->fromObject($object->paymentProduct705SpecificInput);
120: }
121: if (property_exists($object, 'paymentProduct730SpecificInput')) {
122: if (!is_object($object->paymentProduct730SpecificInput)) {
123: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct730SpecificInput, true) . '\' is not an object');
124: }
125: $value = new NonSepaDirectDebitPaymentProduct730SpecificInput();
126: $this->paymentProduct730SpecificInput = $value->fromObject($object->paymentProduct730SpecificInput);
127: }
128: if (property_exists($object, 'recurringPaymentSequenceIndicator')) {
129: $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator;
130: }
131: if (property_exists($object, 'requiresApproval')) {
132: $this->requiresApproval = $object->requiresApproval;
133: }
134: if (property_exists($object, 'token')) {
135: $this->token = $object->token;
136: }
137: if (property_exists($object, 'tokenize')) {
138: $this->tokenize = $object->tokenize;
139: }
140: return $this;
141: }
142: }
143: