Esempio n. 1
0
        private void UpdateMerchantOrderId(ulong merchantId, string orderId, string merchantOrderId)
        {
            Console.WriteLine("=================================================================");
            Console.WriteLine("Updating Merchant Order ID to {0}", merchantOrderId);
            Console.WriteLine("=================================================================");

            var req = new OrdersUpdateMerchantOrderIdRequest();

            req.OperationId     = NewOperationId();
            req.MerchantOrderId = merchantOrderId;
            var resp = service.Orders.Updatemerchantorderid(req, merchantId, orderId).Execute();

            Console.WriteLine("Finished with status {0}.", resp.ExecutionStatus);
            Console.WriteLine();
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts.
        /// Documentation https://developers.google.com/shoppingcontent/v2sandbox/reference/orders/updatemerchantorderid
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated ShoppingContent service.</param>
        /// <param name="merchantId">The ID of the managing account.</param>
        /// <param name="orderId">The ID of the order.</param>
        /// <param name="body">A valid ShoppingContent v2sandbox body.</param>
        /// <returns>OrdersUpdateMerchantOrderIdResponseResponse</returns>
        public static OrdersUpdateMerchantOrderIdResponse Updatemerchantorderid(ShoppingContentService service, string merchantId, string orderId, OrdersUpdateMerchantOrderIdRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (merchantId == null)
                {
                    throw new ArgumentNullException(merchantId);
                }
                if (orderId == null)
                {
                    throw new ArgumentNullException(orderId);
                }

                // Make the request.
                return(service.Orders.Updatemerchantorderid(body, merchantId, orderId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Orders.Updatemerchantorderid failed.", ex);
            }
        }