Esempio n. 1
0
        }                                     //Transaction reference number

        protected override void dataValidate()
        {
            //Amount validation
            ParamValidator.amountValidate("amount", amount);

            //Currency validation
            if (string.IsNullOrEmpty(currency))
            {
                throw new YuanpayException("currency is missing");
            }
            bool currencyFlag = CurrencyEnums.containValidate(currency);

            if (!currencyFlag)
            {
                throw new YuanpayException("data error: currency");
            }

            //Settlement Currency validation
            if (string.IsNullOrEmpty(settleCurrency))
            {
                throw new YuanpayException("settleCurrency is missing");
            }
            bool settleCurrencyFlag = SettleCurrencyEnums.containValidate(settleCurrency);

            if (!settleCurrencyFlag)
            {
                throw new YuanpayException("data error: settleCurrency");
            }

            //Reference validation
            if (string.IsNullOrEmpty(reference))
            {
                throw new YuanpayException("reference is missing");
            }
        }
Esempio n. 2
0
        public CurrencyEnums getCurrency()
        {
            // return Currency..valueOf(money.getCurrencyCode());
            CurrencyEnums getCurrencyCode = Currency.currencynames.Where(x => x.name == money.CurrencyCode).FirstOrDefault();

            return(getCurrencyCode);
        }