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: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class FraudFields extends DataObject
15: {
16: /**
17: * @var bool|null
18: *
19: * @deprecated For risk assessments there is no replacement. For other calls, use Order.shipping.addressIndicator instead
20: */
21: public ?bool $addressesAreIdentical = null;
22:
23: /**
24: * @var string|null
25: */
26: public ?string $blackListData = null;
27:
28: /**
29: * @var Address|null
30: *
31: * @deprecated This should be the same as Order.customer.billingAddress
32: */
33: public ?Address $cardOwnerAddress = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $customerIpAddress = null;
39:
40: /**
41: * @var string|null
42: *
43: * @deprecated Use Order.customer.device.defaultFormFill instead
44: */
45: public ?string $defaultFormFill = null;
46:
47: /**
48: * @var bool|null
49: *
50: * @deprecated No replacement
51: */
52: public ?bool $deviceFingerprintActivated = null;
53:
54: /**
55: * @var string|null
56: *
57: * @deprecated Use Order.customer.device.deviceFingerprintTransactionId instead
58: */
59: public ?string $deviceFingerprintTransactionId = null;
60:
61: /**
62: * @var string|null
63: */
64: public ?string $giftCardType = null;
65:
66: /**
67: * @var string|null
68: */
69: public ?string $giftMessage = null;
70:
71: /**
72: * @var bool|null
73: *
74: * @deprecated Use Order.customer.account.hasForgottenPassword instead
75: */
76: public ?bool $hasForgottenPwd = null;
77:
78: /**
79: * @var bool|null
80: *
81: * @deprecated Use Order.customer.account.hasPassword instead
82: */
83: public ?bool $hasPassword = null;
84:
85: /**
86: * @var bool|null
87: *
88: * @deprecated Use Order.customer.isPreviousCustomer instead
89: */
90: public ?bool $isPreviousCustomer = null;
91:
92: /**
93: * @var string|null
94: */
95: public ?string $orderTimezone = null;
96:
97: /**
98: * @var string|null
99: *
100: * @deprecated Use Order.shipping.comments instead
101: */
102: public ?string $shipComments = null;
103:
104: /**
105: * @var string|null
106: *
107: * @deprecated Use Order.shipping.trackingNumber instead
108: */
109: public ?string $shipmentTrackingNumber = null;
110:
111: /**
112: * @var FraudFieldsShippingDetails|null
113: *
114: * @deprecated No replacement
115: */
116: public ?FraudFieldsShippingDetails $shippingDetails = null;
117:
118: /**
119: * @var string[]|null
120: */
121: public ?array $userData = null;
122:
123: /**
124: * @var string|null
125: *
126: * @deprecated Use Merchant.websiteUrl instead
127: */
128: public ?string $website = null;
129:
130: /**
131: * @return object
132: */
133: public function toObject(): object
134: {
135: $object = parent::toObject();
136: if (!is_null($this->addressesAreIdentical)) {
137: $object->addressesAreIdentical = $this->addressesAreIdentical;
138: }
139: if (!is_null($this->blackListData)) {
140: $object->blackListData = $this->blackListData;
141: }
142: if (!is_null($this->cardOwnerAddress)) {
143: $object->cardOwnerAddress = $this->cardOwnerAddress->toObject();
144: }
145: if (!is_null($this->customerIpAddress)) {
146: $object->customerIpAddress = $this->customerIpAddress;
147: }
148: if (!is_null($this->defaultFormFill)) {
149: $object->defaultFormFill = $this->defaultFormFill;
150: }
151: if (!is_null($this->deviceFingerprintActivated)) {
152: $object->deviceFingerprintActivated = $this->deviceFingerprintActivated;
153: }
154: if (!is_null($this->deviceFingerprintTransactionId)) {
155: $object->deviceFingerprintTransactionId = $this->deviceFingerprintTransactionId;
156: }
157: if (!is_null($this->giftCardType)) {
158: $object->giftCardType = $this->giftCardType;
159: }
160: if (!is_null($this->giftMessage)) {
161: $object->giftMessage = $this->giftMessage;
162: }
163: if (!is_null($this->hasForgottenPwd)) {
164: $object->hasForgottenPwd = $this->hasForgottenPwd;
165: }
166: if (!is_null($this->hasPassword)) {
167: $object->hasPassword = $this->hasPassword;
168: }
169: if (!is_null($this->isPreviousCustomer)) {
170: $object->isPreviousCustomer = $this->isPreviousCustomer;
171: }
172: if (!is_null($this->orderTimezone)) {
173: $object->orderTimezone = $this->orderTimezone;
174: }
175: if (!is_null($this->shipComments)) {
176: $object->shipComments = $this->shipComments;
177: }
178: if (!is_null($this->shipmentTrackingNumber)) {
179: $object->shipmentTrackingNumber = $this->shipmentTrackingNumber;
180: }
181: if (!is_null($this->shippingDetails)) {
182: $object->shippingDetails = $this->shippingDetails->toObject();
183: }
184: if (!is_null($this->userData)) {
185: $object->userData = [];
186: foreach ($this->userData as $element) {
187: if (!is_null($element)) {
188: $object->userData[] = $element;
189: }
190: }
191: }
192: if (!is_null($this->website)) {
193: $object->website = $this->website;
194: }
195: return $object;
196: }
197:
198: /**
199: * @param object $object
200: *
201: * @return $this
202: * @throws UnexpectedValueException
203: */
204: public function fromObject(object $object): FraudFields
205: {
206: parent::fromObject($object);
207: if (property_exists($object, 'addressesAreIdentical')) {
208: $this->addressesAreIdentical = $object->addressesAreIdentical;
209: }
210: if (property_exists($object, 'blackListData')) {
211: $this->blackListData = $object->blackListData;
212: }
213: if (property_exists($object, 'cardOwnerAddress')) {
214: if (!is_object($object->cardOwnerAddress)) {
215: throw new UnexpectedValueException('value \'' . print_r($object->cardOwnerAddress, true) . '\' is not an object');
216: }
217: $value = new Address();
218: $this->cardOwnerAddress = $value->fromObject($object->cardOwnerAddress);
219: }
220: if (property_exists($object, 'customerIpAddress')) {
221: $this->customerIpAddress = $object->customerIpAddress;
222: }
223: if (property_exists($object, 'defaultFormFill')) {
224: $this->defaultFormFill = $object->defaultFormFill;
225: }
226: if (property_exists($object, 'deviceFingerprintActivated')) {
227: $this->deviceFingerprintActivated = $object->deviceFingerprintActivated;
228: }
229: if (property_exists($object, 'deviceFingerprintTransactionId')) {
230: $this->deviceFingerprintTransactionId = $object->deviceFingerprintTransactionId;
231: }
232: if (property_exists($object, 'giftCardType')) {
233: $this->giftCardType = $object->giftCardType;
234: }
235: if (property_exists($object, 'giftMessage')) {
236: $this->giftMessage = $object->giftMessage;
237: }
238: if (property_exists($object, 'hasForgottenPwd')) {
239: $this->hasForgottenPwd = $object->hasForgottenPwd;
240: }
241: if (property_exists($object, 'hasPassword')) {
242: $this->hasPassword = $object->hasPassword;
243: }
244: if (property_exists($object, 'isPreviousCustomer')) {
245: $this->isPreviousCustomer = $object->isPreviousCustomer;
246: }
247: if (property_exists($object, 'orderTimezone')) {
248: $this->orderTimezone = $object->orderTimezone;
249: }
250: if (property_exists($object, 'shipComments')) {
251: $this->shipComments = $object->shipComments;
252: }
253: if (property_exists($object, 'shipmentTrackingNumber')) {
254: $this->shipmentTrackingNumber = $object->shipmentTrackingNumber;
255: }
256: if (property_exists($object, 'shippingDetails')) {
257: if (!is_object($object->shippingDetails)) {
258: throw new UnexpectedValueException('value \'' . print_r($object->shippingDetails, true) . '\' is not an object');
259: }
260: $value = new FraudFieldsShippingDetails();
261: $this->shippingDetails = $value->fromObject($object->shippingDetails);
262: }
263: if (property_exists($object, 'userData')) {
264: if (!is_array($object->userData) && !is_object($object->userData)) {
265: throw new UnexpectedValueException('value \'' . print_r($object->userData, true) . '\' is not an array or object');
266: }
267: $this->userData = [];
268: foreach ($object->userData as $element) {
269: $this->userData[] = $element;
270: }
271: }
272: if (property_exists($object, 'website')) {
273: $this->website = $object->website;
274: }
275: return $this;
276: }
277: }
278: