/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (RequestHeader == null) { throw new ValidationException(ValidationRules.CannotBeNull, "RequestHeader"); } if (Recipient == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Recipient"); } if (RecipientBank == null) { throw new ValidationException(ValidationRules.CannotBeNull, "RecipientBank"); } if (Sender == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Sender"); } if (TransferData == null) { throw new ValidationException(ValidationRules.CannotBeNull, "TransferData"); } if (TppTransactionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "TppTransactionId"); } if (DeliveryMode == null) { throw new ValidationException(ValidationRules.CannotBeNull, "DeliveryMode"); } if (RequestHeader != null) { RequestHeader.Validate(); } if (Recipient != null) { Recipient.Validate(); } if (RecipientBank != null) { RecipientBank.Validate(); } if (Sender != null) { Sender.Validate(); } if (TransferData != null) { TransferData.Validate(); } if (TransferCharges != null) { if (TransferCharges.Length > 3) { throw new ValidationException(ValidationRules.MaxLength, "TransferCharges", 3); } } if (TppTransactionId != null) { if (TppTransactionId.Length > 64) { throw new ValidationException(ValidationRules.MaxLength, "TppTransactionId", 64); } } }
/// <summary> /// Initializes a new instance of the PaymentDomesticRequest class. /// </summary> /// <param name="tppTransactionId">ID transakcji nadany przez TPP / /// Transaction ID (TPP)</param> /// <param name="deliveryMode">Tryb pilności / Urgency mode. Possible /// values include: 'ExpressD0', 'StandardD1'</param> /// <param name="system">Droga jaką przelew ma być rozliczony / The way /// the transfer should be settled. Possible values include: 'Elixir', /// 'ExpressElixir', 'Sorbnet', 'BlueCash', 'Internal'</param> /// <param name="hold">Czy założyć blokadę (w przypadku np. zlecenia /// przelewu w dniu wolnym) / Indicates if payment should be /// holded</param> public PaymentDomesticRequest(RequestHeaderCallback requestHeader, RecipientPIS recipient, SenderPIS sender, TransferData transferData, string tppTransactionId, string deliveryMode, string system = default(string), bool?hold = default(bool?)) { RequestHeader = requestHeader; Recipient = recipient; Sender = sender; TransferData = transferData; TppTransactionId = tppTransactionId; DeliveryMode = deliveryMode; System = system; Hold = hold; CustomInit(); }