Corrected ProcessBuyTradeRequestData transactionId to be Mongoid, updated associated code
Also moved TransactionId in `InsuranceRequestData` to be MongoId, updated associated code
This commit is contained in:
@@ -864,7 +864,7 @@ public class RagfairController(
|
||||
// Cleanup of cache now we've used the tax value from it
|
||||
ragfairTaxService.ClearStoredOfferTaxById(requestRootItemId);
|
||||
|
||||
var buyTradeRequest = CreateBuyTradeRequestObject(CurrencyType.RUB, tax.Value);
|
||||
var buyTradeRequest = CreateBuyTradeRequestObject(CurrencyType.RUB, tax.Value, pmcData.Id.Value);
|
||||
paymentService.PayMoney(pmcData, buyTradeRequest, sessionId, output);
|
||||
if (output.Warnings.Count > 0)
|
||||
{
|
||||
@@ -1069,7 +1069,7 @@ public class RagfairController(
|
||||
sellInOncePiece
|
||||
);
|
||||
|
||||
var request = CreateBuyTradeRequestObject(CurrencyType.RUB, tax);
|
||||
var request = CreateBuyTradeRequestObject(CurrencyType.RUB, tax, pmcData.Id.Value);
|
||||
paymentService.PayMoney(pmcData, request, sessionId, output);
|
||||
if (output.Warnings.Count > 0)
|
||||
{
|
||||
@@ -1088,12 +1088,13 @@ public class RagfairController(
|
||||
/// </summary>
|
||||
/// <param name="currency">What currency: RUB, EURO, USD</param>
|
||||
/// <param name="value">Amount of currency</param>
|
||||
/// <param name="pmcId">Players id</param>
|
||||
/// <returns>ProcessBuyTradeRequestData</returns>
|
||||
protected ProcessBuyTradeRequestData CreateBuyTradeRequestObject(CurrencyType currency, double value)
|
||||
protected ProcessBuyTradeRequestData CreateBuyTradeRequestObject(CurrencyType currency, double value, MongoId pmcId)
|
||||
{
|
||||
return new ProcessBuyTradeRequestData
|
||||
{
|
||||
TransactionId = "ragfair",
|
||||
TransactionId = pmcId,
|
||||
Action = "TradingConfirm",
|
||||
SchemeItems = [new IdWithCount { Id = currency.GetCurrencyTpl(), Count = Math.Round(value) }],
|
||||
Type = string.Empty,
|
||||
|
||||
@@ -87,10 +87,14 @@ public class TradeController(
|
||||
|
||||
foreach (var offer in request.Offers)
|
||||
{
|
||||
var fleaOffer = ragfairServer.GetOffer(offer.Id);
|
||||
var fleaOffer = ragfairServer.GetOffer(new MongoId(offer.Id));
|
||||
if (fleaOffer is null)
|
||||
{
|
||||
return httpResponseUtil.AppendErrorToOutput(output, $"Offer with ID {offer.Id} not found", BackendErrorCodes.OfferNotFound);
|
||||
return httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
$"Offer with ID: {offer.Id} not found",
|
||||
BackendErrorCodes.OfferNotFound
|
||||
);
|
||||
}
|
||||
|
||||
if (offer.Count == 0)
|
||||
@@ -156,7 +160,7 @@ public class TradeController(
|
||||
var buyData = new ProcessBuyTradeRequestData
|
||||
{
|
||||
Action = "TradingConfirm",
|
||||
Type = "buy_from_ragfair",
|
||||
Type = "buy_from_ragfair_trader",
|
||||
TransactionId = fleaOffer.User.Id,
|
||||
ItemId = fleaOffer.Root,
|
||||
Count = requestOffer.Count,
|
||||
@@ -188,8 +192,8 @@ public class TradeController(
|
||||
var buyData = new ProcessBuyTradeRequestData
|
||||
{
|
||||
Action = "TradingConfirm",
|
||||
Type = "buy_from_ragfair",
|
||||
TransactionId = "ragfair",
|
||||
Type = "buy_from_ragfair_pmc",
|
||||
TransactionId = fleaOffer.User.Id,
|
||||
ItemId = fleaOffer.Id, // Store ragfair offerId in buyRequestData.item_id
|
||||
Count = requestOffer.Count,
|
||||
SchemeId = 0,
|
||||
|
||||
Reference in New Issue
Block a user