diff --git a/apps/builder/src/features/blocks/inputs/payment/components/PaymentSettings.tsx b/apps/builder/src/features/blocks/inputs/payment/components/PaymentSettings.tsx index 1c4b0c56f9..a6d11e85fd 100644 --- a/apps/builder/src/features/blocks/inputs/payment/components/PaymentSettings.tsx +++ b/apps/builder/src/features/blocks/inputs/payment/components/PaymentSettings.tsx @@ -28,68 +28,74 @@ export const PaymentSettings = ({ options, onOptionsChange }: Props) => { const { workspace } = useWorkspace() const { isOpen, onOpen, onClose } = useDisclosure() - const handleProviderChange = (provider: PaymentProvider) => { + const updateProvider = (provider: PaymentProvider) => { onOptionsChange({ ...options, provider, }) } - const handleCredentialsSelect = (credentialsId?: string) => { + const updateCredentials = (credentialsId?: string) => { onOptionsChange({ ...options, credentialsId, }) } - const handleAmountChange = (amount?: string) => + const updateAmount = (amount?: string) => onOptionsChange({ ...options, amount, }) - const handleCurrencyChange = (e: ChangeEvent) => + const updateCurrency = (e: ChangeEvent) => onOptionsChange({ ...options, currency: e.target.value, }) - const handleNameChange = (name: string) => + const updateName = (name: string) => onOptionsChange({ ...options, additionalInformation: { ...options.additionalInformation, name }, }) - const handleEmailChange = (email: string) => + const updateEmail = (email: string) => onOptionsChange({ ...options, additionalInformation: { ...options.additionalInformation, email }, }) - const handlePhoneNumberChange = (phoneNumber: string) => + const updatePhoneNumber = (phoneNumber: string) => onOptionsChange({ ...options, additionalInformation: { ...options.additionalInformation, phoneNumber }, }) - const handleButtonLabelChange = (button: string) => + const updateButtonLabel = (button: string) => onOptionsChange({ ...options, labels: { ...options.labels, button }, }) - const handleSuccessLabelChange = (success: string) => + const updateSuccessLabel = (success: string) => onOptionsChange({ ...options, labels: { ...options.labels, success }, }) + const updateDescription = (description: string) => + onOptionsChange({ + ...options, + additionalInformation: { ...options.additionalInformation, description }, + }) + return ( Provider: @@ -101,7 +107,7 @@ export const PaymentSettings = ({ options, onOptionsChange }: Props) => { type="stripe" workspaceId={workspace.id} currentCredentialsId={options.credentialsId} - onCredentialsSelect={handleCredentialsSelect} + onCredentialsSelect={updateCredentials} onCreateNewClick={onOpen} /> )} @@ -109,7 +115,7 @@ export const PaymentSettings = ({ options, onOptionsChange }: Props) => { @@ -118,7 +124,7 @@ export const PaymentSettings = ({ options, onOptionsChange }: Props) => {