/// <summary> /// Initializes a new instance of the <see cref="Payment" /> class. /// </summary> /// <param name="amount">amount (required).</param> /// <param name="bic">The BIC of the recipient..</param> /// <param name="iban">The IBAN of the recipient. (required).</param> /// <param name="purpose">The purpose of the payment. (required).</param> /// <param name="recipient">Name of the recipient. (required).</param> public Payment(MoneyAmount amount = default, string bic = default, string iban = default, string purpose = default, string recipient = default) { this.Amount = amount ?? throw new InvalidDataException("amount is a required property for Payment and cannot be null"); this.Iban = iban ?? throw new InvalidDataException("iban is a required property for Payment and cannot be null"); this.Purpose = purpose ?? throw new InvalidDataException("purpose is a required property for Payment and cannot be null"); this.Recipient = recipient ?? throw new InvalidDataException("recipient is a required property for Payment and cannot be null"); this.Bic = bic; }
/// <summary> /// Initializes a new instance of the <see cref="PaymentReceipt" /> class. /// </summary> /// <param name="id">ID of the created payment. (required).</param> /// <param name="reference">The payment end-to-end reference. (required).</param> /// <param name="submittedAt">The time at which the payment was submitted to the payment provider. (required).</param> /// <param name="amount">amount (required).</param> /// <param name="bic">The BIC of the recipient..</param> /// <param name="iban">The IBAN of the recipient. (required).</param> /// <param name="purpose">The purpose of the payment. (required).</param> /// <param name="recipient">Name of the recipient. (required).</param> public PaymentReceipt(Guid id = default, string reference = default, string submittedAt = default, MoneyAmount amount = default, string bic = default, string iban = default, string purpose = default, string recipient = default) { // to ensure "id" is required (not null) if (id == null) { throw new InvalidDataException("id is a required property for PaymentReceipt and cannot be null"); } this.Id = id; this.Reference = reference ?? throw new InvalidDataException("reference is a required property for PaymentReceipt and cannot be null"); this.SubmittedAt = submittedAt ?? throw new InvalidDataException("submittedAt is a required property for PaymentReceipt and cannot be null"); this.Amount = amount ?? throw new InvalidDataException("amount is a required property for PaymentReceipt and cannot be null"); this.Iban = iban ?? throw new InvalidDataException("iban is a required property for PaymentReceipt and cannot be null"); this.Purpose = purpose ?? throw new InvalidDataException("purpose is a required property for PaymentReceipt and cannot be null"); this.Recipient = recipient ?? throw new InvalidDataException("recipient is a required property for PaymentReceipt and cannot be null"); this.Bic = bic; }