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> |
||
---|---|---|
.. | ||
.vscode | ||
assets | ||
src | ||
tests | ||
.dockerignore | ||
.eslintignore | ||
.eslintrc.json | ||
.nvmrc | ||
.parcelrc | ||
.swcrc | ||
babel.config.js | ||
docker-compose.yml | ||
Dockerfile | ||
Dockerfile.docs | ||
Dockerfile.pnpm | ||
gulpfile.mjs | ||
jest.config.ts | ||
package.json | ||
pkgconfig.json | ||
rome.json | ||
Server.code-workspace | ||
tsconfig.base.json | ||
tsconfig.json | ||
tsconfig.test.json | ||
tsconfig.typedef.json | ||
typedoc.json |