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