GenerateOrderGuidAsync
This commit is contained in:
parent
7683d63d90
commit
c56d9a7931
|
|
@ -1,5 +1,6 @@
|
||||||
using Nop.Core;
|
using Nop.Core;
|
||||||
using Nop.Core.Domain.Catalog;
|
using Nop.Core.Domain.Catalog;
|
||||||
|
using Nop.Core.Domain.Orders;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Dtos;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.Dtos;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||||
|
|
@ -45,6 +46,7 @@ public class AuctionService : IAuctionService
|
||||||
IOrderProcessingService orderProcessingService,
|
IOrderProcessingService orderProcessingService,
|
||||||
IShoppingCartService shoppingCartService,
|
IShoppingCartService shoppingCartService,
|
||||||
IStoreContext storeContext,
|
IStoreContext storeContext,
|
||||||
|
IPaymentService paymentService,
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
_ctx = ctx;
|
_ctx = ctx;
|
||||||
|
|
@ -215,16 +217,16 @@ public class AuctionService : IAuctionService
|
||||||
var currentCustomer = await _workContext.GetCurrentCustomerAsync();
|
var currentCustomer = await _workContext.GetCurrentCustomerAsync();
|
||||||
var product = await _productService.GetProductByIdAsync(auctionItem.ProductId);
|
var product = await _productService.GetProductByIdAsync(auctionItem.ProductId);
|
||||||
var currentStore = await _storeContext.GetCurrentStoreAsync();
|
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);
|
processPaymentRequest.CustomValues.Add("ProductToAuctionMappingId", auctionItem.Id);
|
||||||
|
|
||||||
product.DisableBuyButton = false;
|
product.DisableBuyButton = false;
|
||||||
|
|
||||||
var cartResult = await _shoppingCartService.AddToCartAsync(currentCustomer, product, ShoppingCartType.ShoppingCart, currentStore.Id);
|
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);
|
var placeOrderResult = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest);
|
||||||
|
|
||||||
if (!placeOrderResult.Success) return null;
|
if (!placeOrderResult.Success) return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue