Skip to content

Commit 6594c56

Browse files
committed
🚸 (payment) Improve payment default currency be…
1 parent 51bf5b6 commit 6594c56

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Text } from '@chakra-ui/react'
22
import { useTranslate } from '@tolgee/react'
33
import { PaymentInputBlock } from '@typebot.io/schemas'
4+
import { defaultPaymentInputOptions } from '@typebot.io/schemas/features/blocks/inputs/payment/constants'
45

56
type Props = {
67
block: PaymentInputBlock
@@ -9,11 +10,7 @@ type Props = {
910
export const PaymentInputContent = ({ block }: Props) => {
1011
const { t } = useTranslate()
1112

12-
if (
13-
!block.options?.amount ||
14-
!block.options.credentialsId ||
15-
!block.options.currency
16-
)
13+
if (!block.options?.amount || !block.options.credentialsId)
1714
return (
1815
<Text color="gray.500">
1916
{t('blocks.inputs.payment.placeholder.label')}
@@ -22,7 +19,7 @@ export const PaymentInputContent = ({ block }: Props) => {
2219
return (
2320
<Text noOfLines={1} pr="6">
2421
{t('blocks.inputs.payment.collect.label')} {block.options.amount}{' '}
25-
{block.options.currency}
22+
{block.options.currency ?? defaultPaymentInputOptions.currency}
2623
</Text>
2724
)
2825
}

apps/builder/src/features/blocks/inputs/payment/components/StripeConfigModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export const StripeConfigModal = ({
163163
placeholder="sk_test_..."
164164
withVariableButton={false}
165165
debounceTimeout={0}
166+
type="password"
166167
/>
167168
</HStack>
168169
</Stack>
@@ -187,6 +188,7 @@ export const StripeConfigModal = ({
187188
placeholder="sk_live_..."
188189
withVariableButton={false}
189190
debounceTimeout={0}
191+
type="password"
190192
/>
191193
</FormControl>
192194
</HStack>

apps/builder/src/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"blocks.inputs.file.settings.skip.label": "Skip button label:",
144144
"blocks.inputs.fileUpload.blockCard.tooltip": "Upload Files",
145145
"blocks.inputs.number.settings.step.label": "Step:",
146-
"blocks.inputs.payment.collect.label": "Coletar",
146+
"blocks.inputs.payment.collect.label": "Collect",
147147
"blocks.inputs.payment.placeholder.label": "Configure...",
148148
"blocks.inputs.payment.settings.account.label": "Account:",
149149
"blocks.inputs.payment.settings.accountText.label": "{provider} account",

packages/bot-engine/blocks/inputs/payment/computePaymentInputRuntimeOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const createStripePaymentIntent =
7777
options.currency === 'EUR' ? 'fr-FR' : undefined,
7878
{
7979
style: 'currency',
80-
currency: options.currency,
80+
currency,
8181
}
8282
)
8383

0 commit comments

Comments
 (0)