Exemplo n.º 1
0
        public IAmazonService CreateService( string sellerId, string mwsAuthToken, AmazonMarketplace amazonMarketplace )
        {
            Condition.Requires( sellerId, "sellerId" ).IsNotNullOrWhiteSpace();
            Condition.Requires( mwsAuthToken, "mwsAuthToken" ).IsNotNullOrWhiteSpace();
            Condition.Requires( amazonMarketplace, "amazonMarketplace" ).IsNotNull();

            return new AmazonService( new AmazonCredentials( this._accessKeyId, this._secretAccessKeyId, sellerId, mwsAuthToken, amazonMarketplace ) );
        }
Exemplo n.º 2
0
        public void SubmitFeed()
        {
            var marketplace = new AmazonMarketplace( AmazonCountryCodesEnum.Us );
            var service = this.AmazonFactory.CreateService( this.Config.SellerId, this.Config.MwsAuthToken, marketplace );

            var itemsList = new List< AmazonInventoryItem >();
            for( var i = 0; i < 100; i++ )
            {
                itemsList.Add( new AmazonInventoryItem { Quantity = 12, Sku = "S&amp;C-WB-Alec-Gry-7" + i } );
            }

            service.UpdateInventory( itemsList );
        }
        public AmazonCredentials( string accessKeyId, string secretAccessKeyId, string sellerId, string mwsAuthToken, AmazonMarketplace amazonMarketplace )
        {
            Condition.Requires( accessKeyId, "accessKeyId" ).IsNotNullOrWhiteSpace();
            Condition.Requires( secretAccessKeyId, "secretAccessKeyId" ).IsNotNullOrWhiteSpace();
            Condition.Requires( sellerId, "sellerId" ).IsNotNullOrWhiteSpace();
            Condition.Requires( mwsAuthToken, "mwsAuthToken" ).IsNotNullOrWhiteSpace();
            Condition.Requires( amazonMarketplace, "amazonMarketplace" ).IsNotNull();

            this.AccessKeyId = accessKeyId;
            this.SecretAccessKeyId = secretAccessKeyId;
            this.SellerId = sellerId;
            this.AmazonMarketplace = amazonMarketplace;
            this.MwsAuthToken = mwsAuthToken;
        }