Example #1
0
        /// <summary>
        /// Sets the fulfillment action to "Ship" or "PickUp". To ship an order or prepare it for in-store pickup, the order must have a customer name, the "Open" or "OpenAndProcessing" status. To ship the order, it must also have the full shipping address and shipping method. Shipping all packages or picking up all pickups for an order will complete a paid order.
        /// </summary>
        /// <param name="orderId">Unique identifier of the order.</param>
        /// <param name="responseFields">A list or array of fields returned for a call. These fields may be customized and may be used for various types of data calls in Mozu. For example, responseFields are returned for retrieving or updating attributes, carts, and messages in Mozu.</param>
        /// <param name="action">Properties of an action to perform when fulfilling an item in an order, whether through in-store pickup or direct shipping.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Orders.Order"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var fulfillmentaction = new FulfillmentAction();
        ///   var order = await fulfillmentaction.PerformFulfillmentActionAsync( action,  orderId,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> PerformFulfillmentActionAsync(Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction action, string orderId, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> response;
            var client = Mozu.Api.Clients.Commerce.Orders.FulfillmentActionClient.PerformFulfillmentActionClient(action, orderId, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync();

            return(await response.ResultAsync());
        }
Example #2
0
        public virtual Mozu.Api.Contracts.CommerceRuntime.Orders.Order ResendPackageFulfillmentEmail(Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction action, string orderId, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> response;
            var client = Mozu.Api.Clients.Commerce.Orders.FulfillmentActionClient.ResendPackageFulfillmentEmailClient(action, orderId, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
        /// <summary>
        /// orders-fulfillment Post ResendPackageFulfillmentEmail description DOCUMENT_HERE
        /// <example>
        ///  <code>
        /// var result = FulfillmentActionFactory.ResendPackageFulfillmentEmail(handler : handler,  action :  action,  orderId :  orderId,  responseFields :  responseFields,  expectedCode: expectedCode, successCode: successCode);
        /// var optionalCasting = ConvertClass<Order/>(result);
        /// return optionalCasting;
        ///  </code>
        /// </example>
        /// </summary>
        public static Mozu.Api.Contracts.CommerceRuntime.Orders.Order ResendPackageFulfillmentEmail(ServiceClientMessageHandler handler,
                                                                                                    Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction action, string orderId, string responseFields = null,
                                                                                                    HttpStatusCode expectedCode = HttpStatusCode.OK, HttpStatusCode successCode = HttpStatusCode.OK)
        {
            SetSdKparameters();
            var currentClassName  = System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.Name;
            var currentMethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            Debug.WriteLine(currentMethodName + '.' + currentMethodName);
            var apiClient = Mozu.Api.Clients.Commerce.Orders.FulfillmentActionClient.ResendPackageFulfillmentEmailClient(
                action:  action, orderId:  orderId, responseFields:  responseFields);

            try
            {
                apiClient.WithContext(handler.ApiContext).Execute();
            }
            catch (ApiException ex)
            {
                // Custom error handling for test cases can be placed here
                Exception customException = TestFailException.GetCustomTestException(ex, currentClassName, currentMethodName, expectedCode);
                if (customException != null)
                {
                    throw customException;
                }
                return(null);
            }
            return(ResponseMessageFactory.CheckResponseCodes(apiClient.HttpResponse.StatusCode, expectedCode, successCode)
                                         ? (apiClient.Result())
                                         : null);
        }
Example #4
0
        /// <summary>
        /// Resends an email with details about the package fulfillment to the shopper.
        /// </summary>
        /// <param name="orderId">Unique identifier of the order.</param>
        /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param>
        /// <param name="action">Properties of an action to perform when fulfilling an item in an order, whether through in-store pickup or direct shipping.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.CommerceRuntime.Orders.Order"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=ResendPackageFulfillmentEmail( action,  orderId,  responseFields);
        ///   var orderClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> ResendPackageFulfillmentEmailClient(Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction action, string orderId, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Commerce.Orders.FulfillmentActionUrl.ResendPackageFulfillmentEmailUrl(orderId, responseFields);
            const string verb       = "POST";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction>(action);

            return(mozuClient);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="orderId">Unique identifier of the order.</param>
        /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param>
        /// <param name="action">Properties of an action to perform when fulfilling an item in an order, whether through in-store pickup or direct shipping.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Orders.Order"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var fulfillmentaction = new FulfillmentAction();
        ///   var order = await fulfillmentaction.ResendPackageFulfillmentEmailAsync( action,  orderId,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> ResendPackageFulfillmentEmailAsync(Mozu.Api.Contracts.CommerceRuntime.Fulfillment.FulfillmentAction action, string orderId, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> response;
            var client = Mozu.Api.Clients.Commerce.Orders.FulfillmentActionClient.ResendPackageFulfillmentEmailClient(action, orderId, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync(ct).ConfigureAwait(false);

            return(await response.ResultAsync());
        }