public IShopifyCredentials RetrieveShopifyCredentials()
        {
            var connection = Retrieve();

            var accessToken =
                connection.ShopifyAccessToken.IsNullOrEmpty()
                    ? "" : _cryptoService.Decrypt(connection.ShopifyAccessToken);

            var apiKey =
                connection.ShopifyApiKey.IsNullOrEmpty()
                    ? "" : _cryptoService.Decrypt(connection.ShopifyApiKey);

            var apiPassword =
                connection.ShopifyApiPassword.IsNullOrEmpty()
                    ? "" : _cryptoService.Decrypt(connection.ShopifyApiPassword);

            var domain = new ShopDomain(connection.ShopifyDomain);

            if (accessToken.IsNullOrEmpty())
            {
                return(null);
            }
            else
            {
                return(new OAuthAccessToken(connection.ShopifyDomain, accessToken));
            }
        }
Beispiel #2
0
        public static IServiceFacade GetServiceFacade()
        {
            var uoW        = new MockUnitOfWork(new MockContext());
            var cartDomain = new ShoppingBagDomain(uoW, new NullLogger <ShoppingBagDomain>());
            var shopDomain = new ShopDomain(cartDomain, uoW, new NullLogger <ShopDomain>());

            return(new ServiceFacadeProxy
                   (
                       new ServiceFacade(
                           new DomainFacadeTransactionProxy(
                               new DomainLayerFacade(
                                   new UserDomain(NullLogger <UserDomain> .Instance, uoW, shopDomain),
                                   new DomainLayerFacadeVerifier(NullLogger <DomainLayerFacadeVerifier> .Instance, uoW, shopDomain),
                                   NullLogger <DomainLayerFacade> .Instance,
                                   new DefaultExternalServicesManager(),
                                   uoW
                                   ),
                               new NullLogger <DomainFacadeTransactionProxy>(),
                               uoW,
                               new DefaultExternalServicesManager()
                               ),
                           NullLogger <ServiceFacade> .Instance
                           ),
                       new SessionManager(NullLogger <SessionManager> .Instance),
                       NullLogger <ServiceFacadeProxy> .Instance
                   ));
        }
Beispiel #3
0
 public ApiKeyAndSecret(string apiKey, string apiSecret, ShopDomain domain)
 {
     ApiKey    = apiKey;
     ApiSecret = apiSecret;
     Domain    = domain;
 }
Beispiel #4
0
 public GuestUser(Guid guid, IUnitOfWork unitOfWork, ShopDomain shopDomain)
 {
     Guid        = guid;
     _unitOfWork = unitOfWork;
     _shopDomain = shopDomain;
 }
Beispiel #5
0
 public AdminUser(BaseUser baseUser, IUnitOfWork unitOfWork, ShopDomain shopDomain) : base(baseUser, unitOfWork, shopDomain)
 {
 }
 public OAuthAccessToken(string domain, string accessToken)
 {
     Domain      = new ShopDomain(domain);
     AccessToken = accessToken;
 }
Beispiel #7
0
 public ShopController(ShopDomain domain)
 {
     this.domain = domain;
 }
Beispiel #8
0
        // Functions for translating...
        public PrivateAppCredentials ToPrivateAppCredentials()
        {
            var domain = new ShopDomain(PrivateAppDomain);

            return(new PrivateAppCredentials(ApiKey, ApiPassword, domain));
        }
Beispiel #9
0
 public PrivateAppCredentials(string apiKey, string apiPassword, ShopDomain domain)
 {
     ApiKey      = apiKey;
     ApiPassword = apiPassword;
     Domain      = domain;
 }