Server/project/src
Refringe 8541e5f028 Refactor Currency Handling in PaymentService.payMoney() Method (!159)
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>
2023-10-24 09:27:46 +00:00
..
callbacks Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
context Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
controllers Fixes Insured items on secured containers (!158) 2023-10-23 16:45:40 +00:00
di Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
generators Adjsut 2 bot gen errors to be warnings 2023-10-23 19:19:05 +01:00
helpers Fixes Insured items on secured containers (!158) 2023-10-23 16:45:40 +00:00
ide Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
loaders Cleanup of async method names 2023-10-20 12:23:19 +01:00
models Get id if not found in profile 2023-10-19 21:44:10 +01:00
routers Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
servers Show sessionid/profile id when profile data is saved 2023-10-21 20:19:45 +01:00
services Refactor Currency Handling in PaymentService.payMoney() Method (!159) 2023-10-24 09:27:46 +00:00
utils Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
ErrorHandler.ts Fixes Insured items on secured containers (!158) 2023-10-23 16:45:40 +00:00
Program.ts Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
TYPES.ts Add Repo 2023-03-03 15:23:46 +00:00