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;