Exemplo n.º 1
0
        /// <summary>
        /// Validates this request.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Ensures that <see cref="ClientTransactionReference" /> and <see cref="PreapprovalCode" /> are not null, empty string or only whitespace.
        /// Also ensure no property is larger than it's maximum allowed length (see individual property notes for details).
        /// Also ensures all base properties are valid, see <see cref="RequestBase.Validate"/>.
        /// </para>
        /// <para>Does not validate the pre-approval code length or finance amounts, as rules for these are likely to vary over time. It is better to let the API respond with an
        /// error result than pre-validate these values.</para>
        /// </remarks>
        public override void Validate()
        {
            ClientTransactionReference.GuardNullOrWhiteSpace("request", nameof(ClientTransactionReference));
            ClientTransactionReference.GuardLength("request", nameof(ClientTransactionReference), 64);

            PreapprovalCode.GuardNullOrWhiteSpace("request", nameof(PreapprovalCode));

            base.Validate();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Validates this instance.
        /// </summary>
        /// <remarks>
        /// <para>Ensures <seealso cref="ClientTransactionReference"/> and <see cref="PurchaseReference"/> are not null, empty strings or contain only whitespace. Also ensures they are not longer than allowed.</para>
        /// <para>Also ensures all base properties are valid, see <see cref="RequestBase.Validate"/>.</para>
        /// </remarks>
        public override void Validate()
        {
            ClientTransactionReference.GuardNullOrWhiteSpace(nameof(ClientTransactionReference));
            ClientTransactionReference.GuardLength(nameof(ClientTransactionReference), 64);

            PurchaseReference.GuardNullOrWhiteSpace(nameof(PurchaseReference));
            PurchaseReference.GuardLength(nameof(PurchaseReference), 64);

            base.Validate();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Validates this instance.
        /// </summary>
        /// <remarks>
        /// <para>Ensures <seealso cref="ClientTransactionReference"/> and <see cref="ReceiptNumber"/> are not null, empty strings or contain only whitespace. Also ensures they are not longer than allowed.</para>
        /// <para>Also ensures all base properties are valid, see <see cref="RequestBase.Validate"/>.</para>
        /// </remarks>
        public override void Validate()
        {
            ClientTransactionReference.GuardNullOrWhiteSpace(nameof(ClientTransactionReference));
            ClientTransactionReference.GuardLength(nameof(ClientTransactionReference), 64);

            ReceiptNumber.GuardNullOrWhiteSpace(nameof(ReceiptNumber));
            ReceiptNumber.GuardLength(nameof(ReceiptNumber), 64);

            base.Validate();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Validates this instance.
        /// </summary>
        /// <remarks>
        /// <para>Ensures <seealso cref="ClientTransactionReference"/> and <see cref="AdjustmentSignature"/> are not null, empty strings or contain only whitespace. Also ensures they are not longer than allowed.</para>
        /// <para>Also ensures all base properties are valid, see <see cref="RequestBase.Validate"/>.</para>
        /// </remarks>
        public override void Validate()
        {
            ClientTransactionReference.GuardNullOrWhiteSpace(nameof(ClientTransactionReference));
            ClientTransactionReference.GuardLength(nameof(ClientTransactionReference), 64);

            AdjustmentSignature.GuardNullOrWhiteSpace(nameof(AdjustmentSignature));
            AdjustmentSignature.GuardLength(nameof(AdjustmentSignature), 200);

            base.Validate();
        }