| 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 ThreeDSecureResults extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $acsTransactionId = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $appliedExemption = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $authenticationAmount = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $cavv = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $directoryServerTransactionId = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $eci = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $exemptionOutput = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $schemeRiskScore = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public $sdkData = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public $threeDSecureData = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | public $threeDSecureVersion = null; |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | public $threeDServerTransactionId = null; |
| 75: | |
| 76: | |
| 77: | |
| 78: | |
| 79: | public $xid = null; |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | public function toObject() |
| 85: | { |
| 86: | $object = parent::toObject(); |
| 87: | if (!is_null($this->acsTransactionId)) { |
| 88: | $object->acsTransactionId = $this->acsTransactionId; |
| 89: | } |
| 90: | if (!is_null($this->appliedExemption)) { |
| 91: | $object->appliedExemption = $this->appliedExemption; |
| 92: | } |
| 93: | if (!is_null($this->authenticationAmount)) { |
| 94: | $object->authenticationAmount = $this->authenticationAmount->toObject(); |
| 95: | } |
| 96: | if (!is_null($this->cavv)) { |
| 97: | $object->cavv = $this->cavv; |
| 98: | } |
| 99: | if (!is_null($this->directoryServerTransactionId)) { |
| 100: | $object->directoryServerTransactionId = $this->directoryServerTransactionId; |
| 101: | } |
| 102: | if (!is_null($this->eci)) { |
| 103: | $object->eci = $this->eci; |
| 104: | } |
| 105: | if (!is_null($this->exemptionOutput)) { |
| 106: | $object->exemptionOutput = $this->exemptionOutput->toObject(); |
| 107: | } |
| 108: | if (!is_null($this->schemeRiskScore)) { |
| 109: | $object->schemeRiskScore = $this->schemeRiskScore; |
| 110: | } |
| 111: | if (!is_null($this->sdkData)) { |
| 112: | $object->sdkData = $this->sdkData->toObject(); |
| 113: | } |
| 114: | if (!is_null($this->threeDSecureData)) { |
| 115: | $object->threeDSecureData = $this->threeDSecureData->toObject(); |
| 116: | } |
| 117: | if (!is_null($this->threeDSecureVersion)) { |
| 118: | $object->threeDSecureVersion = $this->threeDSecureVersion; |
| 119: | } |
| 120: | if (!is_null($this->threeDServerTransactionId)) { |
| 121: | $object->threeDServerTransactionId = $this->threeDServerTransactionId; |
| 122: | } |
| 123: | if (!is_null($this->xid)) { |
| 124: | $object->xid = $this->xid; |
| 125: | } |
| 126: | return $object; |
| 127: | } |
| 128: | |
| 129: | |
| 130: | |
| 131: | |
| 132: | |
| 133: | |
| 134: | public function fromObject($object) |
| 135: | { |
| 136: | parent::fromObject($object); |
| 137: | if (property_exists($object, 'acsTransactionId')) { |
| 138: | $this->acsTransactionId = $object->acsTransactionId; |
| 139: | } |
| 140: | if (property_exists($object, 'appliedExemption')) { |
| 141: | $this->appliedExemption = $object->appliedExemption; |
| 142: | } |
| 143: | if (property_exists($object, 'authenticationAmount')) { |
| 144: | if (!is_object($object->authenticationAmount)) { |
| 145: | throw new UnexpectedValueException('value \'' . print_r($object->authenticationAmount, true) . '\' is not an object'); |
| 146: | } |
| 147: | $value = new AmountOfMoney(); |
| 148: | $this->authenticationAmount = $value->fromObject($object->authenticationAmount); |
| 149: | } |
| 150: | if (property_exists($object, 'cavv')) { |
| 151: | $this->cavv = $object->cavv; |
| 152: | } |
| 153: | if (property_exists($object, 'directoryServerTransactionId')) { |
| 154: | $this->directoryServerTransactionId = $object->directoryServerTransactionId; |
| 155: | } |
| 156: | if (property_exists($object, 'eci')) { |
| 157: | $this->eci = $object->eci; |
| 158: | } |
| 159: | if (property_exists($object, 'exemptionOutput')) { |
| 160: | if (!is_object($object->exemptionOutput)) { |
| 161: | throw new UnexpectedValueException('value \'' . print_r($object->exemptionOutput, true) . '\' is not an object'); |
| 162: | } |
| 163: | $value = new ExemptionOutput(); |
| 164: | $this->exemptionOutput = $value->fromObject($object->exemptionOutput); |
| 165: | } |
| 166: | if (property_exists($object, 'schemeRiskScore')) { |
| 167: | $this->schemeRiskScore = $object->schemeRiskScore; |
| 168: | } |
| 169: | if (property_exists($object, 'sdkData')) { |
| 170: | if (!is_object($object->sdkData)) { |
| 171: | throw new UnexpectedValueException('value \'' . print_r($object->sdkData, true) . '\' is not an object'); |
| 172: | } |
| 173: | $value = new SdkDataOutput(); |
| 174: | $this->sdkData = $value->fromObject($object->sdkData); |
| 175: | } |
| 176: | if (property_exists($object, 'threeDSecureData')) { |
| 177: | if (!is_object($object->threeDSecureData)) { |
| 178: | throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureData, true) . '\' is not an object'); |
| 179: | } |
| 180: | $value = new ThreeDSecureData(); |
| 181: | $this->threeDSecureData = $value->fromObject($object->threeDSecureData); |
| 182: | } |
| 183: | if (property_exists($object, 'threeDSecureVersion')) { |
| 184: | $this->threeDSecureVersion = $object->threeDSecureVersion; |
| 185: | } |
| 186: | if (property_exists($object, 'threeDServerTransactionId')) { |
| 187: | $this->threeDServerTransactionId = $object->threeDServerTransactionId; |
| 188: | } |
| 189: | if (property_exists($object, 'xid')) { |
| 190: | $this->xid = $object->xid; |
| 191: | } |
| 192: | return $this; |
| 193: | } |
| 194: | } |
| 195: | |