private void SetupClientAndCart() { _cachedClient = new ShopifyClient(LoaderProvider.GetLoader(Credentials.AccessToken, Credentials.Domain)); #if UNITY_IOS _cachedCart = new CartController(_cachedClient.Cart(), _appleMerchantID); #else _cachedCart = new CartController(_cachedClient.Cart()); #endif _cachedCart.OnPurchaseStarted.AddListener(Shop.OnPurchaseStarted); _cachedCart.OnPurchaseCancelled.AddListener(Shop.OnPurchaseCancelled); _cachedCart.OnPurchaseComplete.AddListener(Shop.OnPurchaseCompleted); _cachedCart.OnPurchaseFailed.AddListener(Shop.OnPurchaseFailed); _cachedCart.OnCartItemsChange.AddListener(Shop.OnCartItemsChanged); _cachedCart.OnPurchaseFailed.AddListener(Shop.OnPurchaseFailed); _cachedCart.OnQuantityChange.AddListener(Shop.OnCartQuantityChanged); }
private void Initialize() { #if (SHOPIFY_TEST) ShopifyBuy.Reset(); #else Debug.Log("Warning: You are running tests without defining SHOPIFY_TEST"); #endif ShopifyBuy.Init(AccessToken, ShopDomain); Client = ShopifyBuy.Client(); CurrentCart = Client.Cart(CartName); CurrentCart.State = new CartState(Client); }