| 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 PaymentProduct302SpecificInput extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $automaticReloadBilling = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $billingAgreement = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $deferredBilling = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $managementUrl = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $paymentDescription = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $regularBilling = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $tokenNotificationUrl = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $trialBilling = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public function toObject() |
| 60: | { |
| 61: | $object = parent::toObject(); |
| 62: | if (!is_null($this->automaticReloadBilling)) { |
| 63: | $object->automaticReloadBilling = $this->automaticReloadBilling->toObject(); |
| 64: | } |
| 65: | if (!is_null($this->billingAgreement)) { |
| 66: | $object->billingAgreement = $this->billingAgreement; |
| 67: | } |
| 68: | if (!is_null($this->deferredBilling)) { |
| 69: | $object->deferredBilling = $this->deferredBilling->toObject(); |
| 70: | } |
| 71: | if (!is_null($this->managementUrl)) { |
| 72: | $object->managementUrl = $this->managementUrl; |
| 73: | } |
| 74: | if (!is_null($this->paymentDescription)) { |
| 75: | $object->paymentDescription = $this->paymentDescription; |
| 76: | } |
| 77: | if (!is_null($this->regularBilling)) { |
| 78: | $object->regularBilling = $this->regularBilling->toObject(); |
| 79: | } |
| 80: | if (!is_null($this->tokenNotificationUrl)) { |
| 81: | $object->tokenNotificationUrl = $this->tokenNotificationUrl; |
| 82: | } |
| 83: | if (!is_null($this->trialBilling)) { |
| 84: | $object->trialBilling = $this->trialBilling->toObject(); |
| 85: | } |
| 86: | return $object; |
| 87: | } |
| 88: | |
| 89: | |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | public function fromObject($object) |
| 95: | { |
| 96: | parent::fromObject($object); |
| 97: | if (property_exists($object, 'automaticReloadBilling')) { |
| 98: | if (!is_object($object->automaticReloadBilling)) { |
| 99: | throw new UnexpectedValueException('value \'' . print_r($object->automaticReloadBilling, true) . '\' is not an object'); |
| 100: | } |
| 101: | $value = new AutomaticReloadBillingDetails(); |
| 102: | $this->automaticReloadBilling = $value->fromObject($object->automaticReloadBilling); |
| 103: | } |
| 104: | if (property_exists($object, 'billingAgreement')) { |
| 105: | $this->billingAgreement = $object->billingAgreement; |
| 106: | } |
| 107: | if (property_exists($object, 'deferredBilling')) { |
| 108: | if (!is_object($object->deferredBilling)) { |
| 109: | throw new UnexpectedValueException('value \'' . print_r($object->deferredBilling, true) . '\' is not an object'); |
| 110: | } |
| 111: | $value = new DeferredBillingDetails(); |
| 112: | $this->deferredBilling = $value->fromObject($object->deferredBilling); |
| 113: | } |
| 114: | if (property_exists($object, 'managementUrl')) { |
| 115: | $this->managementUrl = $object->managementUrl; |
| 116: | } |
| 117: | if (property_exists($object, 'paymentDescription')) { |
| 118: | $this->paymentDescription = $object->paymentDescription; |
| 119: | } |
| 120: | if (property_exists($object, 'regularBilling')) { |
| 121: | if (!is_object($object->regularBilling)) { |
| 122: | throw new UnexpectedValueException('value \'' . print_r($object->regularBilling, true) . '\' is not an object'); |
| 123: | } |
| 124: | $value = new RecurringBillingDetails(); |
| 125: | $this->regularBilling = $value->fromObject($object->regularBilling); |
| 126: | } |
| 127: | if (property_exists($object, 'tokenNotificationUrl')) { |
| 128: | $this->tokenNotificationUrl = $object->tokenNotificationUrl; |
| 129: | } |
| 130: | if (property_exists($object, 'trialBilling')) { |
| 131: | if (!is_object($object->trialBilling)) { |
| 132: | throw new UnexpectedValueException('value \'' . print_r($object->trialBilling, true) . '\' is not an object'); |
| 133: | } |
| 134: | $value = new RecurringBillingDetails(); |
| 135: | $this->trialBilling = $value->fromObject($object->trialBilling); |
| 136: | } |
| 137: | return $this; |
| 138: | } |
| 139: | } |
| 140: | |