8541e5f028
This commit includes a series of changes aimed at improving the logic and readability of the `payMoney` method in the PaymentService class. The method is pivotal for handling in-game payments, specifically in cases involving multiple types of currencies and barter trades. The changes resolve an issue that prevented barter payments that included both a currency and another item. ## Changes: - Replaced `barterPrice` variable with a `currencyAmounts` mapping that efficiently tracks each type of currency involved in the trade. - Updated how the `costOfPurchaseInCurrency` variable is calculated to factor in multiple currencies. - Introduced a new variable `totalCurrencyAmount` to sum up the total amount of all currencies, which is checked to determine whether any (non)currency payment is necessary. - Added some inline comments for readability. Resolves #176 Co-authored-by: Refringe <brownelltyler@gmail.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/159 Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com> Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com> |
||
---|---|---|
.. | ||
callbacks | ||
context | ||
controllers | ||
di | ||
generators | ||
helpers | ||
ide | ||
loaders | ||
models | ||
routers | ||
servers | ||
services | ||
utils | ||
ErrorHandler.ts | ||
Program.ts | ||
TYPES.ts |