Esempio n. 1
0
        public TusLibrosRestAPI(IAuthenticator authenticator, IMerchantAdapter merchantAdapter, IClock internalClock, Dictionary <object, decimal> pricelist, List <object> catalog, Dictionary <string, List <object> > balanceSheet)
        {
            _authenticator   = authenticator ?? throw new ArgumentException(AUTHENTICATOR_IS_NULL_ERROR);
            _merchantAdapter = merchantAdapter ?? throw new ArgumentException(Cashier.MERCHANT_ADAPTER_IS_NULL_ERROR);
            _internalClock   = internalClock ?? throw new ArgumentException(CLOCK_IS_INVALID_ERROR);
            _pricelist       = pricelist ?? throw new ArgumentException(Cashier.PRICELIST_IS_NULL_ERROR);
            _catalog         = catalog ?? throw new ArgumentException(Cart.CATALOG_IS_NULL_ERROR);
            _balanceSheet    = balanceSheet ?? throw new ArgumentException(BALANCE_IS_NULL_ERROR);

            _carts = new Dictionary <string, Session>();
        }
Esempio n. 2
0
        public Cashier(Dictionary <object, decimal> priceList, IMerchantAdapter merchantAdapter)
        {
            _priceList = priceList ?? throw new ArgumentException(PRICELIST_IS_NULL_ERROR);
            if (_priceList.Count < 1)
            {
                throw new ArgumentException(PRICELIST_IS_EMPTY_ERROR);
            }

            _merchantAdapter = merchantAdapter ?? throw new ArgumentException(MERCHANT_ADAPTER_IS_NULL_ERROR);
            _daybook         = new List <object>();
        }
Esempio n. 3
0
 public TusLibrosRestAPIStubBuilder CommunicatesWith(IMerchantAdapter merchantAdapter)
 {
     _merchantAdapter = merchantAdapter;
     return(this);
 }