| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | namespace Worldline\Acquiring\Sdk\V1\Domain; |
| 6: | |
| 7: | use UnexpectedValueException; |
| 8: | use Worldline\Acquiring\Sdk\Domain\DataObject; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | class ApiActionResponseForRefund extends DataObject |
| 14: | { |
| 15: | |
| 16: | |
| 17: | |
| 18: | public $additionalResponseData = null; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public $operationId = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | public $refund = null; |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public $responder = null; |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public $responseCode = null; |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | public $responseCodeCategory = null; |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public $responseCodeDescription = null; |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | public function toObject() |
| 54: | { |
| 55: | $object = parent::toObject(); |
| 56: | if (!is_null($this->additionalResponseData)) { |
| 57: | $object->additionalResponseData = $this->additionalResponseData->toObject(); |
| 58: | } |
| 59: | if (!is_null($this->operationId)) { |
| 60: | $object->operationId = $this->operationId; |
| 61: | } |
| 62: | if (!is_null($this->refund)) { |
| 63: | $object->refund = $this->refund->toObject(); |
| 64: | } |
| 65: | if (!is_null($this->responder)) { |
| 66: | $object->responder = $this->responder; |
| 67: | } |
| 68: | if (!is_null($this->responseCode)) { |
| 69: | $object->responseCode = $this->responseCode; |
| 70: | } |
| 71: | if (!is_null($this->responseCodeCategory)) { |
| 72: | $object->responseCodeCategory = $this->responseCodeCategory; |
| 73: | } |
| 74: | if (!is_null($this->responseCodeDescription)) { |
| 75: | $object->responseCodeDescription = $this->responseCodeDescription; |
| 76: | } |
| 77: | return $object; |
| 78: | } |
| 79: | |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | |
| 85: | public function fromObject($object) |
| 86: | { |
| 87: | parent::fromObject($object); |
| 88: | if (property_exists($object, 'additionalResponseData')) { |
| 89: | if (!is_object($object->additionalResponseData)) { |
| 90: | throw new UnexpectedValueException('value \'' . print_r($object->additionalResponseData, true) . '\' is not an object'); |
| 91: | } |
| 92: | $value = new AdditionalResponseData(); |
| 93: | $this->additionalResponseData = $value->fromObject($object->additionalResponseData); |
| 94: | } |
| 95: | if (property_exists($object, 'operationId')) { |
| 96: | $this->operationId = $object->operationId; |
| 97: | } |
| 98: | if (property_exists($object, 'refund')) { |
| 99: | if (!is_object($object->refund)) { |
| 100: | throw new UnexpectedValueException('value \'' . print_r($object->refund, true) . '\' is not an object'); |
| 101: | } |
| 102: | $value = new ApiRefundSummaryForResponse(); |
| 103: | $this->refund = $value->fromObject($object->refund); |
| 104: | } |
| 105: | if (property_exists($object, 'responder')) { |
| 106: | $this->responder = $object->responder; |
| 107: | } |
| 108: | if (property_exists($object, 'responseCode')) { |
| 109: | $this->responseCode = $object->responseCode; |
| 110: | } |
| 111: | if (property_exists($object, 'responseCodeCategory')) { |
| 112: | $this->responseCodeCategory = $object->responseCodeCategory; |
| 113: | } |
| 114: | if (property_exists($object, 'responseCodeDescription')) { |
| 115: | $this->responseCodeDescription = $object->responseCodeDescription; |
| 116: | } |
| 117: | return $this; |
| 118: | } |
| 119: | } |
| 120: | |