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