| 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 CreatePayoutRequest extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | public $amountOfMoney = null; |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | public $bankAccountBban = null; |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | public $bankAccountIban = null; |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | public $bankTransferPayoutMethodSpecificInput = null; |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | public $cardPayoutMethodSpecificInput = null; |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public $customer = null; |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | public $merchant = null; |
| 54: | |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public $payoutDate = null; |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public $payoutDetails = null; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | |
| 70: | public $payoutText = null; |
| 71: | |
| 72: | |
| 73: | |
| 74: | |
| 75: | |
| 76: | public $references = null; |
| 77: | |
| 78: | |
| 79: | |
| 80: | |
| 81: | |
| 82: | public $swiftCode = null; |
| 83: | |
| 84: | |
| 85: | |
| 86: | |
| 87: | public function toObject() |
| 88: | { |
| 89: | $object = parent::toObject(); |
| 90: | if (!is_null($this->amountOfMoney)) { |
| 91: | $object->amountOfMoney = $this->amountOfMoney->toObject(); |
| 92: | } |
| 93: | if (!is_null($this->bankAccountBban)) { |
| 94: | $object->bankAccountBban = $this->bankAccountBban->toObject(); |
| 95: | } |
| 96: | if (!is_null($this->bankAccountIban)) { |
| 97: | $object->bankAccountIban = $this->bankAccountIban->toObject(); |
| 98: | } |
| 99: | if (!is_null($this->bankTransferPayoutMethodSpecificInput)) { |
| 100: | $object->bankTransferPayoutMethodSpecificInput = $this->bankTransferPayoutMethodSpecificInput->toObject(); |
| 101: | } |
| 102: | if (!is_null($this->cardPayoutMethodSpecificInput)) { |
| 103: | $object->cardPayoutMethodSpecificInput = $this->cardPayoutMethodSpecificInput->toObject(); |
| 104: | } |
| 105: | if (!is_null($this->customer)) { |
| 106: | $object->customer = $this->customer->toObject(); |
| 107: | } |
| 108: | if (!is_null($this->merchant)) { |
| 109: | $object->merchant = $this->merchant->toObject(); |
| 110: | } |
| 111: | if (!is_null($this->payoutDate)) { |
| 112: | $object->payoutDate = $this->payoutDate; |
| 113: | } |
| 114: | if (!is_null($this->payoutDetails)) { |
| 115: | $object->payoutDetails = $this->payoutDetails->toObject(); |
| 116: | } |
| 117: | if (!is_null($this->payoutText)) { |
| 118: | $object->payoutText = $this->payoutText; |
| 119: | } |
| 120: | if (!is_null($this->references)) { |
| 121: | $object->references = $this->references->toObject(); |
| 122: | } |
| 123: | if (!is_null($this->swiftCode)) { |
| 124: | $object->swiftCode = $this->swiftCode; |
| 125: | } |
| 126: | return $object; |
| 127: | } |
| 128: | |
| 129: | |
| 130: | |
| 131: | |
| 132: | |
| 133: | |
| 134: | public function fromObject($object) |
| 135: | { |
| 136: | parent::fromObject($object); |
| 137: | if (property_exists($object, 'amountOfMoney')) { |
| 138: | if (!is_object($object->amountOfMoney)) { |
| 139: | throw new UnexpectedValueException('value \'' . print_r($object->amountOfMoney, true) . '\' is not an object'); |
| 140: | } |
| 141: | $value = new AmountOfMoney(); |
| 142: | $this->amountOfMoney = $value->fromObject($object->amountOfMoney); |
| 143: | } |
| 144: | if (property_exists($object, 'bankAccountBban')) { |
| 145: | if (!is_object($object->bankAccountBban)) { |
| 146: | throw new UnexpectedValueException('value \'' . print_r($object->bankAccountBban, true) . '\' is not an object'); |
| 147: | } |
| 148: | $value = new BankAccountBban(); |
| 149: | $this->bankAccountBban = $value->fromObject($object->bankAccountBban); |
| 150: | } |
| 151: | if (property_exists($object, 'bankAccountIban')) { |
| 152: | if (!is_object($object->bankAccountIban)) { |
| 153: | throw new UnexpectedValueException('value \'' . print_r($object->bankAccountIban, true) . '\' is not an object'); |
| 154: | } |
| 155: | $value = new BankAccountIban(); |
| 156: | $this->bankAccountIban = $value->fromObject($object->bankAccountIban); |
| 157: | } |
| 158: | if (property_exists($object, 'bankTransferPayoutMethodSpecificInput')) { |
| 159: | if (!is_object($object->bankTransferPayoutMethodSpecificInput)) { |
| 160: | throw new UnexpectedValueException('value \'' . print_r($object->bankTransferPayoutMethodSpecificInput, true) . '\' is not an object'); |
| 161: | } |
| 162: | $value = new BankTransferPayoutMethodSpecificInput(); |
| 163: | $this->bankTransferPayoutMethodSpecificInput = $value->fromObject($object->bankTransferPayoutMethodSpecificInput); |
| 164: | } |
| 165: | if (property_exists($object, 'cardPayoutMethodSpecificInput')) { |
| 166: | if (!is_object($object->cardPayoutMethodSpecificInput)) { |
| 167: | throw new UnexpectedValueException('value \'' . print_r($object->cardPayoutMethodSpecificInput, true) . '\' is not an object'); |
| 168: | } |
| 169: | $value = new CardPayoutMethodSpecificInput(); |
| 170: | $this->cardPayoutMethodSpecificInput = $value->fromObject($object->cardPayoutMethodSpecificInput); |
| 171: | } |
| 172: | if (property_exists($object, 'customer')) { |
| 173: | if (!is_object($object->customer)) { |
| 174: | throw new UnexpectedValueException('value \'' . print_r($object->customer, true) . '\' is not an object'); |
| 175: | } |
| 176: | $value = new PayoutCustomer(); |
| 177: | $this->customer = $value->fromObject($object->customer); |
| 178: | } |
| 179: | if (property_exists($object, 'merchant')) { |
| 180: | if (!is_object($object->merchant)) { |
| 181: | throw new UnexpectedValueException('value \'' . print_r($object->merchant, true) . '\' is not an object'); |
| 182: | } |
| 183: | $value = new PayoutMerchant(); |
| 184: | $this->merchant = $value->fromObject($object->merchant); |
| 185: | } |
| 186: | if (property_exists($object, 'payoutDate')) { |
| 187: | $this->payoutDate = $object->payoutDate; |
| 188: | } |
| 189: | if (property_exists($object, 'payoutDetails')) { |
| 190: | if (!is_object($object->payoutDetails)) { |
| 191: | throw new UnexpectedValueException('value \'' . print_r($object->payoutDetails, true) . '\' is not an object'); |
| 192: | } |
| 193: | $value = new PayoutDetails(); |
| 194: | $this->payoutDetails = $value->fromObject($object->payoutDetails); |
| 195: | } |
| 196: | if (property_exists($object, 'payoutText')) { |
| 197: | $this->payoutText = $object->payoutText; |
| 198: | } |
| 199: | if (property_exists($object, 'references')) { |
| 200: | if (!is_object($object->references)) { |
| 201: | throw new UnexpectedValueException('value \'' . print_r($object->references, true) . '\' is not an object'); |
| 202: | } |
| 203: | $value = new PayoutReferences(); |
| 204: | $this->references = $value->fromObject($object->references); |
| 205: | } |
| 206: | if (property_exists($object, 'swiftCode')) { |
| 207: | $this->swiftCode = $object->swiftCode; |
| 208: | } |
| 209: | return $this; |
| 210: | } |
| 211: | } |
| 212: | |