internal AutoSubstantiationType HydrateAutoSubstantiation(HpsAutoSubstantiation autoSubstantiation)
        {
            if (autoSubstantiation != null)
            {
                var autoElement = new AutoSubstantiationType();
                if (autoSubstantiation.MerchantVerificationValue != null)
                {
                    autoElement.MerchantVerificationValue = autoSubstantiation.MerchantVerificationValue;
                }
                autoElement.RealTimeSubstantiation = autoSubstantiation.RealTimeSubstantiation ? booleanType.Y : booleanType.N;

                string[] amountCount         = new string[] { "First", "Second", "Third", "Fourth" };
                HpsAdditionalAmount[] values = autoSubstantiation.AdditionalAmounts;
                for (int i = 0; i < values.Length; i++)
                {
                    HpsAdditionalAmount value = values[i];

                    AdditionalAmtType amount = new AdditionalAmtType {
                        Amt     = value.Amount,
                        AmtType = value.AmountType
                    };

                    var field = autoElement.GetType().GetField(amountCount[i] + "AdditionalAmtInfo");
                    field.SetValue(autoElement, amount);
                }

                return(autoElement);
            }
            return(null);
        }
 public CreditAuthBuilder WithAutoSubstantiation(HpsAutoSubstantiation autoSubstantiation)
 {
     this.autoSubstantiation = autoSubstantiation;
     return(this);
 }
 public CreditOfflineChargeBuilder WithAutoSubstantiation(HpsAutoSubstantiation autoSubstantiation)
 {
     this.autoSubstantiation = autoSubstantiation;
     return(this);
 }