GenerateOrderGuidAsync

This commit is contained in:
Loretta 2024-11-28 10:08:28 +01:00
parent 7683d63d90
commit c56d9a7931
1 changed files with 6 additions and 4 deletions

View File

@ -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;