Merge branch 'payment-fix' into 'dev'
fix: payment See merge request frontend/marketplace!173
This commit is contained in:
commit
8844273096
@ -50,6 +50,9 @@ const paymentMethods: PaymentMethod[] = [
|
||||
|
||||
type PaymentMethodType = (typeof paymentMethods)[number]["name"];
|
||||
|
||||
// Нужно, что бы избежать ошибок по типу (3 * 1.2 = 3.5999999999999996)
|
||||
const SAFE_VALUE = 0.0001;
|
||||
|
||||
export default function Payment() {
|
||||
const theme = useTheme();
|
||||
const upMd = useMediaQuery(theme.breakpoints.up("md"));
|
||||
@ -105,7 +108,7 @@ export default function Payment() {
|
||||
fromSquiz,
|
||||
body: {
|
||||
type: selectedPaymentMethod,
|
||||
amount: Math.trunc(Number(paymentValueField) * 100),
|
||||
amount: Math.trunc(Number(paymentValueField) * 100 + SAFE_VALUE),
|
||||
},
|
||||
paymentPurpose: notEnoughMoneyAmount ? "paycart" : "replenishwallet",
|
||||
});
|
||||
@ -284,7 +287,9 @@ export default function Payment() {
|
||||
mb: "28px",
|
||||
}}
|
||||
>
|
||||
{currencyFormatter.format(Math.trunc(paymentValue) / 100)}
|
||||
{currencyFormatter.format(
|
||||
Math.trunc(paymentValue + SAFE_VALUE) / 100
|
||||
)}
|
||||
</Typography>
|
||||
) : (
|
||||
<InputTextfield
|
||||
|
Loading…
Reference in New Issue
Block a user