| 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 SchemeTokenData extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $cardholderName = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $cryptogram = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $eci = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $networkToken = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $tokenExpiryDate = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public function toObject() |
| 45: | { |
| 46: | $object = parent::toObject(); |
| 47: | if (!is_null($this->cardholderName)) { |
| 48: | $object->cardholderName = $this->cardholderName; |
| 49: | } |
| 50: | if (!is_null($this->cryptogram)) { |
| 51: | $object->cryptogram = $this->cryptogram; |
| 52: | } |
| 53: | if (!is_null($this->eci)) { |
| 54: | $object->eci = $this->eci; |
| 55: | } |
| 56: | if (!is_null($this->networkToken)) { |
| 57: | $object->networkToken = $this->networkToken; |
| 58: | } |
| 59: | if (!is_null($this->tokenExpiryDate)) { |
| 60: | $object->tokenExpiryDate = $this->tokenExpiryDate; |
| 61: | } |
| 62: | return $object; |
| 63: | } |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | |
| 70: | public function fromObject($object) |
| 71: | { |
| 72: | parent::fromObject($object); |
| 73: | if (property_exists($object, 'cardholderName')) { |
| 74: | $this->cardholderName = $object->cardholderName; |
| 75: | } |
| 76: | if (property_exists($object, 'cryptogram')) { |
| 77: | $this->cryptogram = $object->cryptogram; |
| 78: | } |
| 79: | if (property_exists($object, 'eci')) { |
| 80: | $this->eci = $object->eci; |
| 81: | } |
| 82: | if (property_exists($object, 'networkToken')) { |
| 83: | $this->networkToken = $object->networkToken; |
| 84: | } |
| 85: | if (property_exists($object, 'tokenExpiryDate')) { |
| 86: | $this->tokenExpiryDate = $object->tokenExpiryDate; |
| 87: | } |
| 88: | return $this; |
| 89: | } |
| 90: | } |
| 91: | |