/// <summary> /// Initializes a new instance of the <see cref="CreditCardInfo" /> class. /// </summary> /// <param name="CardNumber">CardNumber (required).</param> /// <param name="CardVerificationCode">CardVerificationCode (required).</param> /// <param name="ExpirationMonth">ExpirationMonth (required).</param> /// <param name="ExpirationYear">ExpirationYear (required).</param> public CreditCardInfo(CardNumber CardNumber = default(CardNumber), CardVerificationCode CardVerificationCode = default(CardVerificationCode), ExpirationMonth ExpirationMonth = default(ExpirationMonth), ExpirationYear ExpirationYear = default(ExpirationYear)) { // to ensure "CardNumber" is required (not null) if (CardNumber == null) { throw new InvalidDataException("CardNumber is a required property for CreditCardInfo and cannot be null"); } else { this.CardNumber = CardNumber; } // to ensure "CardVerificationCode" is required (not null) if (CardVerificationCode == null) { throw new InvalidDataException("CardVerificationCode is a required property for CreditCardInfo and cannot be null"); } else { this.CardVerificationCode = CardVerificationCode; } // to ensure "ExpirationMonth" is required (not null) if (ExpirationMonth == null) { throw new InvalidDataException("ExpirationMonth is a required property for CreditCardInfo and cannot be null"); } else { this.ExpirationMonth = ExpirationMonth; } // to ensure "ExpirationYear" is required (not null) if (ExpirationYear == null) { throw new InvalidDataException("ExpirationYear is a required property for CreditCardInfo and cannot be null"); } else { this.ExpirationYear = ExpirationYear; } }
/// <summary> /// Initializes a new instance of the <see cref="CreditCardInfoWithCardType" /> class. /// </summary> /// <param name="CardNumber">CardNumber (required).</param> /// <param name="ExpirationMonth">ExpirationMonth (required).</param> /// <param name="ExpirationYear">ExpirationYear (required).</param> /// <param name="CardType">Your credit card type. Example: VISA, MasterCard, etc... (required).</param> public CreditCardInfoWithCardType(CardNumber CardNumber = default(CardNumber), ExpirationMonth ExpirationMonth = default(ExpirationMonth), ExpirationYear ExpirationYear = default(ExpirationYear), string CardType = default(string)) { // to ensure "CardNumber" is required (not null) if (CardNumber == null) { throw new InvalidDataException("CardNumber is a required property for CreditCardInfoWithCardType and cannot be null"); } else { this.CardNumber = CardNumber; } // to ensure "ExpirationMonth" is required (not null) if (ExpirationMonth == null) { throw new InvalidDataException("ExpirationMonth is a required property for CreditCardInfoWithCardType and cannot be null"); } else { this.ExpirationMonth = ExpirationMonth; } // to ensure "ExpirationYear" is required (not null) if (ExpirationYear == null) { throw new InvalidDataException("ExpirationYear is a required property for CreditCardInfoWithCardType and cannot be null"); } else { this.ExpirationYear = ExpirationYear; } // to ensure "CardType" is required (not null) if (CardType == null) { throw new InvalidDataException("CardType is a required property for CreditCardInfoWithCardType and cannot be null"); } else { this.CardType = CardType; } }