예제 #1
0
        /// <summary>
        /// Create new SellerTransaction
        /// </summary>
        /// <param name="sellerTransaction">The SellerTransaction to be created.</param>
        /// <returns>Created SellerTransaction</returns>
        public async Task <Response <SellerTransaction> > CreateSellerTransactionAsync(SellerTransaction sellerTransaction)
        {
            sellerTransaction.Validate();

            if (sellerTransaction.HasErrors)
            {
                return(BuilderErrorResponse(sellerTransaction));
            }
            var builder = new UriBuilder("seller_transactions");

            return(await Client.PostRequestAsync(builder.GetUrl(), sellerTransaction));
        }
예제 #2
0
        /// <summary>
        /// Update existing Seller Transaction
        /// </summary>
        /// <param name="sellerTransaction">The Seller Transaction to be updated.</param>
        /// <returns>Updated SellerTransaction</returns>
        public async Task <Response <SellerTransaction> > UpdateSellerTransactionAsync(SellerTransaction sellerTransaction)
        {
            sellerTransaction.Validate();

            if (sellerTransaction.HasErrors)
            {
                return(BuilderErrorResponse(sellerTransaction));
            }
            var builder =
                new UriBuilder(
                    $"seller_transactions/{sellerTransaction.MoxiWorksTransactionId}");

            return(await Client.PutRequestAsync(builder.GetUrl(), sellerTransaction));
        }