Compare commits

..

No commits in common. "354bdb65568468eea95822801b3896ed1dfcb12b" and "034181c702d947e9e7bfabefd2b53fec12e154a3" have entirely different histories.

1 changed files with 18 additions and 15 deletions

View File

@ -1,5 +1,4 @@
using AyCode.Core.Extensions; using Nop.Core;
using Nop.Core;
using Nop.Core.Caching; using Nop.Core.Caching;
using Nop.Core.Domain.Catalog; using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Customers; using Nop.Core.Domain.Customers;
@ -191,24 +190,28 @@ public class AuctionService : IAuctionService
try try
{ {
var processPaymentRequest = new ProcessPaymentRequest var processPaymentRequest = new ProcessPaymentRequest();
{ processPaymentRequest.CustomerId = auctionItem.WinnerCustomerId;
CustomerId = auctionItem.WinnerCustomerId,
OrderTotal = auctionItem.CurrentPrice,
OrderGuid = auctionItem.OrderGuid.IsNullOrEmpty() ? Guid.NewGuid() : auctionItem.OrderGuid.Value
};
processPaymentRequest.CustomValues.Add("ProductToAuctionMappingId", auctionItem.Id); processPaymentRequest.CustomValues.Add("ProductToAuctionMappingId", auctionItem.Id);
processPaymentRequest.OrderTotal = auctionItem.CurrentPrice;
//processPaymentRequest.OrderGuid = productToAuction.OrderGuid; //TODO: - J.
processPaymentRequest.OrderGuid = Guid.NewGuid();
var placeOrderResult = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest); var placeOrderResult = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest);
if (!placeOrderResult.Success) return null; if (placeOrderResult.Success)
{
//placeOrderResult.PlacedOrder //TODO:... - J.
//placeOrderResult.PlacedOrder //TODO:... - J. auctionItem.OrderId = placeOrderResult.PlacedOrder.Id;
auctionItem.OrderGuid = placeOrderResult.PlacedOrder.OrderGuid;
auctionItem.OrderId = placeOrderResult.PlacedOrder.Id; return placeOrderResult;
auctionItem.OrderGuid = placeOrderResult.PlacedOrder.OrderGuid; }
return placeOrderResult;
return null;
} }
catch (Exception ex) catch (Exception ex)
{ {