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