2
0

🚸 (payment) Improve payment default currency be…

This commit is contained in:
Baptiste Arnaud
2024-04-11 11:03:02 +02:00
parent 51bf5b653c
commit 6594c56adf
4 changed files with 7 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { Text } from '@chakra-ui/react' import { Text } from '@chakra-ui/react'
import { useTranslate } from '@tolgee/react' import { useTranslate } from '@tolgee/react'
import { PaymentInputBlock } from '@typebot.io/schemas' import { PaymentInputBlock } from '@typebot.io/schemas'
import { defaultPaymentInputOptions } from '@typebot.io/schemas/features/blocks/inputs/payment/constants'
type Props = { type Props = {
block: PaymentInputBlock block: PaymentInputBlock
@@ -9,11 +10,7 @@ type Props = {
export const PaymentInputContent = ({ block }: Props) => { export const PaymentInputContent = ({ block }: Props) => {
const { t } = useTranslate() const { t } = useTranslate()
if ( if (!block.options?.amount || !block.options.credentialsId)
!block.options?.amount ||
!block.options.credentialsId ||
!block.options.currency
)
return ( return (
<Text color="gray.500"> <Text color="gray.500">
{t('blocks.inputs.payment.placeholder.label')} {t('blocks.inputs.payment.placeholder.label')}
@@ -22,7 +19,7 @@ export const PaymentInputContent = ({ block }: Props) => {
return ( return (
<Text noOfLines={1} pr="6"> <Text noOfLines={1} pr="6">
{t('blocks.inputs.payment.collect.label')} {block.options.amount}{' '} {t('blocks.inputs.payment.collect.label')} {block.options.amount}{' '}
{block.options.currency} {block.options.currency ?? defaultPaymentInputOptions.currency}
</Text> </Text>
) )
} }

View File

@@ -163,6 +163,7 @@ export const StripeConfigModal = ({
placeholder="sk_test_..." placeholder="sk_test_..."
withVariableButton={false} withVariableButton={false}
debounceTimeout={0} debounceTimeout={0}
type="password"
/> />
</HStack> </HStack>
</Stack> </Stack>
@@ -187,6 +188,7 @@ export const StripeConfigModal = ({
placeholder="sk_live_..." placeholder="sk_live_..."
withVariableButton={false} withVariableButton={false}
debounceTimeout={0} debounceTimeout={0}
type="password"
/> />
</FormControl> </FormControl>
</HStack> </HStack>

View File

@@ -143,7 +143,7 @@
"blocks.inputs.file.settings.skip.label": "Skip button label:", "blocks.inputs.file.settings.skip.label": "Skip button label:",
"blocks.inputs.fileUpload.blockCard.tooltip": "Upload Files", "blocks.inputs.fileUpload.blockCard.tooltip": "Upload Files",
"blocks.inputs.number.settings.step.label": "Step:", "blocks.inputs.number.settings.step.label": "Step:",
"blocks.inputs.payment.collect.label": "Coletar", "blocks.inputs.payment.collect.label": "Collect",
"blocks.inputs.payment.placeholder.label": "Configure...", "blocks.inputs.payment.placeholder.label": "Configure...",
"blocks.inputs.payment.settings.account.label": "Account:", "blocks.inputs.payment.settings.account.label": "Account:",
"blocks.inputs.payment.settings.accountText.label": "{provider} account", "blocks.inputs.payment.settings.accountText.label": "{provider} account",

View File

@@ -77,7 +77,7 @@ const createStripePaymentIntent =
options.currency === 'EUR' ? 'fr-FR' : undefined, options.currency === 'EUR' ? 'fr-FR' : undefined,
{ {
style: 'currency', style: 'currency',
currency: options.currency, currency,
} }
) )