private static IEnumerable <MiscellaneousCharge> GetMiscellaneousCharges(Hashtable properties, string propertyNamespace, string propertyName)
            {
                IEnumerable <MiscellaneousCharge> miscellaneousCharges = null;

                PaymentProperty[] miscellaneousChargesPropertyArray;
                if (PaymentProperty.GetPropertyValue(properties, propertyNamespace, propertyName, out miscellaneousChargesPropertyArray))
                {
                    if (miscellaneousChargesPropertyArray.Length > 0)
                    {
                        miscellaneousCharges = new List <MiscellaneousCharge>();
                        foreach (var miscellaneousChargesProperty in miscellaneousChargesPropertyArray)
                        {
                            PaymentProperty[] miscellaneousChargePropertyArray = miscellaneousChargesProperty.PropertyList;
                            if (miscellaneousChargePropertyArray != null)
                            {
                                Hashtable miscellaneousChargeProperties = PaymentProperty.ConvertToHashtable(miscellaneousChargePropertyArray);
                                var       miscellaneousCharge           = new MiscellaneousCharge();
                                miscellaneousCharge.ChargeType   = PaymentUtilities.GetPropertyStringValue(miscellaneousChargeProperties, GenericNamespace.MiscellaneousCharge, MiscellaneousChargeProperties.ChargeType);
                                miscellaneousCharge.ChargeAmount = PaymentUtilities.GetPropertyDecimalValue(miscellaneousChargeProperties, GenericNamespace.MiscellaneousCharge, MiscellaneousChargeProperties.ChargeAmount);
                                (miscellaneousCharges as List <MiscellaneousCharge>).Add(miscellaneousCharge);
                            }
                        }
                    }
                }

                return(miscellaneousCharges);
            }
Example #2
0
        private decimal GetOrderShippingCharge()
        {
            string shippingChargeCode = ApplicationSettings.Terminal.ShippingChargeCode;
            MiscellaneousCharge mc    = this.Transaction.MiscellaneousCharges.FirstOrDefault(
                m => string.Equals(m.ChargeCode, shippingChargeCode, StringComparison.Ordinal));

            return((mc != null) ? mc.Amount : 0m);
        }