/// <summary> /// /// <example> /// <code> /// var result = CheckoutFactory.ProcessDigitalWallet(handler : handler, digitalWallet : digitalWallet, checkoutId : checkoutId, digitalWalletType : digitalWalletType, responseFields : responseFields, expectedCode: expectedCode, successCode: successCode); /// var optionalCasting = ConvertClass<Checkout/>(result); /// return optionalCasting; /// </code> /// </example> /// </summary> public static Mozu.Api.Contracts.CommerceRuntime.Checkouts.Checkout ProcessDigitalWallet(ServiceClientMessageHandler handler, Mozu.Api.Contracts.CommerceRuntime.Orders.DigitalWallet digitalWallet, string checkoutId, string digitalWalletType, 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.CheckoutClient.ProcessDigitalWalletClient( digitalWallet: digitalWallet, checkoutId: checkoutId, digitalWalletType: digitalWalletType, responseFields: responseFields); try { apiClient.WithContext(handler.ApiContext).ExecuteAsync(default(CancellationToken)).Wait(); } 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); }
/// <summary> /// /// </summary> /// <param name="digitalWalletType">The type of digital wallet to be processed.</param> /// <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="digitalWallet">The details of the digitial wallet.</param> /// <returns> /// <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.CommerceRuntime.Orders.Order"/>} /// </returns> /// <example> /// <code> /// var mozuClient=ProcessDigitalWallet( digitalWallet, orderId, digitalWalletType, responseFields); /// var orderClient = mozuClient.WithBaseAddress(url).Execute().Result(); /// </code> /// </example> public static MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> ProcessDigitalWalletClient(Mozu.Api.Contracts.CommerceRuntime.Orders.DigitalWallet digitalWallet, string orderId, string digitalWalletType, string responseFields = null) { var url = Mozu.Api.Urls.Commerce.OrderUrl.ProcessDigitalWalletUrl(orderId, digitalWalletType, responseFields); const string verb = "PUT"; var mozuClient = new MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order>() .WithVerb(verb).WithResourceUrl(url) .WithBody <Mozu.Api.Contracts.CommerceRuntime.Orders.DigitalWallet>(digitalWallet); return(mozuClient); }
/// <summary> /// /// </summary> /// <param name="checkoutId">The unique identifier of the checkout.</param> /// <param name="digitalWalletType">The type of digital wallet.</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="digitalWallet">The digital wallet object.</param> /// <returns> /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Checkouts.Checkout"/> /// </returns> /// <example> /// <code> /// var checkout = new Checkout(); /// var checkout = await checkout.ProcessDigitalWalletAsync( digitalWallet, checkoutId, digitalWalletType, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Checkouts.Checkout> ProcessDigitalWalletAsync(Mozu.Api.Contracts.CommerceRuntime.Orders.DigitalWallet digitalWallet, string checkoutId, string digitalWalletType, string responseFields = null, CancellationToken ct = default(CancellationToken)) { MozuClient <Mozu.Api.Contracts.CommerceRuntime.Checkouts.Checkout> response; var client = Mozu.Api.Clients.Commerce.CheckoutClient.ProcessDigitalWalletClient(digitalWallet, checkoutId, digitalWalletType, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(ct).ConfigureAwait(false); return(await response.ResultAsync()); }
/// <summary> /// /// </summary> /// <param name="digitalWalletType"></param> /// <param name="orderId"></param> /// <param name="responseFields"></param> /// <param name="digitalWallet"></param> /// <returns> /// <see cref="Mozu.Api.Contracts.CommerceRuntime.Orders.Order"/> /// </returns> /// <example> /// <code> /// var order = new Order(); /// var order = await order.ProcessDigitalWalletAsync( digitalWallet, orderId, digitalWalletType, responseFields); /// </code> /// </example> public virtual async Task <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> ProcessDigitalWalletAsync(Mozu.Api.Contracts.CommerceRuntime.Orders.DigitalWallet digitalWallet, string orderId, string digitalWalletType, string responseFields = null) { MozuClient <Mozu.Api.Contracts.CommerceRuntime.Orders.Order> response; var client = Mozu.Api.Clients.Commerce.OrderClient.ProcessDigitalWalletClient(digitalWallet, orderId, digitalWalletType, responseFields); client.WithContext(_apiContext); response = await client.ExecuteAsync(); return(await response.ResultAsync()); }