| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | namespace Worldline\Connect\Sdk\V1\Domain; |
| 7: | |
| 8: | use UnexpectedValueException; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | class AbstractCardPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput |
| 14: | { |
| 15: | |
| 16: | |
| 17: | |
| 18: | public ?string $acquirerPromotionCode = null; |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | public ?string $authorizationMode = null; |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | public ?string $customerReference = null; |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public ?string $initialSchemeTransactionId = null; |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | public ?CardRecurrenceDetails $recurring = null; |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | public ?string $recurringPaymentSequenceIndicator = null; |
| 46: | |
| 47: | |
| 48: | |
| 49: | |
| 50: | public ?bool $requiresApproval = null; |
| 51: | |
| 52: | |
| 53: | |
| 54: | |
| 55: | |
| 56: | |
| 57: | public ?bool $skipAuthentication = null; |
| 58: | |
| 59: | |
| 60: | |
| 61: | |
| 62: | public ?bool $skipFraudService = null; |
| 63: | |
| 64: | |
| 65: | |
| 66: | |
| 67: | public ?string $token = null; |
| 68: | |
| 69: | |
| 70: | |
| 71: | |
| 72: | public ?bool $tokenize = null; |
| 73: | |
| 74: | |
| 75: | |
| 76: | |
| 77: | public ?string $transactionChannel = null; |
| 78: | |
| 79: | |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | public ?string $unscheduledCardOnFileIndicator = null; |
| 85: | |
| 86: | |
| 87: | |
| 88: | |
| 89: | public ?string $unscheduledCardOnFileRequestor = null; |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | public ?string $unscheduledCardOnFileSequenceIndicator = null; |
| 95: | |
| 96: | |
| 97: | |
| 98: | |
| 99: | public function toObject(): object |
| 100: | { |
| 101: | $object = parent::toObject(); |
| 102: | if (!is_null($this->acquirerPromotionCode)) { |
| 103: | $object->acquirerPromotionCode = $this->acquirerPromotionCode; |
| 104: | } |
| 105: | if (!is_null($this->authorizationMode)) { |
| 106: | $object->authorizationMode = $this->authorizationMode; |
| 107: | } |
| 108: | if (!is_null($this->customerReference)) { |
| 109: | $object->customerReference = $this->customerReference; |
| 110: | } |
| 111: | if (!is_null($this->initialSchemeTransactionId)) { |
| 112: | $object->initialSchemeTransactionId = $this->initialSchemeTransactionId; |
| 113: | } |
| 114: | if (!is_null($this->recurring)) { |
| 115: | $object->recurring = $this->recurring->toObject(); |
| 116: | } |
| 117: | if (!is_null($this->recurringPaymentSequenceIndicator)) { |
| 118: | $object->recurringPaymentSequenceIndicator = $this->recurringPaymentSequenceIndicator; |
| 119: | } |
| 120: | if (!is_null($this->requiresApproval)) { |
| 121: | $object->requiresApproval = $this->requiresApproval; |
| 122: | } |
| 123: | if (!is_null($this->skipAuthentication)) { |
| 124: | $object->skipAuthentication = $this->skipAuthentication; |
| 125: | } |
| 126: | if (!is_null($this->skipFraudService)) { |
| 127: | $object->skipFraudService = $this->skipFraudService; |
| 128: | } |
| 129: | if (!is_null($this->token)) { |
| 130: | $object->token = $this->token; |
| 131: | } |
| 132: | if (!is_null($this->tokenize)) { |
| 133: | $object->tokenize = $this->tokenize; |
| 134: | } |
| 135: | if (!is_null($this->transactionChannel)) { |
| 136: | $object->transactionChannel = $this->transactionChannel; |
| 137: | } |
| 138: | if (!is_null($this->unscheduledCardOnFileIndicator)) { |
| 139: | $object->unscheduledCardOnFileIndicator = $this->unscheduledCardOnFileIndicator; |
| 140: | } |
| 141: | if (!is_null($this->unscheduledCardOnFileRequestor)) { |
| 142: | $object->unscheduledCardOnFileRequestor = $this->unscheduledCardOnFileRequestor; |
| 143: | } |
| 144: | if (!is_null($this->unscheduledCardOnFileSequenceIndicator)) { |
| 145: | $object->unscheduledCardOnFileSequenceIndicator = $this->unscheduledCardOnFileSequenceIndicator; |
| 146: | } |
| 147: | return $object; |
| 148: | } |
| 149: | |
| 150: | |
| 151: | |
| 152: | |
| 153: | |
| 154: | |
| 155: | |
| 156: | public function fromObject(object $object): AbstractCardPaymentMethodSpecificInput |
| 157: | { |
| 158: | parent::fromObject($object); |
| 159: | if (property_exists($object, 'acquirerPromotionCode')) { |
| 160: | $this->acquirerPromotionCode = $object->acquirerPromotionCode; |
| 161: | } |
| 162: | if (property_exists($object, 'authorizationMode')) { |
| 163: | $this->authorizationMode = $object->authorizationMode; |
| 164: | } |
| 165: | if (property_exists($object, 'customerReference')) { |
| 166: | $this->customerReference = $object->customerReference; |
| 167: | } |
| 168: | if (property_exists($object, 'initialSchemeTransactionId')) { |
| 169: | $this->initialSchemeTransactionId = $object->initialSchemeTransactionId; |
| 170: | } |
| 171: | if (property_exists($object, 'recurring')) { |
| 172: | if (!is_object($object->recurring)) { |
| 173: | throw new UnexpectedValueException('value \'' . print_r($object->recurring, true) . '\' is not an object'); |
| 174: | } |
| 175: | $value = new CardRecurrenceDetails(); |
| 176: | $this->recurring = $value->fromObject($object->recurring); |
| 177: | } |
| 178: | if (property_exists($object, 'recurringPaymentSequenceIndicator')) { |
| 179: | $this->recurringPaymentSequenceIndicator = $object->recurringPaymentSequenceIndicator; |
| 180: | } |
| 181: | if (property_exists($object, 'requiresApproval')) { |
| 182: | $this->requiresApproval = $object->requiresApproval; |
| 183: | } |
| 184: | if (property_exists($object, 'skipAuthentication')) { |
| 185: | $this->skipAuthentication = $object->skipAuthentication; |
| 186: | } |
| 187: | if (property_exists($object, 'skipFraudService')) { |
| 188: | $this->skipFraudService = $object->skipFraudService; |
| 189: | } |
| 190: | if (property_exists($object, 'token')) { |
| 191: | $this->token = $object->token; |
| 192: | } |
| 193: | if (property_exists($object, 'tokenize')) { |
| 194: | $this->tokenize = $object->tokenize; |
| 195: | } |
| 196: | if (property_exists($object, 'transactionChannel')) { |
| 197: | $this->transactionChannel = $object->transactionChannel; |
| 198: | } |
| 199: | if (property_exists($object, 'unscheduledCardOnFileIndicator')) { |
| 200: | $this->unscheduledCardOnFileIndicator = $object->unscheduledCardOnFileIndicator; |
| 201: | } |
| 202: | if (property_exists($object, 'unscheduledCardOnFileRequestor')) { |
| 203: | $this->unscheduledCardOnFileRequestor = $object->unscheduledCardOnFileRequestor; |
| 204: | } |
| 205: | if (property_exists($object, 'unscheduledCardOnFileSequenceIndicator')) { |
| 206: | $this->unscheduledCardOnFileSequenceIndicator = $object->unscheduledCardOnFileSequenceIndicator; |
| 207: | } |
| 208: | return $this; |
| 209: | } |
| 210: | } |
| 211: | |