| 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 ?string $acsTransactionId = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public ?string $appliedExemption = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public ?AmountOfMoney $authenticationAmount = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public ?string $cavv = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public ?string $directoryServerTransactionId = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public ?string $eci = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public ?ExemptionOutput $exemptionOutput = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public ?int $schemeRiskScore = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public ?SdkDataOutput $sdkData = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public ?ThreeDSecureData $threeDSecureData = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | public ?string $threeDSecureVersion = null; |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | public ?string $threeDServerTransactionId = null; |
| 75: | |
| 76: | |
| 77: | |
| 78: | |
| 79: | public ?string $xid = null; |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | public function toObject(): object |
| 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: | |
| 135: | public function fromObject(object $object): ThreeDSecureResults |
| 136: | { |
| 137: | parent::fromObject($object); |
| 138: | if (property_exists($object, 'acsTransactionId')) { |
| 139: | $this->acsTransactionId = $object->acsTransactionId; |
| 140: | } |
| 141: | if (property_exists($object, 'appliedExemption')) { |
| 142: | $this->appliedExemption = $object->appliedExemption; |
| 143: | } |
| 144: | if (property_exists($object, 'authenticationAmount')) { |
| 145: | if (!is_object($object->authenticationAmount)) { |
| 146: | throw new UnexpectedValueException('value \'' . print_r($object->authenticationAmount, true) . '\' is not an object'); |
| 147: | } |
| 148: | $value = new AmountOfMoney(); |
| 149: | $this->authenticationAmount = $value->fromObject($object->authenticationAmount); |
| 150: | } |
| 151: | if (property_exists($object, 'cavv')) { |
| 152: | $this->cavv = $object->cavv; |
| 153: | } |
| 154: | if (property_exists($object, 'directoryServerTransactionId')) { |
| 155: | $this->directoryServerTransactionId = $object->directoryServerTransactionId; |
| 156: | } |
| 157: | if (property_exists($object, 'eci')) { |
| 158: | $this->eci = $object->eci; |
| 159: | } |
| 160: | if (property_exists($object, 'exemptionOutput')) { |
| 161: | if (!is_object($object->exemptionOutput)) { |
| 162: | throw new UnexpectedValueException('value \'' . print_r($object->exemptionOutput, true) . '\' is not an object'); |
| 163: | } |
| 164: | $value = new ExemptionOutput(); |
| 165: | $this->exemptionOutput = $value->fromObject($object->exemptionOutput); |
| 166: | } |
| 167: | if (property_exists($object, 'schemeRiskScore')) { |
| 168: | $this->schemeRiskScore = $object->schemeRiskScore; |
| 169: | } |
| 170: | if (property_exists($object, 'sdkData')) { |
| 171: | if (!is_object($object->sdkData)) { |
| 172: | throw new UnexpectedValueException('value \'' . print_r($object->sdkData, true) . '\' is not an object'); |
| 173: | } |
| 174: | $value = new SdkDataOutput(); |
| 175: | $this->sdkData = $value->fromObject($object->sdkData); |
| 176: | } |
| 177: | if (property_exists($object, 'threeDSecureData')) { |
| 178: | if (!is_object($object->threeDSecureData)) { |
| 179: | throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureData, true) . '\' is not an object'); |
| 180: | } |
| 181: | $value = new ThreeDSecureData(); |
| 182: | $this->threeDSecureData = $value->fromObject($object->threeDSecureData); |
| 183: | } |
| 184: | if (property_exists($object, 'threeDSecureVersion')) { |
| 185: | $this->threeDSecureVersion = $object->threeDSecureVersion; |
| 186: | } |
| 187: | if (property_exists($object, 'threeDServerTransactionId')) { |
| 188: | $this->threeDServerTransactionId = $object->threeDServerTransactionId; |
| 189: | } |
| 190: | if (property_exists($object, 'xid')) { |
| 191: | $this->xid = $object->xid; |
| 192: | } |
| 193: | return $this; |
| 194: | } |
| 195: | } |
| 196: | |