| 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 AbstractThreeDSecure extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $authenticationAmount = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $authenticationFlow = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $challengeCanvasSize = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $challengeIndicator = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $exemptionRequest = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $priorThreeDSecureData = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $sdkData = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $skipAuthentication = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public $transactionRiskLevel = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public function toObject() |
| 65: | { |
| 66: | $object = parent::toObject(); |
| 67: | if (!is_null($this->authenticationAmount)) { |
| 68: | $object->authenticationAmount = $this->authenticationAmount->toObject(); |
| 69: | } |
| 70: | if (!is_null($this->authenticationFlow)) { |
| 71: | $object->authenticationFlow = $this->authenticationFlow; |
| 72: | } |
| 73: | if (!is_null($this->challengeCanvasSize)) { |
| 74: | $object->challengeCanvasSize = $this->challengeCanvasSize; |
| 75: | } |
| 76: | if (!is_null($this->challengeIndicator)) { |
| 77: | $object->challengeIndicator = $this->challengeIndicator; |
| 78: | } |
| 79: | if (!is_null($this->exemptionRequest)) { |
| 80: | $object->exemptionRequest = $this->exemptionRequest; |
| 81: | } |
| 82: | if (!is_null($this->priorThreeDSecureData)) { |
| 83: | $object->priorThreeDSecureData = $this->priorThreeDSecureData->toObject(); |
| 84: | } |
| 85: | if (!is_null($this->sdkData)) { |
| 86: | $object->sdkData = $this->sdkData->toObject(); |
| 87: | } |
| 88: | if (!is_null($this->skipAuthentication)) { |
| 89: | $object->skipAuthentication = $this->skipAuthentication; |
| 90: | } |
| 91: | if (!is_null($this->transactionRiskLevel)) { |
| 92: | $object->transactionRiskLevel = $this->transactionRiskLevel; |
| 93: | } |
| 94: | return $object; |
| 95: | } |
| 96: | |
| 97: | |
| 98: | |
| 99: | |
| 100: | |
| 101: | |
| 102: | public function fromObject($object) |
| 103: | { |
| 104: | parent::fromObject($object); |
| 105: | if (property_exists($object, 'authenticationAmount')) { |
| 106: | if (!is_object($object->authenticationAmount)) { |
| 107: | throw new UnexpectedValueException('value \'' . print_r($object->authenticationAmount, true) . '\' is not an object'); |
| 108: | } |
| 109: | $value = new AmountOfMoney(); |
| 110: | $this->authenticationAmount = $value->fromObject($object->authenticationAmount); |
| 111: | } |
| 112: | if (property_exists($object, 'authenticationFlow')) { |
| 113: | $this->authenticationFlow = $object->authenticationFlow; |
| 114: | } |
| 115: | if (property_exists($object, 'challengeCanvasSize')) { |
| 116: | $this->challengeCanvasSize = $object->challengeCanvasSize; |
| 117: | } |
| 118: | if (property_exists($object, 'challengeIndicator')) { |
| 119: | $this->challengeIndicator = $object->challengeIndicator; |
| 120: | } |
| 121: | if (property_exists($object, 'exemptionRequest')) { |
| 122: | $this->exemptionRequest = $object->exemptionRequest; |
| 123: | } |
| 124: | if (property_exists($object, 'priorThreeDSecureData')) { |
| 125: | if (!is_object($object->priorThreeDSecureData)) { |
| 126: | throw new UnexpectedValueException('value \'' . print_r($object->priorThreeDSecureData, true) . '\' is not an object'); |
| 127: | } |
| 128: | $value = new ThreeDSecureData(); |
| 129: | $this->priorThreeDSecureData = $value->fromObject($object->priorThreeDSecureData); |
| 130: | } |
| 131: | if (property_exists($object, 'sdkData')) { |
| 132: | if (!is_object($object->sdkData)) { |
| 133: | throw new UnexpectedValueException('value \'' . print_r($object->sdkData, true) . '\' is not an object'); |
| 134: | } |
| 135: | $value = new SdkDataInput(); |
| 136: | $this->sdkData = $value->fromObject($object->sdkData); |
| 137: | } |
| 138: | if (property_exists($object, 'skipAuthentication')) { |
| 139: | $this->skipAuthentication = $object->skipAuthentication; |
| 140: | } |
| 141: | if (property_exists($object, 'transactionRiskLevel')) { |
| 142: | $this->transactionRiskLevel = $object->transactionRiskLevel; |
| 143: | } |
| 144: | return $this; |
| 145: | } |
| 146: | } |
| 147: | |