| 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 DisputeCase extends DataObject |
| 14: | { |
| 15: | |
| 16: | |
| 17: | |
| 18: | public ?DisputeDateTimeData $disputeDateTimeData = null; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public ?string $disputeId = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | public ?DisputeReferences $disputeReferences = null; |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public ?string $disputeStage = null; |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public ?string $disputeStatus = null; |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | public ?string $disputeStatusCategory = null; |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public ?bool $isOpen = null; |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | public ?SignedAmountData $merchantBalanceAmount = null; |
| 54: | |
| 55: | |
| 56: | |
| 57: | |
| 58: | public ?DisputeMerchantData $merchantData = null; |
| 59: | |
| 60: | |
| 61: | |
| 62: | |
| 63: | public ?AmountData $originalDisputeAmount = null; |
| 64: | |
| 65: | |
| 66: | |
| 67: | |
| 68: | public ?OriginalTransactionData $originalTransactionData = null; |
| 69: | |
| 70: | |
| 71: | |
| 72: | |
| 73: | public ?string $schemeReason = null; |
| 74: | |
| 75: | |
| 76: | |
| 77: | |
| 78: | public ?string $schemeReasonDescription = null; |
| 79: | |
| 80: | |
| 81: | |
| 82: | |
| 83: | public ?string $unifiedCategory = null; |
| 84: | |
| 85: | |
| 86: | |
| 87: | |
| 88: | public ?string $unifiedReason = null; |
| 89: | |
| 90: | |
| 91: | |
| 92: | |
| 93: | public function toObject(): object |
| 94: | { |
| 95: | $object = parent::toObject(); |
| 96: | if (!is_null($this->disputeDateTimeData)) { |
| 97: | $object->disputeDateTimeData = $this->disputeDateTimeData->toObject(); |
| 98: | } |
| 99: | if (!is_null($this->disputeId)) { |
| 100: | $object->disputeId = $this->disputeId; |
| 101: | } |
| 102: | if (!is_null($this->disputeReferences)) { |
| 103: | $object->disputeReferences = $this->disputeReferences->toObject(); |
| 104: | } |
| 105: | if (!is_null($this->disputeStage)) { |
| 106: | $object->disputeStage = $this->disputeStage; |
| 107: | } |
| 108: | if (!is_null($this->disputeStatus)) { |
| 109: | $object->disputeStatus = $this->disputeStatus; |
| 110: | } |
| 111: | if (!is_null($this->disputeStatusCategory)) { |
| 112: | $object->disputeStatusCategory = $this->disputeStatusCategory; |
| 113: | } |
| 114: | if (!is_null($this->isOpen)) { |
| 115: | $object->isOpen = $this->isOpen; |
| 116: | } |
| 117: | if (!is_null($this->merchantBalanceAmount)) { |
| 118: | $object->merchantBalanceAmount = $this->merchantBalanceAmount->toObject(); |
| 119: | } |
| 120: | if (!is_null($this->merchantData)) { |
| 121: | $object->merchantData = $this->merchantData->toObject(); |
| 122: | } |
| 123: | if (!is_null($this->originalDisputeAmount)) { |
| 124: | $object->originalDisputeAmount = $this->originalDisputeAmount->toObject(); |
| 125: | } |
| 126: | if (!is_null($this->originalTransactionData)) { |
| 127: | $object->originalTransactionData = $this->originalTransactionData->toObject(); |
| 128: | } |
| 129: | if (!is_null($this->schemeReason)) { |
| 130: | $object->schemeReason = $this->schemeReason; |
| 131: | } |
| 132: | if (!is_null($this->schemeReasonDescription)) { |
| 133: | $object->schemeReasonDescription = $this->schemeReasonDescription; |
| 134: | } |
| 135: | if (!is_null($this->unifiedCategory)) { |
| 136: | $object->unifiedCategory = $this->unifiedCategory; |
| 137: | } |
| 138: | if (!is_null($this->unifiedReason)) { |
| 139: | $object->unifiedReason = $this->unifiedReason; |
| 140: | } |
| 141: | return $object; |
| 142: | } |
| 143: | |
| 144: | |
| 145: | |
| 146: | |
| 147: | |
| 148: | |
| 149: | |
| 150: | public function fromObject(object $object): DisputeCase |
| 151: | { |
| 152: | parent::fromObject($object); |
| 153: | if (property_exists($object, 'disputeDateTimeData')) { |
| 154: | if (!is_object($object->disputeDateTimeData)) { |
| 155: | throw new UnexpectedValueException('value \'' . print_r($object->disputeDateTimeData, true) . '\' is not an object'); |
| 156: | } |
| 157: | $value = new DisputeDateTimeData(); |
| 158: | $this->disputeDateTimeData = $value->fromObject($object->disputeDateTimeData); |
| 159: | } |
| 160: | if (property_exists($object, 'disputeId')) { |
| 161: | $this->disputeId = $object->disputeId; |
| 162: | } |
| 163: | if (property_exists($object, 'disputeReferences')) { |
| 164: | if (!is_object($object->disputeReferences)) { |
| 165: | throw new UnexpectedValueException('value \'' . print_r($object->disputeReferences, true) . '\' is not an object'); |
| 166: | } |
| 167: | $value = new DisputeReferences(); |
| 168: | $this->disputeReferences = $value->fromObject($object->disputeReferences); |
| 169: | } |
| 170: | if (property_exists($object, 'disputeStage')) { |
| 171: | $this->disputeStage = $object->disputeStage; |
| 172: | } |
| 173: | if (property_exists($object, 'disputeStatus')) { |
| 174: | $this->disputeStatus = $object->disputeStatus; |
| 175: | } |
| 176: | if (property_exists($object, 'disputeStatusCategory')) { |
| 177: | $this->disputeStatusCategory = $object->disputeStatusCategory; |
| 178: | } |
| 179: | if (property_exists($object, 'isOpen')) { |
| 180: | $this->isOpen = $object->isOpen; |
| 181: | } |
| 182: | if (property_exists($object, 'merchantBalanceAmount')) { |
| 183: | if (!is_object($object->merchantBalanceAmount)) { |
| 184: | throw new UnexpectedValueException('value \'' . print_r($object->merchantBalanceAmount, true) . '\' is not an object'); |
| 185: | } |
| 186: | $value = new SignedAmountData(); |
| 187: | $this->merchantBalanceAmount = $value->fromObject($object->merchantBalanceAmount); |
| 188: | } |
| 189: | if (property_exists($object, 'merchantData')) { |
| 190: | if (!is_object($object->merchantData)) { |
| 191: | throw new UnexpectedValueException('value \'' . print_r($object->merchantData, true) . '\' is not an object'); |
| 192: | } |
| 193: | $value = new DisputeMerchantData(); |
| 194: | $this->merchantData = $value->fromObject($object->merchantData); |
| 195: | } |
| 196: | if (property_exists($object, 'originalDisputeAmount')) { |
| 197: | if (!is_object($object->originalDisputeAmount)) { |
| 198: | throw new UnexpectedValueException('value \'' . print_r($object->originalDisputeAmount, true) . '\' is not an object'); |
| 199: | } |
| 200: | $value = new AmountData(); |
| 201: | $this->originalDisputeAmount = $value->fromObject($object->originalDisputeAmount); |
| 202: | } |
| 203: | if (property_exists($object, 'originalTransactionData')) { |
| 204: | if (!is_object($object->originalTransactionData)) { |
| 205: | throw new UnexpectedValueException('value \'' . print_r($object->originalTransactionData, true) . '\' is not an object'); |
| 206: | } |
| 207: | $value = new OriginalTransactionData(); |
| 208: | $this->originalTransactionData = $value->fromObject($object->originalTransactionData); |
| 209: | } |
| 210: | if (property_exists($object, 'schemeReason')) { |
| 211: | $this->schemeReason = $object->schemeReason; |
| 212: | } |
| 213: | if (property_exists($object, 'schemeReasonDescription')) { |
| 214: | $this->schemeReasonDescription = $object->schemeReasonDescription; |
| 215: | } |
| 216: | if (property_exists($object, 'unifiedCategory')) { |
| 217: | $this->unifiedCategory = $object->unifiedCategory; |
| 218: | } |
| 219: | if (property_exists($object, 'unifiedReason')) { |
| 220: | $this->unifiedReason = $object->unifiedReason; |
| 221: | } |
| 222: | return $this; |
| 223: | } |
| 224: | } |
| 225: | |