🚸 (payment) Improve payment default currency be…
This commit is contained in:
@@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user