From c56d9a793174770a2329fe13881538632081d899 Mon Sep 17 00:00:00 2001 From: Loretta Date: Thu, 28 Nov 2024 10:08:28 +0100 Subject: [PATCH] GenerateOrderGuidAsync --- .../Services/AuctionService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Nop.Plugin.Misc.AuctionPlugin/Services/AuctionService.cs b/Nop.Plugin.Misc.AuctionPlugin/Services/AuctionService.cs index d849fcd..5ea892f 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Services/AuctionService.cs +++ b/Nop.Plugin.Misc.AuctionPlugin/Services/AuctionService.cs @@ -1,5 +1,6 @@ using Nop.Core; using Nop.Core.Domain.Catalog; +using Nop.Core.Domain.Orders; using Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer; using Nop.Plugin.Misc.AuctionPlugin.Domains.Dtos; using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities; @@ -45,6 +46,7 @@ public class AuctionService : IAuctionService IOrderProcessingService orderProcessingService, IShoppingCartService shoppingCartService, IStoreContext storeContext, + IPaymentService paymentService, ILogger logger) { _ctx = ctx; @@ -215,16 +217,16 @@ public class AuctionService : IAuctionService var currentCustomer = await _workContext.GetCurrentCustomerAsync(); var product = await _productService.GetProductByIdAsync(auctionItem.ProductId); var currentStore = await _storeContext.GetCurrentStoreAsync(); + + //TODO: valszeg a GenerateOrderGuidAsync-ot kell használni, de nemtom egy példában láttam... - J. + await _paymentService.GenerateOrderGuidAsync(processPaymentRequest); + processPaymentRequest.CustomValues.Add("ProductToAuctionMappingId", auctionItem.Id); product.DisableBuyButton = false; var cartResult = await _shoppingCartService.AddToCartAsync(currentCustomer, product, ShoppingCartType.ShoppingCart, currentStore.Id); - - //TODO: valszeg a GenerateOrderGuidAsync-ot kell használni, de nemtom egy példában láttam... - J. - await _paymentService.GenerateOrderGuidAsync(processPaymentRequest); - var placeOrderResult = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest); if (!placeOrderResult.Success) return null;