2
0

⬆️ Upgrade dependencies

This commit is contained in:
Baptiste Arnaud
2023-05-25 17:24:39 +02:00
parent 16f3ad3a19
commit 55bbf0e593
24 changed files with 2139 additions and 2692 deletions

View File

@@ -40,9 +40,10 @@ const createStripePaymentIntent =
: stripeKeys.live.secretKey,
{ apiVersion: '2022-11-15' }
)
const amount =
const amount = Math.round(
Number(parseVariables(variables)(options.amount)) *
(isZeroDecimalCurrency(options.currency) ? 1 : 100)
(isZeroDecimalCurrency(options.currency) ? 1 : 100)
)
if (isNaN(amount))
throw new TRPCError({
code: 'BAD_REQUEST',

View File

@@ -61,11 +61,6 @@ const evaluateSetVariableExpression =
const evaluating = parseVariables(variables, { fieldToParse: 'id' })(
str.includes('return ') ? str : `return ${str}`
)
console.log(
variables.map((v) => v.id),
...variables.map((v) => parseGuessedValueType(v.value)),
evaluating
)
try {
const func = Function(...variables.map((v) => v.id), evaluating)
return func(...variables.map((v) => parseGuessedValueType(v.value)))