| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | namespace Worldline\Connect\Sdk\V1\Domain; |
| 7: | |
| 8: | use UnexpectedValueException; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | class CardPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput |
| 14: | { |
| 15: | |
| 16: | |
| 17: | |
| 18: | public $authorisationCode = null; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public $card = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | public $fraudResults = null; |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public $initialSchemeTransactionId = null; |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public $networkTokenData = null; |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | public $networkTokenUsed = null; |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public $paymentAccountReference = null; |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | public $schemeTransactionId = null; |
| 54: | |
| 55: | |
| 56: | |
| 57: | |
| 58: | public $threeDSecureResults = null; |
| 59: | |
| 60: | |
| 61: | |
| 62: | |
| 63: | public $token = null; |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | public function toObject() |
| 69: | { |
| 70: | $object = parent::toObject(); |
| 71: | if (!is_null($this->authorisationCode)) { |
| 72: | $object->authorisationCode = $this->authorisationCode; |
| 73: | } |
| 74: | if (!is_null($this->card)) { |
| 75: | $object->card = $this->card->toObject(); |
| 76: | } |
| 77: | if (!is_null($this->fraudResults)) { |
| 78: | $object->fraudResults = $this->fraudResults->toObject(); |
| 79: | } |
| 80: | if (!is_null($this->initialSchemeTransactionId)) { |
| 81: | $object->initialSchemeTransactionId = $this->initialSchemeTransactionId; |
| 82: | } |
| 83: | if (!is_null($this->networkTokenData)) { |
| 84: | $object->networkTokenData = $this->networkTokenData->toObject(); |
| 85: | } |
| 86: | if (!is_null($this->networkTokenUsed)) { |
| 87: | $object->networkTokenUsed = $this->networkTokenUsed; |
| 88: | } |
| 89: | if (!is_null($this->paymentAccountReference)) { |
| 90: | $object->paymentAccountReference = $this->paymentAccountReference; |
| 91: | } |
| 92: | if (!is_null($this->schemeTransactionId)) { |
| 93: | $object->schemeTransactionId = $this->schemeTransactionId; |
| 94: | } |
| 95: | if (!is_null($this->threeDSecureResults)) { |
| 96: | $object->threeDSecureResults = $this->threeDSecureResults->toObject(); |
| 97: | } |
| 98: | if (!is_null($this->token)) { |
| 99: | $object->token = $this->token; |
| 100: | } |
| 101: | return $object; |
| 102: | } |
| 103: | |
| 104: | |
| 105: | |
| 106: | |
| 107: | |
| 108: | |
| 109: | public function fromObject($object) |
| 110: | { |
| 111: | parent::fromObject($object); |
| 112: | if (property_exists($object, 'authorisationCode')) { |
| 113: | $this->authorisationCode = $object->authorisationCode; |
| 114: | } |
| 115: | if (property_exists($object, 'card')) { |
| 116: | if (!is_object($object->card)) { |
| 117: | throw new UnexpectedValueException('value \'' . print_r($object->card, true) . '\' is not an object'); |
| 118: | } |
| 119: | $value = new CardEssentials(); |
| 120: | $this->card = $value->fromObject($object->card); |
| 121: | } |
| 122: | if (property_exists($object, 'fraudResults')) { |
| 123: | if (!is_object($object->fraudResults)) { |
| 124: | throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object'); |
| 125: | } |
| 126: | $value = new CardFraudResults(); |
| 127: | $this->fraudResults = $value->fromObject($object->fraudResults); |
| 128: | } |
| 129: | if (property_exists($object, 'initialSchemeTransactionId')) { |
| 130: | $this->initialSchemeTransactionId = $object->initialSchemeTransactionId; |
| 131: | } |
| 132: | if (property_exists($object, 'networkTokenData')) { |
| 133: | if (!is_object($object->networkTokenData)) { |
| 134: | throw new UnexpectedValueException('value \'' . print_r($object->networkTokenData, true) . '\' is not an object'); |
| 135: | } |
| 136: | $value = new NetworkTokenData(); |
| 137: | $this->networkTokenData = $value->fromObject($object->networkTokenData); |
| 138: | } |
| 139: | if (property_exists($object, 'networkTokenUsed')) { |
| 140: | $this->networkTokenUsed = $object->networkTokenUsed; |
| 141: | } |
| 142: | if (property_exists($object, 'paymentAccountReference')) { |
| 143: | $this->paymentAccountReference = $object->paymentAccountReference; |
| 144: | } |
| 145: | if (property_exists($object, 'schemeTransactionId')) { |
| 146: | $this->schemeTransactionId = $object->schemeTransactionId; |
| 147: | } |
| 148: | if (property_exists($object, 'threeDSecureResults')) { |
| 149: | if (!is_object($object->threeDSecureResults)) { |
| 150: | throw new UnexpectedValueException('value \'' . print_r($object->threeDSecureResults, true) . '\' is not an object'); |
| 151: | } |
| 152: | $value = new ThreeDSecureResults(); |
| 153: | $this->threeDSecureResults = $value->fromObject($object->threeDSecureResults); |
| 154: | } |
| 155: | if (property_exists($object, 'token')) { |
| 156: | $this->token = $object->token; |
| 157: | } |
| 158: | return $this; |
| 159: | } |
| 160: | } |
| 161: | |