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 AbstractCardPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $acquirerPromotionCode = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $authorizationMode = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $customerReference = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $initialSchemeTransactionId = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $originalTransactionLinkId = null;
39:
40: /**
41: * @var CardRecurrenceDetails|null
42: */
43: public ?CardRecurrenceDetails $recurring = null;
44:
45: /**
46: * @var string|null
47: *
48: * @deprecated Use recurring.recurringPaymentSequenceIndicator instead
49: */
50: public ?string $recurringPaymentSequenceIndicator = null;
51:
52: /**
53: * @var bool|null
54: */
55: public ?bool $requiresApproval = null;
56:
57: /**
58: * @var bool|null
59: *
60: * @deprecated Use threeDSecure.skipAuthentication instead
61: */
62: public ?bool $skipAuthentication = null;
63:
64: /**
65: * @var bool|null
66: */
67: public ?bool $skipFraudService = null;
68:
69: /**
70: * @var string|null
71: */
72: public ?string $token = null;
73:
74: /**
75: * @var bool|null
76: */
77: public ?bool $tokenize = null;
78:
79: /**
80: * @var string|null
81: */
82: public ?string $transactionChannel = null;
83:
84: /**
85: * @var string|null
86: *
87: * @deprecated Use unscheduledCardOnFileSequenceIndicator instead
88: */
89: public ?string $unscheduledCardOnFileIndicator = null;
90:
91: /**
92: * @var string|null
93: */
94: public ?string $unscheduledCardOnFileRequestor = null;
95:
96: /**
97: * @var string|null
98: */
99: public ?string $unscheduledCardOnFileSequenceIndicator = null;
100:
101: /**
102: * @return object
103: */
104: public function toObject(): object
105: {
106: $object = parent::toObject();
107: if (!is_null($this->acquirerPromotionCode)) {
108: $object->acquirerPromotionCode = $this->acquirerPromotionCode;
109: }
110: if (!is_null($this->authorizationMode)) {
111: $object->authorizationMode = $this->authorizationMode;
112: }
113: if (!is_null($this->customerReference)) {
114: $object->customerReference = $this->customerReference;
115: }
116: if (!is_null($this->initialSchemeTransactionId)) {
117: $object->initialSchemeTransactionId = $this->initialSchemeTransactionId;
118: }
119: if (!is_null($this->originalTransactionLinkId)) {
120: $object->originalTransactionLinkId = $this->originalTransactionLinkId;
121: }
122: if (!is_null($this->recurring)) {
123: $object->recurring = $this->recurring->toObject();
124: }
125: if (!is_null($this->recurringPaymentSequenceIndicator)) {
126: $object->recurringPaymentSequenceIndicator = $this->recurringPaymentSequenceIndicator;
127: }
128: if (!is_null($this->requiresApproval)) {
129: $object->requiresApproval = $this->requiresApproval;
130: }
131: if (!is_null($this->skipAuthentication)) {
132: $object->skipAuthentication = $this->skipAuthentication;
133: }
134: if (!is_null($this->skipFraudService)) {
135: $object->skipFraudService = $this->skipFraudService;
136: }
137: if (!is_null($this->token)) {
138: $object->token = $this->token;
139: }
140: if (!is_null($this->tokenize)) {
141: $object->tokenize = $this->tokenize;
142: }
143: if (!is_null($this->transactionChannel)) {
144: $object->transactionChannel = $this->transactionChannel;
145: }
146: if (!is_null($this->unscheduledCardOnFileIndicator)) {
147: $object->unscheduledCardOnFileIndicator = $this->unscheduledCardOnFileIndicator;
148: }
149: if (!is_null($this->unscheduledCardOnFileRequestor)) {
150: $object->unscheduledCardOnFileRequestor = $this->unscheduledCardOnFileRequestor;
151: }
152: if (!is_null($this->unscheduledCardOnFileSequenceIndicator)) {
153: $object->unscheduledCardOnFileSequenceIndicator = $this->unscheduledCardOnFileSequenceIndicator;
154: }
155: return $object;
156: }
157:
158: /**
159: * @param object $object
160: *
161: * @return $this
162: * @throws UnexpectedValueException
163: */
164: public function fromObject(object $object): AbstractCardPaymentMethodSpecificInput
165: {
166: parent::fromObject($object);
167: if (property_exists($object, 'acquirerPromotionCode')) {
168: $this->acquirerPromotionCode = $object->acquirerPromotionCode;
169: }
170: if (property_exists($object, 'authorizationMode')) {
171: $this->authorizationMode = $object->authorizationMode;
172: }
173: if (property_exists($object, 'customerReference')) {
174: $this->customerReference = $object->customerReference;
175: }
176: if (property_exists($object, 'initialSchemeTransactionId')) {
177: $this->initialSchemeTransactionId = $object->initialSchemeTransactionId;
178: }
179: if (property_exists($object, 'originalTransactionLinkId')) {
180: $this->originalTransactionLinkId = $object->originalTransactionLinkId;
181: }
182: if (property_exists($object, 'recurring')) {
183: if (!is_object($object->recurring)) {
184: throw new UnexpectedValueException('value \'' . print_r($object->recurring, true) . '\' is not an object');
185: }
186: $value = new CardRecurrenceDetails();
187: $this->recurring = $value->fromObject($object->recurring);
188: }
189: if (property_exists($object, 'recurringPaymentSequenceIndicator')) {
190: $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator;
191: }
192: if (property_exists($object, 'requiresApproval')) {
193: $this->requiresApproval = $object->requiresApproval;
194: }
195: if (property_exists($object, 'skipAuthentication')) {
196: $this->skipAuthentication = $object->skipAuthentication;
197: }
198: if (property_exists($object, 'skipFraudService')) {
199: $this->skipFraudService = $object->skipFraudService;
200: }
201: if (property_exists($object, 'token')) {
202: $this->token = $object->token;
203: }
204: if (property_exists($object, 'tokenize')) {
205: $this->tokenize = $object->tokenize;
206: }
207: if (property_exists($object, 'transactionChannel')) {
208: $this->transactionChannel = $object->transactionChannel;
209: }
210: if (property_exists($object, 'unscheduledCardOnFileIndicator')) {
211: $this->unscheduledCardOnFileIndicator = $object->unscheduledCardOnFileIndicator;
212: }
213: if (property_exists($object, 'unscheduledCardOnFileRequestor')) {
214: $this->unscheduledCardOnFileRequestor = $object->unscheduledCardOnFileRequestor;
215: }
216: if (property_exists($object, 'unscheduledCardOnFileSequenceIndicator')) {
217: $this->unscheduledCardOnFileSequenceIndicator = $object->unscheduledCardOnFileSequenceIndicator;
218: }
219: return $this;
220: }
221: }
222: