// Acumatica Credentials
        //
        public AcumaticaCredentials RetrieveAcumaticaCredentials()
        {
            var context = Retrieve();

            var output = new AcumaticaCredentials();

            output.InstanceUrl = context.AcumaticaInstanceUrl;
            output.Branch      = context.AcumaticaBranch;
            output.CompanyName = context.AcumaticaCompanyName;

            output.Username =
                context.AcumaticaUsername.IsNullOrEmpty()
                    ? "" : _cryptoService.Decrypt(context.AcumaticaUsername);

            output.Password =
                context.AcumaticaPassword.IsNullOrEmpty()
                    ? "" : _cryptoService.Decrypt(context.AcumaticaPassword);

            if (output.Username.IsNullOrEmpty() && output.Password.IsNullOrEmpty())
            {
                return(null);
            }

            return(output);
        }
Beispiel #2
0
 public void BeginSession(
     string screenWebSerivceUrl,
     AcumaticaCredentials credentials)
 {
     _screen.CookieContainer = new System.Net.CookieContainer();
     _screen.Url             = screenWebSerivceUrl;
     _screen.Login(credentials.Username, credentials.Password);
 }
Beispiel #3
0
        public AcumaticaCredentials RetrieveAcumaticaCredentials()
        {
            var context = RetrieveRawContext();

            var output = new AcumaticaCredentials();

            output.InstanceUrl = context.AcumaticaInstanceUrl;
            output.Branch      = context.AcumaticaBranch;
            output.CompanyName = context.AcumaticaCompanyName;
            output.Username    = _cryptoService.Decrypt(context.AcumaticaUsername);
            output.Password    = _cryptoService.Decrypt(context.AcumaticaPassword);

            return(output);
        }
Beispiel #4
0
        public void PushAcumaticaPayout(
            AcumaticaCredentials acumaticaCredentials,
            string screenWebSerivceUrl,
            long shopifyPayoutId)
        {
            _acumaticaPayoutPushWorker
            .BeginSession(
                screenWebSerivceUrl,
                acumaticaCredentials);

            _acumaticaPayoutPushWorker
            .WritePayoutToAcumatica(shopifyPayoutId);

            _acumaticaPayoutPushWorker.EndSession();
        }
Beispiel #5
0
        public void PushAllAcumaticaPayouts(
            AcumaticaCredentials acumaticaCredentials,
            string screenWebSerivceUrl)
        {
            _acumaticaPayoutPushWorker
            .BeginSession(
                screenWebSerivceUrl,
                acumaticaCredentials);

            foreach (var payout in
                     _persistenceRepository.RetrieveNotYetUploadedPayouts())
            {
                _acumaticaPayoutPushWorker
                .WritePayoutToAcumatica(payout.ShopifyPayoutId);
            }

            _acumaticaPayoutPushWorker.EndSession();
        }