The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(billing): use Stripe AddressElement for billing address form (#44105)
Kanishk Dudejabe3737d9d028
diff --git a/apps/studio/components/interfaces/App/UpdateBillingAddressModal.tsx b/apps/studio/components/interfaces/App/UpdateBillingAddressModal.tsxindex ace56210779..bf55a3a2530 100644--- a/apps/studio/components/interfaces/App/UpdateBillingAddressModal.tsx+++ b/apps/studio/components/interfaces/App/UpdateBillingAddressModal.tsx@@ -1,7 +1,24 @@+import { Elements } from '@stripe/react-stripe-js'+import { loadStripe, StripeAddressElement, StripeElementsOptions } from '@stripe/stripe-js'import { PermissionAction } from '@supabase/shared-types/out/constants'import { useQueryClient } from '@tanstack/react-query'import { useFlag } from 'common'-import { useMemo, useState } from 'react'+import {+ getAddressElementAppearanceOptions,+ STRIPE_ELEMENT_FONTS,+} from 'components/interfaces/Billing/Payment/Payment.utils'+import { BillingCustomerDataForm } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm'+import { useBillingCustomerDataForm } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm'+import { useOrganizationCustomerProfileQuery } from 'data/organizations/organization-customer-profile-query'+import { useOrganizationCustomerProfileUpdateMutation } from 'data/organizations/organization-customer-profile-update-mutation'+import { useOrganizationTaxIdQuery } from 'data/organizations/organization-tax-id-query'+import { useOrganizationTaxIdUpdateMutation } from 'data/organizations/organization-tax-id-update-mutation'+import { invalidateOrganizationsQuery } from 'data/organizations/organizations-query'+import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'+import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'+import { IS_PLATFORM, STRIPE_PUBLIC_KEY } from 'lib/constants'+import { useTheme } from 'next-themes'+import { useEffect, useMemo, useRef, useState } from 'react'import { toast } from 'sonner'import {Button,@@ -16,26 +33,15 @@ import {} from 'ui'import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'-import {- BillingCustomerDataForm,- type BillingCustomerDataFormValues,-} from '@/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm'-import { resolveStoredTaxId } from '@/components/interfaces/Organization/BillingSettings/BillingCustomerData/TaxID.utils'-import { useBillingCustomerDataForm } from '@/components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm'-import { useOrganizationCustomerProfileQuery } from '@/data/organizations/organization-customer-profile-query'-import { useOrganizationCustomerProfileUpdateMutation } from '@/data/organizations/organization-customer-profile-update-mutation'-import { useOrganizationTaxIdQuery } from '@/data/organizations/organization-tax-id-query'-import { useOrganizationTaxIdUpdateMutation } from '@/data/organizations/organization-tax-id-update-mutation'-import { invalidateOrganizationsQuery } from '@/data/organizations/organizations-query'-import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'-import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'-import { IS_PLATFORM } from '@/lib/constants'+const stripePromise = loadStripe(STRIPE_PUBLIC_KEY)export function UpdateBillingAddressModal() {const queryClient = useQueryClient()+ const { resolvedTheme } = useTheme()const [dismissed, setDismissed] = useState(false)const [isSubmitting, setIsSubmitting] = useState(false)+ const addressElementRef = useRef<StripeAddressElement | null>(null)const showMissingAddressModal = useFlag('enableBillingAddressModal')const { data: org } = useSelectedOrganizationQuery()@@ -86,55 +92,92 @@ export function UpdateBillingAddressModal() {const open =shouldShow && !dismissed && (!canManageBillingAddress || (!profileError && !taxIdError))- const initialCustomerData = useMemo<Partial<BillingCustomerDataFormValues>>(- () => ({- city: customerProfile?.address?.city ?? undefined,- country: customerProfile?.address?.country,- line1: customerProfile?.address?.line1,- line2: customerProfile?.address?.line2 ?? undefined,- postal_code: customerProfile?.address?.postal_code ?? undefined,- state: customerProfile?.address?.state ?? undefined,- billing_name: customerProfile?.billing_name,- tax_id_type: taxId?.type,- tax_id_value: taxId?.value,- tax_id_name: taxId- ? (resolveStoredTaxId(taxId.type, taxId.country, customerProfile?.address?.country)?.name ??- '')- : '',- }),- [customerProfile, taxId]- )-- const { mutateAsync: updateCustomerProfile } = useOrganizationCustomerProfileUpdateMutation()- const { mutateAsync: updateTaxId } = useOrganizationTaxIdUpdateMutation()+ const { mutateAsync: updateCustomerProfile } = useOrganizationCustomerProfileUpdateMutation({+ onError: () => {},+ })+ const { mutateAsync: updateTaxId } = useOrganizationTaxIdUpdateMutation({ onError: () => {} })- const { form, handleSubmit, isDirty } = useBillingCustomerDataForm({- initialCustomerData,+ const {+ form,+ handleSubmit,+ isDirty,+ resetKey,+ onAddressChange,+ applyAddressElementValue,+ markCurrentValuesAsSaved,+ addressCountry,+ addressOptions,+ } = useBillingCustomerDataForm({+ customerProfile,+ taxId,onCustomerDataChange: async (data) => {if (!slug) returnsetIsSubmitting(true)try {- await updateCustomerProfile({- slug,- address: data.address,- billing_name: data.billing_name,- })-- await updateTaxId({ slug, taxId: data.tax_id })-- await invalidateOrganizationsQuery(queryClient)+ try {+ await updateCustomerProfile({+ slug,+ address: data.address,+ billing_name: data.billing_name,+ })+ setDismissed(true)+ await invalidateOrganizationsQuery(queryClient)+ } catch (error: any) {+ toast.error(`Failed to update billing address: ${error.message}`)+ throw error+ }++ try {+ await updateTaxId({ slug, taxId: data.tax_id })+ } catch (error: any) {+ toast.error(`Failed to update tax ID: ${error.message}`)+ throw error+ }toast.success('Successfully updated billing address')- setDismissed(true)- } catch (error: any) {- toast.error(`Failed to update billing address: ${error.message}`)} finally {setIsSubmitting(false)}},})+ useEffect(() => {+ addressElementRef.current = null+ }, [resetKey])++ const onFormSubmit = async (e: React.FormEvent) => {+ e.preventDefault()+ try {+ if (addressElementRef.current) {+ const addressResult = await addressElementRef.current.getValue()+ applyAddressElementValue(addressResult)+ }+ const result = await handleSubmit()+ if (result.status === 'error') {+ toast.error(result.message)+ return+ }+ markCurrentValuesAsSaved(+ result.submittedState.addressValue,+ result.submittedState.taxIdValues+ )+ } catch {+ // Save failure toasts are handled inside onCustomerDataChange.+ }+ }++ const stripeElementsOptions: StripeElementsOptions = useMemo(+ () =>+ ({+ mode: 'setup',+ currency: 'usd',+ appearance: getAddressElementAppearanceOptions(resolvedTheme),+ fonts: STRIPE_ELEMENT_FONTS,+ }) as any,+ [resolvedTheme]+ )+return (<Dialogopen={open}@@ -176,23 +219,34 @@ export function UpdateBillingAddressModal() {</div></DialogSection>) : (- <Form {...form}>- <form onSubmit={form.handleSubmit(handleSubmit)}>- <DialogSection className="max-h-[60vh] overflow-y-auto">- <BillingCustomerDataForm form={form} />- </DialogSection>- <DialogFooter>- <Button- type="primary"- htmlType="submit"- loading={isSubmitting}- disabled={!isDirty || isSubmitting}- >- Save address- </Button>- </DialogFooter>- </form>- </Form>+ <Elements stripe={stripePromise} options={stripeElementsOptions}>+ <Form {...form}>+ <form onSubmit={onFormSubmit}>+ <DialogSection className="max-h-[60vh] overflow-y-auto">+ <BillingCustomerDataForm+ form={form}+ addressOptions={addressOptions}+ resetKey={resetKey}+ onAddressChange={onAddressChange}+ onAddressReady={(element) => {+ addressElementRef.current = element+ }}+ addressCountry={addressCountry}+ />+ </DialogSection>+ <DialogFooter>+ <Button+ type="primary"+ htmlType="submit"+ loading={isSubmitting}+ disabled={!isDirty || isSubmitting}+ >+ Save address+ </Button>+ </DialogFooter>+ </form>+ </Form>+ </Elements>))}</DialogContent></Dialog>diff --git a/apps/studio/components/interfaces/Billing/Payment/Payment.utils.ts b/apps/studio/components/interfaces/Billing/Payment/Payment.utils.tsindex ff8b08bbc7d..82a66aa0d1b 100644--- a/apps/studio/components/interfaces/Billing/Payment/Payment.utils.ts+++ b/apps/studio/components/interfaces/Billing/Payment/Payment.utils.ts@@ -1,4 +1,21 @@-import type { Appearance } from '@stripe/stripe-js'+import type { Appearance, CustomFontSource } from '@stripe/stripe-js'+import { CUSTOM_FONT_BOOK_DATA_URL } from 'fonts/stripe-fonts'++/**+ * Custom font for Stripe Elements iframes.+ * Stripe renders inside an iframe that can't access the parent page's CSS variables or fonts,+ * so we pass the font explicitly (Stripe requires https:// or data:// sources).+ * Keep using the data URL in all environments for now, since the CDN-hosted font still has+ * CORS issues when Stripe loads it from inside its iframe.+ */+const fontSrc = `url(${CUSTOM_FONT_BOOK_DATA_URL})`++export const STRIPE_ELEMENT_FONTS: CustomFontSource[] = [+ {+ family: 'CustomFont',+ src: fontSrc,+ },+]export const getStripeElementsAppearanceOptions = (resolvedTheme: string | undefined@@ -11,8 +28,7 @@ export const getStripeElementsAppearanceOptions = (colorBackground: resolvedTheme?.includes('dark')? 'hsl(0deg 0% 14.1%)': 'hsl(0deg 0% 95.3%)',- fontFamily:- 'var(--font-custom, Circular, custom-font, Helvetica Neue, Helvetica, Arial, sans-serif)',+ fontFamily: 'CustomFont, Helvetica Neue, Helvetica, Arial, sans-serif',},rules: {'.TermsText': {@@ -37,3 +53,31 @@ export const getStripeElementsAppearanceOptions = (},}}++export const getAddressElementAppearanceOptions = (+ resolvedTheme: string | undefined+): Appearance => {+ const isDark = resolvedTheme?.includes('dark')++ return {+ labels: 'above' as const,+ theme: (isDark ? 'night' : 'flat') as 'night' | 'flat',+ variables: {+ fontSizeBase: '14px',+ spacingUnit: '7px',+ colorPrimary: isDark ? 'hsl(0deg 0% 32%)' : 'hsl(0deg 0% 55%)',+ colorBackground: isDark ? 'hsl(0deg 0% 14.1%)' : 'hsl(0deg 0% 95.3%)',+ borderRadius: '4px',+ fontFamily: 'CustomFont, Helvetica Neue, Helvetica, Arial, sans-serif',+ },+ rules: {+ '.Input': {+ boxShadow: isDark ? 'none' : 'inset 0 0 0 1px hsl(0deg 0% 80%)',+ height: '34px',+ lineHeight: '16px',+ padding: '8px 12px',+ borderWidth: '1px',+ },+ },+ }+}diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerData.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerData.tsxindex f86fe50419f..8e242070668 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerData.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerData.tsx@@ -1,36 +1,43 @@+import { Elements } from '@stripe/react-stripe-js'+import { loadStripe, StripeAddressElement, StripeElementsOptions } from '@stripe/stripe-js'import { PermissionAction } from '@supabase/shared-types/out/constants'import { useQueryClient } from '@tanstack/react-query'import { useParams } from 'common'-import { useMemo, useState } from 'react'-import { toast } from 'sonner'-import { Button, Card, CardFooter, Form_Shadcn_ as Form } from 'ui'-import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'-import {- BillingCustomerDataForm,- type BillingCustomerDataFormValues,-} from './BillingCustomerDataForm'-import { resolveStoredTaxId } from './TaxID.utils'-import { useBillingCustomerDataForm } from './useBillingCustomerDataForm'+ getAddressElementAppearanceOptions,+ STRIPE_ELEMENT_FONTS,+} from 'components/interfaces/Billing/Payment/Payment.utils'import {ScaffoldSection,ScaffoldSectionContent,ScaffoldSectionDetail,-} from '@/components/layouts/Scaffold'-import AlertError from '@/components/ui/AlertError'-import NoPermission from '@/components/ui/NoPermission'-import PartnerManagedResource from '@/components/ui/PartnerManagedResource'-import { organizationKeys } from '@/data/organizations/keys'-import { useOrganizationCustomerProfileQuery } from '@/data/organizations/organization-customer-profile-query'-import { useOrganizationCustomerProfileUpdateMutation } from '@/data/organizations/organization-customer-profile-update-mutation'-import { useOrganizationTaxIdQuery } from '@/data/organizations/organization-tax-id-query'-import { useOrganizationTaxIdUpdateMutation } from '@/data/organizations/organization-tax-id-update-mutation'-import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'-import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'+} from 'components/layouts/Scaffold'+import AlertError from 'components/ui/AlertError'+import NoPermission from 'components/ui/NoPermission'+import PartnerManagedResource from 'components/ui/PartnerManagedResource'+import { organizationKeys } from 'data/organizations/keys'+import { useOrganizationCustomerProfileQuery } from 'data/organizations/organization-customer-profile-query'+import { useOrganizationCustomerProfileUpdateMutation } from 'data/organizations/organization-customer-profile-update-mutation'+import { useOrganizationTaxIdQuery } from 'data/organizations/organization-tax-id-query'+import { useOrganizationTaxIdUpdateMutation } from 'data/organizations/organization-tax-id-update-mutation'+import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'+import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'+import { STRIPE_PUBLIC_KEY } from 'lib/constants'+import { useTheme } from 'next-themes'+import { useEffect, useMemo, useRef, useState } from 'react'+import { toast } from 'sonner'+import { Button, Card, CardFooter, Form_Shadcn_ as Form } from 'ui'+import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'++import { BillingCustomerDataForm } from './BillingCustomerDataForm'+import { useBillingCustomerDataForm } from './useBillingCustomerDataForm'++const stripePromise = loadStripe(STRIPE_PUBLIC_KEY)export const BillingCustomerData = () => {const { slug } = useParams()const queryClient = useQueryClient()+ const { resolvedTheme } = useTheme()const { data: selectedOrganization } = useSelectedOrganizationQuery()const { can: canReadBillingCustomerData, isSuccess: isPermissionsLoaded } =@@ -54,49 +61,56 @@ export const BillingCustomerData = () => {isSuccess: loadedTaxId,} = useOrganizationTaxIdQuery({ slug })- const initialCustomerData = useMemo<Partial<BillingCustomerDataFormValues>>(- () => ({- city: customerProfile?.address?.city ?? undefined,- country: customerProfile?.address?.country,- line1: customerProfile?.address?.line1,- line2: customerProfile?.address?.line2 ?? undefined,- postal_code: customerProfile?.address?.postal_code ?? undefined,- state: customerProfile?.address?.state ?? undefined,- billing_name: customerProfile?.billing_name,- tax_id_type: taxId?.type,- tax_id_value: taxId?.value,- tax_id_name: taxId- ? (resolveStoredTaxId(taxId.type, taxId.country, customerProfile?.address?.country)?.name ??- '')- : '',- }),- [customerProfile, taxId]- )-- const { mutateAsync: updateCustomerProfile } = useOrganizationCustomerProfileUpdateMutation()- const { mutateAsync: updateTaxId } = useOrganizationTaxIdUpdateMutation()+ const { mutateAsync: updateCustomerProfile } = useOrganizationCustomerProfileUpdateMutation({+ onError: () => {},+ })+ const { mutateAsync: updateTaxId } = useOrganizationTaxIdUpdateMutation({ onError: () => {} })const [isSubmitting, setIsSubmitting] = useState(false)+ const addressElementRef = useRef<StripeAddressElement | null>(null)- const { form, handleSubmit, handleReset, isDirty } = useBillingCustomerDataForm({- initialCustomerData,+ const {+ form,+ handleSubmit,+ handleReset,+ isDirty,+ resetKey,+ onAddressChange,+ applyAddressElementValue,+ markCurrentValuesAsSaved,+ addressCountry,+ addressOptions,+ } = useBillingCustomerDataForm({+ customerProfile,+ taxId,onCustomerDataChange: async (data) => {setIsSubmitting(true)try {- await updateCustomerProfile({- slug,- address: data.address,- billing_name: data.billing_name,- })+ try {+ await updateCustomerProfile({+ slug,+ address: data.address,+ billing_name: data.billing_name,+ })+ } catch (error) {+ toast.error(+ `Failed updating billing address: ${error instanceof Error ? error.message : 'Unknown error'}`+ )+ throw error+ }- await updateTaxId({ slug, taxId: data.tax_id })+ try {+ await updateTaxId({ slug, taxId: data.tax_id })+ } catch (error) {+ toast.error(+ `Failed updating tax ID: ${error instanceof Error ? error.message : 'Unknown error'}`+ )+ throw error+ }toast.success('Successfully updated billing data')- // Optimistically update organization_missing_tax_id in the cached organizations list- // so the TaxIdBanner hides immediately. The server responds 304 Not Modified for a- // while after the tax ID is saved, so invalidation/refetch won't work here.queryClient.setQueriesData<any[]>({ queryKey: organizationKeys.list(), exact: true },(prev) => {@@ -106,19 +120,52 @@ export const BillingCustomerData = () => {)})-- setIsSubmitting(false)} catch (error) {- toast.error(- `Failed updating billing data: ${error instanceof Error ? error.message : 'Unknown error'}`- )+ throw error+ } finally {setIsSubmitting(false)}},})+ useEffect(() => {+ addressElementRef.current = null+ }, [resetKey])++ const onFormSubmit = async (e: React.FormEvent) => {+ e.preventDefault()+ try {+ if (addressElementRef.current) {+ const addressResult = await addressElementRef.current.getValue()+ applyAddressElementValue(addressResult)+ }+ const result = await handleSubmit()+ if (result.status === 'error') {+ toast.error(result.message)+ return+ }+ markCurrentValuesAsSaved(+ result.submittedState.addressValue,+ result.submittedState.taxIdValues+ )+ } catch {+ // Save failure toasts are handled inside onCustomerDataChange.+ }+ }+const isSubmitDisabled = !isDirty || !canUpdateBillingCustomerData || isSubmitting+ const stripeElementsOptions: StripeElementsOptions = useMemo(+ () =>+ ({+ mode: 'setup',+ currency: 'usd',+ appearance: getAddressElementAppearanceOptions(resolvedTheme),+ fonts: STRIPE_ELEMENT_FONTS,+ }) as any,+ [resolvedTheme]+ )+return (<ScaffoldSection><ScaffoldSectionDetail>@@ -162,38 +209,47 @@ export const BillingCustomerData = () => {)}{isSuccess && loadedTaxId && (- <Card>- <Form {...form}>- <form onSubmit={form.handleSubmit(handleSubmit)}>- <BillingCustomerDataForm- className="p-8"- form={form}- disabled={!canUpdateBillingCustomerData}- />- <CardFooter className="border-t justify-end px-8">- {!canUpdateBillingCustomerData && (- <span className="text-sm text-foreground-lighter mr-auto">- You need additional permissions to manage this organization's billing- address- </span>- )}- <div className="flex items-center gap-2">- <Button type="default" onClick={handleReset} disabled={isSubmitDisabled}>- Cancel- </Button>- <Button- type="primary"- htmlType="submit"- disabled={isSubmitDisabled}- loading={isSubmitting}- >- Save- </Button>- </div>- </CardFooter>- </form>- </Form>- </Card>+ <Elements stripe={stripePromise} options={stripeElementsOptions}>+ <Card>+ <Form {...form}>+ <form onSubmit={onFormSubmit}>+ <BillingCustomerDataForm+ className="p-8"+ form={form}+ disabled={!canUpdateBillingCustomerData}+ addressOptions={addressOptions}+ resetKey={resetKey}+ onAddressChange={onAddressChange}+ onAddressReady={(element) => {+ addressElementRef.current = element+ }}+ addressCountry={addressCountry}+ />+ <CardFooter className="border-t justify-end px-8">+ {!canUpdateBillingCustomerData && (+ <span className="text-sm text-foreground-lighter mr-auto">+ You need additional permissions to manage this organization's billing+ address+ </span>+ )}+ <div className="flex items-center gap-2">+ <Button type="default" onClick={handleReset} disabled={isSubmitDisabled}>+ Cancel+ </Button>+ <Button+ type="primary"+ htmlType="submit"+ disabled={isSubmitDisabled}+ loading={isSubmitting}+ >+ Save+ </Button>+ </div>+ </CardFooter>+ </form>+ </Form>+ </Card>+ </Elements>)}</>)}diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm.tsxindex 6c7bdf13daa..ac9341ef29b 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm.tsx@@ -1,3 +1,9 @@+import { AddressElement } from '@stripe/react-stripe-js'+import type {+ StripeAddressElement,+ StripeAddressElementChangeEvent,+ StripeAddressElementOptions,+} from '@stripe/stripe-js'import { Check, ChevronsUpDown, Info, X } from 'lucide-react'import { useId, useMemo, useState } from 'react'import { UseFormReturn } from 'react-hook-form'@@ -24,47 +30,46 @@ import {import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'import { z } from 'zod'-import { COUNTRIES } from './BillingAddress.constants'import { TAX_IDS } from './TaxID.constants'interface BillingCustomerDataFormProps {- form: UseFormReturn<BillingCustomerDataFormValues>+ form: UseFormReturn<TaxIdFormValues>disabled?: booleanclassName?: string+ addressOptions: StripeAddressElementOptions+ resetKey: number+ onAddressChange: (evt: StripeAddressElementChangeEvent) => void+ onAddressReady?: (element: StripeAddressElement) => void+ addressCountry?: string}-// Define the expected form values structure and validation schema-export const BillingCustomerDataSchema = z.object({- billing_name: z.string().min(3, 'Name must be at least 3 letters long'),- line1: z.string().trim().min(3, 'Address line 1 is required'),- line2: z.string().optional(),- city: z.string().trim().min(2, 'City is required'),- state: z.string().trim(),- postal_code: z.string().trim().min(1, 'Postal code is required'),- country: z.string().trim().min(1, 'Country is required'),+export const TaxIdSchema = z.object({tax_id_type: z.string(),tax_id_value: z.string(),tax_id_name: z.string(),})-export type BillingCustomerDataFormValues = z.infer<typeof BillingCustomerDataSchema>+export type TaxIdFormValues = z.infer<typeof TaxIdSchema>export const BillingCustomerDataForm = ({form,disabled = false,className,+ addressOptions,+ resetKey,+ onAddressChange,+ onAddressReady,+ addressCountry,}: BillingCustomerDataFormProps) => {- const [showCountriesPopover, setShowCountriesPopover] = useState(false)const [showTaxIDsPopover, setShowTaxIDsPopover] = useState(false)- const countryListboxId = useId()const taxIdListboxId = useId()const onSelectTaxIdType = (name: string) => {const selectedTaxIdOption = TAX_IDS.find((option) => option.name === name)if (!selectedTaxIdOption) return- form.setValue('tax_id_type', selectedTaxIdOption.type)- form.setValue('tax_id_value', '')- form.setValue('tax_id_name', name)+ form.setValue('tax_id_type', selectedTaxIdOption.type, { shouldDirty: true })+ form.setValue('tax_id_value', '', { shouldDirty: true })+ form.setValue('tax_id_name', name, { shouldDirty: true })}const onRemoveTaxId = () => {@@ -73,178 +78,28 @@ export const BillingCustomerDataForm = ({form.setValue('tax_id_value', '', { shouldDirty: true })}- const { tax_id_name, country } = form.watch()+ const { tax_id_name } = form.watch()const selectedTaxId = TAX_IDS.find((option) => option.name === tax_id_name)const availableTaxIds = useMemo(() => {- return TAX_IDS.filter((taxId) => !country || taxId.countryIso2 === country).sort((a, b) =>- a.country.localeCompare(b.country)+ return TAX_IDS.filter((taxId) => !addressCountry || taxId.countryIso2 === addressCountry).sort(+ (a, b) => a.country.localeCompare(b.country))- }, [country])+ }, [addressCountry])return (<div className={cn('flex flex-col space-y-4', className)}>- <FormField- control={form.control}- name="billing_name"- render={({ field }) => (- <FormItemLayout hideMessage label="Name">- <FormControl>- <Input {...field} disabled={disabled} />- </FormControl>- <FormMessage />- </FormItemLayout>- )}- />-- <FormField- control={form.control}- name="line1"- render={({ field }) => (- <FormItemLayout hideMessage label="Address line 1">- <FormControl>- <Input {...field} placeholder="123 Main Street" disabled={disabled} />- </FormControl>- <FormMessage />- </FormItemLayout>- )}- />-- <FormField- control={form.control}- name="line2"- render={({ field }) => (- <FormItemLayout hideMessage label="Address line 2 (optional)">- <FormControl>- <Input- {...field}- placeholder="Apartment, suite, unit, building, floor, etc."- disabled={disabled}- />- </FormControl>- <FormMessage />- </FormItemLayout>- )}- />-- <div className="grid grid-cols-1 md:grid-cols-2 gap-4">- <FormField- control={form.control}- name="country"- render={({ field }) => (- <FormItemLayout hideMessage label="Country">- <Popover open={showCountriesPopover} onOpenChange={setShowCountriesPopover}>- <PopoverTrigger asChild>- <FormControl>- <Button- type="default"- role="combobox"- size="medium"- disabled={disabled}- aria-expanded={showCountriesPopover}- aria-controls={countryListboxId}- className={cn(- 'w-full justify-between h-[34px]',- !field.value && 'text-muted'- )}- iconRight={- <ChevronsUpDown- className="ml-2 h-4 w-4 shrink-0 opacity-50"- strokeWidth={1.5}- />- }- >- {field.value- ? COUNTRIES.find((country) => country.code === field.value)?.name ||- 'Select country'- : 'Select country'}- </Button>- </FormControl>- </PopoverTrigger>- <PopoverContent- id={countryListboxId}- sameWidthAsTrigger- className="p-0"- align="start"- >- <Command>- <CommandInput placeholder="Search country..." />- <CommandList>- <CommandEmpty>No country found.</CommandEmpty>- <CommandGroup>- {COUNTRIES.map((country) => (- <CommandItem- key={country.code}- value={country.name}- onSelect={() => {- form.setValue('country', country.code, {- shouldDirty: true,- shouldTouch: true,- shouldValidate: true,- })- setShowCountriesPopover(false)- }}- >- <Check- className={cn(- 'mr-2 h-4 w-4',- field.value === country.code ? 'opacity-100' : 'opacity-0'- )}- />- {country.name}- </CommandItem>- ))}- </CommandGroup>- </CommandList>- </Command>- </PopoverContent>- </Popover>- <FormMessage />- </FormItemLayout>- )}- />- <FormField- control={form.control}- name="postal_code"- render={({ field }) => (- <FormItemLayout hideMessage label="Postal code">- <FormControl>- <Input {...field} placeholder="12345" disabled={disabled} />- </FormControl>- <FormMessage />- </FormItemLayout>- )}- />- </div>-- <div className="grid grid-cols-1 md:grid-cols-2 gap-4">- <FormField- control={form.control}- name="city"- render={({ field }) => (- <FormItemLayout hideMessage label="City">- <FormControl>- <Input {...field} disabled={disabled} />- </FormControl>- <FormMessage />- </FormItemLayout>- )}- />- <FormField- control={form.control}- name="state"- render={({ field }) => (- <FormItemLayout hideMessage label="State / Province">- <FormControl>- <Input {...field} disabled={disabled} />- </FormControl>- <FormMessage />- </FormItemLayout>- )}+ <div className={cn('relative', disabled && 'opacity-50')}>+ <AddressElement+ key={`billing-address-${resetKey}`}+ options={addressOptions}+ onChange={onAddressChange}+ onReady={onAddressReady}/>+ {disabled && <div className="absolute inset-0 z-10 cursor-not-allowed" />}</div>- <div className="grid grid-cols-2 gap-x-2 w-full items-end">+ <div className={cn('grid grid-cols-2 gap-x-6 w-full items-end', disabled && 'opacity-50')}><FormFieldname="tax_id_name"control={form.control}@@ -348,7 +203,13 @@ export const BillingCustomerDataForm = ({)}/>- <Button type="text" className="px-1" icon={<X />} onClick={() => onRemoveTaxId()} />+ <Button+ type="text"+ className="px-1"+ icon={<X />}+ disabled={disabled}+ onClick={() => onRemoveTaxId()}+ /></div>)}</div>diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm.ts b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm.tsindex b2589963d0f..70eafdacbad 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm.ts+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm.ts@@ -1,132 +1,243 @@import { zodResolver } from '@hookform/resolvers/zod'-import { components } from 'api-types'-import { useEffect } from 'react'+import type {+ StripeAddressElement,+ StripeAddressElementChangeEvent,+ StripeAddressElementOptions,+} from '@stripe/stripe-js'+import type { CustomerAddress, CustomerTaxId } from 'data/organizations/types'+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useForm } from 'react-hook-form'-import { BillingCustomerDataFormValues, BillingCustomerDataSchema } from './BillingCustomerDataForm'+import { TaxIdFormValues, TaxIdSchema } from './BillingCustomerDataForm'import { TAX_IDS } from './TaxID.constants'-import { getEffectiveTaxCountry, sanitizeTaxIdValue } from './TaxID.utils'-import type { CustomerAddress } from '@/data/organizations/types'+import { getEffectiveTaxCountry, resolveStoredTaxId, sanitizeTaxIdValue } from './TaxID.utils'-export type FormCustomerData = {+type StripeAddressValue = StripeAddressElementChangeEvent['value']+type StripeAddressValidationState = 'unknown' | 'complete' | 'incomplete'+type StripeAddressElementValueResult = Awaited<ReturnType<StripeAddressElement['getValue']>>++interface UseBillingCustomerDataFormProps {+ customerProfile?: {+ address?: CustomerAddress | null+ billing_name?: string+ } | null+ taxId?: CustomerTaxId | null+ onCustomerDataChange: (data: BillingAddressPayload) => Promise<void>+}++export type BillingAddressPayload = {address: CustomerAddress | undefinedbilling_name: string- tax_id: components['schemas']['TaxIdResponse']['tax_id'] | null+ tax_id: CustomerTaxId | null}-interface UseBillingAddressFormProps {- initialCustomerData?: Partial<BillingCustomerDataFormValues> | null- onCustomerDataChange: (data: FormCustomerData) => void+type SubmittedBillingFormState = {+ addressValue: StripeAddressValue+ taxIdValues: TaxIdFormValues}+type BillingFormSubmitResult =+ | {+ status: 'error'+ message: string+ }+ | {+ status: 'success'+ submittedState: SubmittedBillingFormState+ }+export function useBillingCustomerDataForm({- initialCustomerData,+ customerProfile,+ taxId,onCustomerDataChange,-}: UseBillingAddressFormProps) {- const form = useForm<BillingCustomerDataFormValues>({- resolver: zodResolver(BillingCustomerDataSchema),- defaultValues: {- billing_name: initialCustomerData?.billing_name || '',- line1: initialCustomerData?.line1 || '',- line2: initialCustomerData?.line2 || '',- city: initialCustomerData?.city || '',- state: initialCustomerData?.state || '',- postal_code: initialCustomerData?.postal_code || '',- country: initialCustomerData?.country || '',- tax_id_type: initialCustomerData?.tax_id_type || '',- tax_id_value: initialCustomerData?.tax_id_value || '',- tax_id_name: initialCustomerData?.tax_id_name || '',- },+}: UseBillingCustomerDataFormProps) {+ const initialStripeAddressValue: StripeAddressValue = useMemo(+ () => ({+ name: customerProfile?.billing_name ?? '',+ address: {+ line1: customerProfile?.address?.line1 ?? '',+ line2: customerProfile?.address?.line2 ?? '',+ city: customerProfile?.address?.city ?? '',+ state: customerProfile?.address?.state ?? '',+ postal_code: customerProfile?.address?.postal_code ?? '',+ country: customerProfile?.address?.country ?? '',+ },+ }),+ [customerProfile]+ )++ const addressOptions: StripeAddressElementOptions = useMemo(+ () => ({+ mode: 'billing',+ fields: { phone: 'never' },+ autocomplete: {+ apiKey: process.env.NEXT_PUBLIC_GOOGLE_MAPS_KEY!,+ mode: 'google_maps_api' as const,+ },+ display: { name: 'full' as const },+ defaultValues: initialStripeAddressValue,+ }),+ [initialStripeAddressValue]+ )++ const initialTaxIdValues = useMemo(+ () => ({+ tax_id_type: taxId?.type || '',+ tax_id_value: taxId?.value || '',+ tax_id_name: taxId+ ? (resolveStoredTaxId(taxId.type, taxId.country, customerProfile?.address?.country)?.name ??+ '')+ : '',+ }),+ [customerProfile, taxId]+ )++ const form = useForm<TaxIdFormValues>({+ resolver: zodResolver(TaxIdSchema),+ defaultValues: initialTaxIdValues,})- // Update form when initialAddress changes+ const stripeAddressRef = useRef<StripeAddressValue>(initialStripeAddressValue)+ const savedStripeAddressRef = useRef<StripeAddressValue>(initialStripeAddressValue)+ const stripeAddressValidationRef = useRef<StripeAddressValidationState>('unknown')+ const savedTaxIdValuesRef = useRef<TaxIdFormValues>(initialTaxIdValues)+ const [isAddressDirty, setIsAddressDirty] = useState(false)+ const [addressCountry, setAddressCountry] = useState<string | undefined>(+ initialStripeAddressValue.address.country || undefined+ )+ const [resetKey, setResetKey] = useState(0)+useEffect(() => {- if (initialCustomerData) {- form.reset({- billing_name: initialCustomerData.billing_name || '',- line1: initialCustomerData.line1 || '',- line2: initialCustomerData.line2 || '',- city: initialCustomerData.city || '',- state: initialCustomerData.state || '',- postal_code: initialCustomerData.postal_code || '',- country: initialCustomerData.country || '',- tax_id_type: initialCustomerData?.tax_id_type || '',- tax_id_value: initialCustomerData?.tax_id_value || '',- tax_id_name: initialCustomerData?.tax_id_name || '',- })+ savedStripeAddressRef.current = initialStripeAddressValue+ savedTaxIdValuesRef.current = initialTaxIdValues+ form.reset(initialTaxIdValues)+ stripeAddressRef.current = initialStripeAddressValue+ stripeAddressValidationRef.current = 'unknown'+ setIsAddressDirty(false)+ setAddressCountry(initialStripeAddressValue.address.country || undefined)+ setResetKey((c) => c + 1)+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [initialStripeAddressValue, initialTaxIdValues])++ const onAddressChange = useCallback((evt: StripeAddressElementChangeEvent) => {+ stripeAddressRef.current = evt.value+ stripeAddressValidationRef.current = evt.complete ? 'complete' : 'incomplete'+ setAddressCountry(evt.value.address.country || undefined)+ setIsAddressDirty(!isAddressEqual(evt.value, savedStripeAddressRef.current))+ }, [])++ const applyAddressElementValue = useCallback((result: StripeAddressElementValueResult) => {+ stripeAddressRef.current = result.value+ stripeAddressValidationRef.current = result.complete ? 'complete' : 'incomplete'+ setAddressCountry(result.value.address.country || undefined)+ setIsAddressDirty(!isAddressEqual(result.value, savedStripeAddressRef.current))+ }, [])++ const isDirty = isAddressDirty || form.formState.isDirty++ const syncCurrentState = useCallback(+ (addressValue: StripeAddressValue, taxIdValues: TaxIdFormValues) => {+ form.reset(taxIdValues)+ stripeAddressRef.current = addressValue+ stripeAddressValidationRef.current = 'unknown'+ setIsAddressDirty(false)+ setAddressCountry(addressValue.address.country || undefined)+ },+ [form]+ )++ const handleSubmit = async (): Promise<BillingFormSubmitResult> => {+ const address = stripeAddressRef.current+ const addressWasEdited =+ isAddressDirty || !isAddressEqual(address, savedStripeAddressRef.current)++ if (!address.name?.trim()) {+ return { status: 'error', message: 'Full name is required.' }+ }+ if (!address.address.country?.trim()) {+ return { status: 'error', message: 'Country is required.' }+ }+ if (!address.address.line1?.trim()) {+ return { status: 'error', message: 'Address Line 1 is required.' }}- }, [initialCustomerData])-- const handleSubmit = async (values: BillingCustomerDataFormValues) => {- const trimmedValues = Object.entries(values).reduce((acc, [key, value]) => {- acc[key as keyof BillingCustomerDataFormValues] =- typeof value === 'string' ? value.trim() : value- return acc- }, {} as BillingCustomerDataFormValues)-- const addressPayload = !trimmedValues.line1 ? null : trimmedValues-- const selectedTaxId = TAX_IDS.find((option) => option.name === values.tax_id_name)-- onCustomerDataChange({- address: addressPayload- ? {- line1: trimmedValues.line1!,- line2: trimmedValues.line2,- city: trimmedValues.city,- state: trimmedValues.state,- postal_code: trimmedValues.postal_code,- country: trimmedValues.country!,- }- : undefined,- billing_name: trimmedValues.billing_name,+ if (addressWasEdited && stripeAddressValidationRef.current === 'incomplete') {+ return { status: 'error', message: 'Please enter a valid billing address.' }+ }++ const taxIdValues = form.getValues()+ const selectedTaxId = TAX_IDS.find((option) => option.name === taxIdValues.tax_id_name)++ const payload = {+ address: {+ line1: address.address.line1.trim(),+ line2: address.address.line2?.trim() || undefined,+ city: address.address.city.trim(),+ state: address.address.state?.trim() || undefined,+ postal_code: address.address.postal_code.trim(),+ country: address.address.country.trim(),+ },+ billing_name: address.name.trim(),tax_id:- selectedTaxId && values.tax_id_type?.length && values.tax_id_value?.length+ selectedTaxId && taxIdValues.tax_id_type?.length && taxIdValues.tax_id_value?.length? {- type: values.tax_id_type,+ type: taxIdValues.tax_id_type,value: sanitizeTaxIdValue({- value: values.tax_id_value,- name: form.getValues().tax_id_name,+ value: taxIdValues.tax_id_value,+ name: taxIdValues.tax_id_name,}),country: getEffectiveTaxCountry(selectedTaxId),}: null,- })+ }++ await onCustomerDataChange(payload)++ return {+ status: 'success',+ submittedState: { addressValue: address, taxIdValues },+ }+ }++ const markCurrentValuesAsSaved = (+ addressValue: StripeAddressValue,+ taxIdValues: TaxIdFormValues+ ) => {+ savedStripeAddressRef.current = addressValue+ savedTaxIdValuesRef.current = taxIdValues+ syncCurrentState(addressValue, taxIdValues)}const handleReset = () => {- if (initialCustomerData) {- form.reset({- billing_name: initialCustomerData.billing_name || '',- line1: initialCustomerData.line1 || '',- line2: initialCustomerData.line2 || '',- city: initialCustomerData.city || '',- state: initialCustomerData.state || '',- postal_code: initialCustomerData.postal_code || '',- country: initialCustomerData.country || '',- tax_id_type: initialCustomerData?.tax_id_type || '',- tax_id_value: initialCustomerData?.tax_id_value || '',- tax_id_name: initialCustomerData?.tax_id_name || '',- })- } else {- form.reset({- line1: '',- line2: '',- city: '',- state: '',- postal_code: '',- country: '',- tax_id_type: '',- tax_id_value: '',- tax_id_name: '',- })- }+ syncCurrentState(savedStripeAddressRef.current, savedTaxIdValuesRef.current)+ setResetKey((c) => c + 1)}return {form,handleSubmit,handleReset,- isDirty: form.formState.isDirty,+ isDirty,+ resetKey,+ onAddressChange,+ applyAddressElementValue,+ markCurrentValuesAsSaved,+ addressCountry,+ addressOptions,}}++function isAddressEqual(current: StripeAddressValue, original: StripeAddressValue): boolean {+ return (+ normalize(current.name) === normalize(original.name) &&+ normalize(current.address.line1) === normalize(original.address.line1) &&+ normalize(current.address.line2) === normalize(original.address.line2) &&+ normalize(current.address.city) === normalize(original.address.city) &&+ normalize(current.address.state) === normalize(original.address.state) &&+ normalize(current.address.postal_code) === normalize(original.address.postal_code) &&+ normalize(current.address.country) === normalize(original.address.country)+ )+}++function normalize(val: string | null | undefined): string {+ return (val ?? '').trim()+}diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingEmail.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingEmail.tsxindex a273ab78d7e..f991b5d46cc 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingEmail.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingEmail.tsx@@ -117,7 +117,7 @@ const BillingEmail = () => {<form id={FORM_ID} onSubmit={form.handleSubmit(onUpdateOrganizationEmail)}><FormPanelfooter={- <div className="flex py-4 px-card">+ <div className="flex py-4 px-8"><FormActionsform={FORM_ID}isSubmitting={isUpdating}@@ -133,7 +133,7 @@ const BillingEmail = () => {</div>}>- <FormSection>+ <FormSection className="!px-8"><FormSectionContent fullWidth loading={loadingBillingCustomer}><FormFieldcontrol={form.control}diff --git a/apps/studio/fonts/stripe-fonts.ts b/apps/studio/fonts/stripe-fonts.tsnew file mode 100644index 00000000000..4694b0d58c5--- /dev/null+++ b/apps/studio/fonts/stripe-fonts.ts@@ -0,0 +1,2 @@+export const CUSTOM_FONT_BOOK_DATA_URL =+ 'data:font/woff2;base64,d09GMgABAAAAAGGEAA8AAAABQ7AAAGEjAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGjYbgoZUHJwGBmAAiF4RCAqClFiBz18LhzIAATYCJAOOYAQgBZQLB5hHW3wccQPdtl21oJwnwO7Naj1nW8K2aUEPug0AfaeGWn0XBdwYp90OQpHi+8Ts//8/L0GZjHUJw15aS0EUVf9FCjKBavRbdN1G2KZaCy1UkewOpZ1exx3RZ3fWbd2JRibc7OzkQdyqVYKPUtFoQoX8vF4pV/Z0y8yRoj3zSNrZw4zuV/rO+/qcv/o5YOian9EvneoppJMUUucs+Sz1er/r/X03WZsq/qmJ3Q/aT8j/4aPuIhAHJpn3hV0ViIglMO2MQIoAfckOEWo7Qu0jO4MT5Ayxykpmalh6roC1LgNjl0GJaGPF+Zr458f+97P2uahKgyimkWSaNHQiRBJeLT6ilvL15/lt/rmP9NECIohIyZAJswOjppuFGFNnxiqUlU63/i7ata7rb7osXQmLKjdEc9b0etTREjyYRIwQokR0E99sRImSACG0EAKBQutAS7HWoSJyRu25Qs+qV05E237POaEq9vzs2XvwEQrnkFgKEWESp8M//x7ofUnCWvFCtacGJRqPaAb7Jo7lAwpDQsEwdE2zcXH+13nvpzgptYM5KMVlqcG57VJXbugIi0btk5+oAoDyZ22tbeVEERxWZfy+tX87PppAuOivo6NUNPDTAZxkuRdoFqjNUplQmTFlxpRpU6bNNWWuKQrmdo8hpaEIgsywaKiGlqSQ3Z8OViKBaGjAWQh4NML/umwuNyQ3UoIUL8rF0Ivxlf4a/7/XZu+MtPthRrI+UGoqeqAueb2kWXvPXhN9wuP23Poc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XcDcnYAAgAQdZF90yAQYCFBgASMBBtscGzTvylZ9ZSbdEgIEABQYAEnCQQYAKGug1xxGdMxPIVVB17Yu2QcgvP+YYiMaKOS0fPECAAMH/P3QrBBgIUJ1ZKivC8AjKYs9NwPWFDAqs4oj9S0lqppXrqxC57hF69BXRLjDwO1DhCTJuZigM+yTpyB0JH3Sgqgs4cODAgQMHrvOciw3SjUeUJMLlaU8tgWZY8OLy0jF1ZKDhT1AqqBlNQZ8wMaiBuTNxWEd1MF7EclGMs5zlxZRBD80ChiQ025+lhebs4ecvAWGPQBgRBA6MiB0QIEDYThA4CAKEEf4Og/EZ/rimj7yCyY9pWiW9l+FIrlAS/hqRFM2w/nG8IBqbmJo1hxzXpF8KeRtxGPhy5C/iOqg0/qAaUOL4JqpCG+N3SQ3xdsjAEZCB98HNPoQVgnufIBULIQ5CeIAQknwCwkJ4ZCHEspCVT6XRc63znUq8uqEqyXNniFE/TzUgrYGFkHC+6ZfwGRVeAnRngJ+cCVEN5GbAWAHODtUmRC3NMiW0cUkTKcpotuVA08BTK5efm4GBGEy7nsnBzR1LDi0bUAb6MFA0YNjbwY0+kPzmpjbhJWoZFexV16DgIu6AUg/9Ecwdjezu2DlbHNMsZ7NNz16+rJc6zEYUUqr+m65D1NmXiBF73UWi7heJFqrhjUXbgyIONvsow061phz2Kh0mdRVP+mDW4HpHk6az0ZeeQsbwcTmVJB2+7SqtXblKfpZWu4LJ2f5NPG05il5C/H+Ck/17CJh9cGISRcxFQUj+1A5yQXNdwlatBn6nYbtWxd3PbZ9uURbqDYjcGS582me3iw4ORHfu1ect8eN0gjI0u0ALM6+T9RcAGue2X/l3/kcWvsV6Xv4awl827YqWegJJB9HFmG1lzSQfy036eXWFWagHWdPTj+X2ub/HpIFFljrKe2OLmyCTn8uqlj6BG4DcvVtGXaBzbYkxNmlpA69kD8Kcbq0AAA=='diff --git a/apps/studio/public/fonts/CustomFont-Book.woff2 b/apps/studio/public/fonts/CustomFont-Book.woff2new file mode 100644index 00000000000..abd31f7ec27Binary files /dev/null and b/apps/studio/public/fonts/CustomFont-Book.woff2 differdiff --git a/apps/studio/tests/components/Billing/UpdateBillingAddressModal.test.tsx b/apps/studio/tests/components/Billing/UpdateBillingAddressModal.test.tsxindex 743e9829ff3..e63132af81c 100644--- a/apps/studio/tests/components/Billing/UpdateBillingAddressModal.test.tsx+++ b/apps/studio/tests/components/Billing/UpdateBillingAddressModal.test.tsx@@ -1,17 +1,168 @@+import type {+ StripeAddressElement,+ StripeAddressElementChangeEvent,+ StripeAddressElementOptions,+} from '@stripe/stripe-js'+import { PermissionAction } from '@supabase/shared-types/out/constants'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { UpdateBillingAddressModal } from 'components/interfaces/App/UpdateBillingAddressModal'+import { useEffect, type ReactNode } from 'react'import { createMockOrganization, render } from 'tests/helpers'import { beforeEach, describe, expect, it, vi } from 'vitest'+type MockAddressElementProps = {+ onChange?: (event: StripeAddressElementChangeEvent) => void+ onReady?: (element: StripeAddressElement) => void+ options?: StripeAddressElementOptions+}++const EMPTY_ADDRESS_VALUE: StripeAddressElementChangeEvent['value'] = {+ name: '',+ address: {+ line1: '',+ line2: '',+ city: '',+ state: '',+ postal_code: '',+ country: '',+ },+}++let currentAddressValue: StripeAddressElementChangeEvent['value'] = EMPTY_ADDRESS_VALUE+let currentAddressComplete = false++const emitAddressEvent = (+ props: MockAddressElementProps,+ event: Pick<StripeAddressElementChangeEvent, 'complete' | 'value'>+) => {+ currentAddressValue = event.value+ currentAddressComplete = event.complete+ props.onChange?.({+ elementType: 'address',+ elementMode: 'billing',+ empty: false,+ isNewAddress: false,+ ...event,+ })+}++vi.mock('@stripe/react-stripe-js', () => ({+ Elements: ({ children }: { children: ReactNode }) => <div>{children}</div>,+ AddressElement: (props: MockAddressElementProps) => {+ useEffect(() => {+ props.onReady?.({+ getValue: vi.fn(async () => ({+ complete: currentAddressComplete,+ isNewAddress: false,+ value: currentAddressValue,+ })),+ } as unknown as StripeAddressElement)+ }, [props])++ return (+ <div>+ <div data-testid="stripe-address-element" />+ <button+ type="button"+ onClick={() =>+ emitAddressEvent(props, {+ complete: true,+ value: {+ name: 'Updated Company',+ address: {+ line1: '500 Market St',+ line2: '',+ city: 'San Francisco',+ state: 'CA',+ postal_code: '94105',+ country: 'US',+ },+ },+ })+ }+ >+ Emit valid US address+ </button>+ <button+ type="button"+ onClick={() =>+ emitAddressEvent(props, {+ complete: false,+ value: {+ name: 'Updated Company',+ address: {+ line1: '500 Market St',+ line2: '',+ city: 'San Francisco',+ state: 'CA',+ postal_code: '',+ country: 'US',+ },+ },+ })+ }+ >+ Emit invalid address+ </button>+ <button+ type="button"+ onClick={() =>+ emitAddressEvent(props, {+ complete: true,+ value: {+ name: 'Updated GmbH',+ address: {+ line1: 'Stephansplatz 1',+ line2: '',+ city: 'Vienna',+ state: 'Vienna',+ postal_code: '1010',+ country: 'AT',+ },+ },+ })+ }+ >+ Emit valid AT address+ </button>+ <button+ type="button"+ onClick={() => {+ currentAddressValue = {+ name: 'Updated Company',+ address: {+ line1: '500 Market St',+ line2: '',+ city: '',+ state: 'CA',+ postal_code: '94105',+ country: 'US',+ },+ }+ currentAddressComplete = false+ }}+ >+ Make submit validation fail+ </button>+ </div>+ )+ },+ useElements: () => null,+ useStripe: () => null,+}))+vi.mock('@stripe/stripe-js', () => ({+ loadStripe: vi.fn(() => Promise.resolve(null)),+}))+vi.mock('lib/constants', async (importOriginal) => {- const original = (await importOriginal()) as any+ const original = (await importOriginal()) as typeof import('lib/constants')return { ...original, IS_PLATFORM: true }})const mockFlag = vi.fn(() => true)vi.mock('common', async (importOriginal) => {- const original = (await importOriginal()) as any+ const original = (await importOriginal()) as typeof import('common')return {...original,useFlag: (_name: string) => mockFlag(),@@ -19,7 +170,7 @@ vi.mock('common', async (importOriginal) => {}})-const mockOrg = vi.fn(() =>+const mockOrg = vi.fn<() => ReturnType<typeof createMockOrganization> | undefined>(() =>createMockOrganization({slug: 'test-org',organization_missing_address: true,@@ -30,13 +181,21 @@ vi.mock('hooks/misc/useSelectedOrganization', () => ({useSelectedOrganizationQuery: () => ({ data: mockOrg() }),}))+const mockCanRead = vi.fn(() => true)const mockCanWrite = vi.fn(() => true)-const mockPermissionsLoaded = vi.fn(() => true)+const mockBillingReadLoaded = vi.fn(() => true)+const mockBillingWriteLoaded = vi.fn(() => true)vi.mock('hooks/misc/useCheckPermissions', () => ({- useAsyncCheckPermissions: () => ({- can: mockCanWrite(),- isSuccess: mockPermissionsLoaded(),- }),+ useAsyncCheckPermissions: (action: PermissionAction) =>+ action === PermissionAction.BILLING_READ+ ? {+ can: mockCanRead(),+ isSuccess: mockBillingReadLoaded(),+ }+ : {+ can: mockCanWrite(),+ isSuccess: mockBillingWriteLoaded(),+ },}))const mockCustomerProfile = vi.fn(() => ({@@ -85,6 +244,8 @@ vi.mock('data/organizations/organizations-query', () => ({describe('UpdateBillingAddressModal', () => {beforeEach(() => {vi.clearAllMocks()+ currentAddressValue = EMPTY_ADDRESS_VALUE+ currentAddressComplete = falsemockFlag.mockReturnValue(true)mockOrg.mockReturnValue(createMockOrganization({@@ -94,8 +255,10 @@ describe('UpdateBillingAddressModal', () => {plan: { id: 'pro', name: 'Pro' },}))+ mockCanRead.mockReturnValue(true)mockCanWrite.mockReturnValue(true)- mockPermissionsLoaded.mockReturnValue(true)+ mockBillingReadLoaded.mockReturnValue(true)+ mockBillingWriteLoaded.mockReturnValue(true)mockProfileLoaded.mockReturnValue(true)mockTaxIdLoaded.mockReturnValue(true)mockCustomerProfile.mockReturnValue({@@ -146,14 +309,27 @@ describe('UpdateBillingAddressModal', () => {expect(screen.queryByText('Billing address required')).not.toBeInTheDocument()})- it('does not render when user lacks billing write permission', () => {+ it('renders an informational modal when user has read access but no write access', async () => {+ mockCanRead.mockReturnValue(true)+ mockCanWrite.mockReturnValue(false)+ render(<UpdateBillingAddressModal />)++ expect(await screen.findByText('Billing address required')).toBeInTheDocument()+ expect(+ screen.getByText(/please ask an organization administrator or owner/i)+ ).toBeInTheDocument()+ expect(screen.queryByRole('button', { name: 'Save address' })).not.toBeInTheDocument()+ })++ it('does not render when user lacks both billing read and write permission', () => {+ mockCanRead.mockReturnValue(false)mockCanWrite.mockReturnValue(false)render(<UpdateBillingAddressModal />)expect(screen.queryByText('Billing address required')).not.toBeInTheDocument()})it('does not render when no org is selected', () => {- mockOrg.mockReturnValue(undefined as any)+ mockOrg.mockReturnValue(undefined)render(<UpdateBillingAddressModal />)expect(screen.queryByText('Billing address required')).not.toBeInTheDocument()})@@ -175,4 +351,58 @@ describe('UpdateBillingAddressModal', () => {render(<UpdateBillingAddressModal />)expect(screen.queryByText('Save address')).not.toBeInTheDocument()})+ it('dismisses on close button click', async () => {+ mockCanRead.mockReturnValue(true)+ mockCanWrite.mockReturnValue(false)+ render(<UpdateBillingAddressModal />)+ expect(await screen.findByText('Billing address required')).toBeInTheDocument()++ const closeButton = screen.getByRole('button', { name: /close/i })+ await userEvent.click(closeButton)++ await waitFor(() => {+ expect(screen.queryByText('Billing address required')).not.toBeInTheDocument()+ })+ })++ it('enables submit after the address element reports a valid change', async () => {+ render(<UpdateBillingAddressModal />)++ expect(await screen.findByText('Billing address required')).toBeInTheDocument()++ expect(screen.getByRole('button', { name: 'Save address' })).toBeDisabled()++ await userEvent.click(screen.getByRole('button', { name: 'Emit valid US address' }))++ await waitFor(() => expect(screen.getByRole('button', { name: 'Save address' })).toBeEnabled())+ })++ it('filters tax ID options using the current address country', async () => {+ render(<UpdateBillingAddressModal />)++ expect(await screen.findByText('Billing address required')).toBeInTheDocument()++ await userEvent.click(screen.getByRole('button', { name: 'Emit valid AT address' }))+ await userEvent.click(screen.getByRole('combobox'))++ expect(await screen.findByText('Austria - AT VAT')).toBeInTheDocument()+ expect(screen.queryByText('United States - US EIN')).not.toBeInTheDocument()+ })++ it('uses getValue on submit to block saving when Stripe validation becomes incomplete', async () => {+ render(<UpdateBillingAddressModal />)++ expect(await screen.findByText('Billing address required')).toBeInTheDocument()++ await userEvent.click(screen.getByRole('button', { name: 'Emit valid US address' }))+ await waitFor(() => expect(screen.getByRole('button', { name: 'Save address' })).toBeEnabled())++ await userEvent.click(screen.getByRole('button', { name: 'Make submit validation fail' }))+ await userEvent.click(screen.getByRole('button', { name: 'Save address' }))++ await waitFor(() => {+ expect(mockUpdateCustomerProfile).not.toHaveBeenCalled()+ expect(mockUpdateTaxId).not.toHaveBeenCalled()+ })+ })})diff --git a/apps/studio/tests/components/Billing/useBillingCustomerDataForm.test.tsx b/apps/studio/tests/components/Billing/useBillingCustomerDataForm.test.tsxnew file mode 100644index 00000000000..b8678359b4d--- /dev/null+++ b/apps/studio/tests/components/Billing/useBillingCustomerDataForm.test.tsx@@ -0,0 +1,581 @@+import { act, renderHook, waitFor } from '@testing-library/react'+import type { StripeAddressElementChangeEvent } from '@stripe/stripe-js'+import { describe, expect, it, vi } from 'vitest'++import { useBillingCustomerDataForm } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm'+import type { CustomerAddress, CustomerTaxId } from 'data/organizations/types'++type BillingProfile = ReturnType<typeof makeCustomerProfile>+type CustomerChangeHandler = Parameters<+ typeof useBillingCustomerDataForm+>[0]['onCustomerDataChange']++type HookPropsWithTaxId = {+ customerProfile: BillingProfile+ taxId: CustomerTaxId | null+ onCustomerDataChange: CustomerChangeHandler+}++type HookPropsWithExistingTaxId = {+ customerProfile: BillingProfile+ taxId: CustomerTaxId+ onCustomerDataChange: CustomerChangeHandler+}++type HookPropsWithoutTaxId = {+ customerProfile: BillingProfile+ onCustomerDataChange: CustomerChangeHandler+}++type HookPropsHydrated = {+ customerProfile: BillingProfile | null | undefined+ onCustomerDataChange: CustomerChangeHandler+}++const makeCustomerProfile = (+ overrides?: Partial<{ address: CustomerAddress; billing_name: string }>+) => ({+ billing_name: 'Acme Inc',+ address: {+ line1: '123 Main St',+ line2: 'Suite 100',+ city: 'New York',+ state: 'NY',+ postal_code: '10001',+ country: 'US',+ },+ ...overrides,+})++const makeTaxId = (overrides?: Partial<CustomerTaxId>): CustomerTaxId => ({+ type: 'us_ein',+ value: '12-3456789',+ country: 'US',+ ...overrides,+})++const makeAddressChangeEvent = (+ overrides?: Partial<{+ name: string+ address: Partial<CustomerAddress>+ complete: boolean+ }>+): StripeAddressElementChangeEvent => ({+ complete: overrides?.complete ?? true,+ elementType: 'address',+ elementMode: 'billing',+ empty: false,+ isNewAddress: false,+ value: {+ address: {+ city: overrides?.address?.city ?? 'San Francisco',+ country: overrides?.address?.country ?? 'US',+ line1: overrides?.address?.line1 ?? '500 Market St',+ line2: overrides?.address?.line2 ?? '',+ postal_code: overrides?.address?.postal_code ?? '94105',+ state: overrides?.address?.state ?? 'CA',+ },+ name: overrides?.name ?? 'Updated Company',+ },+})++const submitHook = async <TResult,>(submit: () => Promise<TResult>) => {+ let result: TResult | undefined+ await act(async () => {+ result = await submit()+ })+ return result as TResult+}++describe('useBillingCustomerDataForm', () => {+ it('initializes tax ID fields and address country from the provided profile', () => {+ const customerProfile = makeCustomerProfile({+ address: {+ line1: '1 Infinite Loop',+ line2: '',+ city: 'Cupertino',+ state: 'CA',+ postal_code: '95014',+ country: 'US',+ },+ })+ const taxId = makeTaxId()++ const { result } = renderHook(+ ({ customerProfile, taxId, onCustomerDataChange }: HookPropsWithTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, taxId, onCustomerDataChange: vi.fn() },+ }+ )++ expect(result.current.addressCountry).toBe('US')+ expect(result.current.form.getValues()).toEqual({+ tax_id_name: 'US EIN',+ tax_id_type: 'us_ein',+ tax_id_value: '12-3456789',+ })+ expect(result.current.isDirty).toBe(false)+ })++ it('returns validation errors when the seeded address is incomplete', async () => {+ const customerProfile = makeCustomerProfile({+ billing_name: '',+ address: {+ line1: '',+ line2: '',+ city: '',+ state: '',+ postal_code: '',+ country: '',+ },+ })++ const { result } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsWithoutTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, onCustomerDataChange: vi.fn() },+ }+ )++ await expect(submitHook(result.current.handleSubmit)).resolves.toEqual({+ status: 'error',+ message: 'Full name is required.',+ })+ })++ it('blocks submit when Stripe marks the address element as incomplete', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()++ const { result } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsWithoutTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.onAddressChange(+ makeAddressChangeEvent({+ complete: false,+ address: { postal_code: 'ABCDE' },+ })+ )+ })++ await expect(submitHook(result.current.handleSubmit)).resolves.toEqual({+ status: 'error',+ message: 'Please enter a valid billing address.',+ })+ expect(onCustomerDataChange).not.toHaveBeenCalled()+ })++ it('submits the seeded address for tax-id-only updates', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()++ const { result } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsWithoutTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.form.setValue('tax_id_name', 'US EIN', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', 'us_ein', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '12-3456789', { shouldDirty: true })+ })++ await waitFor(() => expect(result.current.isDirty).toBe(true))+ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult.status).toBe('success')+ if (submitResult.status !== 'success') {+ throw new Error('Expected successful submit result')+ }+ act(() => {+ result.current.markCurrentValuesAsSaved(+ submitResult.submittedState.addressValue,+ submitResult.submittedState.taxIdValues+ )+ })++ expect(onCustomerDataChange).toHaveBeenCalledWith({+ address: customerProfile.address,+ billing_name: 'Acme Inc',+ tax_id: {+ type: 'us_ein',+ value: '12-3456789',+ country: 'US',+ },+ })+ expect(result.current.isDirty).toBe(false)+ })++ it('submits tax_id as null after an existing tax ID is removed', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()+ const taxId = makeTaxId()++ const { result } = renderHook(+ ({ customerProfile, taxId, onCustomerDataChange }: HookPropsWithTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, taxId, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.form.setValue('tax_id_name', '', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', '', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '', { shouldDirty: true })+ })++ await waitFor(() => expect(result.current.isDirty).toBe(true))+ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult).toEqual({+ status: 'success',+ submittedState: {+ addressValue: {+ name: 'Acme Inc',+ address: customerProfile.address,+ },+ taxIdValues: {+ tax_id_name: '',+ tax_id_type: '',+ tax_id_value: '',+ },+ },+ })++ expect(onCustomerDataChange).toHaveBeenCalledWith({+ address: customerProfile.address,+ billing_name: 'Acme Inc',+ tax_id: null,+ })+ })++ it('keeps a removed tax ID cleared after an intermediate rerender during save', async () => {+ const customerProfile = makeCustomerProfile()+ const taxId = makeTaxId()+ let rerenderHook: ((props: HookPropsWithExistingTaxId) => void) | undefined++ const onCustomerDataChange: CustomerChangeHandler = vi.fn(async () => {+ rerenderHook?.({+ customerProfile: makeCustomerProfile({+ address: {+ ...customerProfile.address,+ line1: '500 Market St',+ },+ }),+ taxId,+ onCustomerDataChange,+ })+ await Promise.resolve()+ })++ const { result, rerender } = renderHook(+ ({ customerProfile, taxId, onCustomerDataChange }: HookPropsWithTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, taxId, onCustomerDataChange },+ }+ )++ rerenderHook = rerender++ act(() => {+ result.current.form.setValue('tax_id_name', '', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', '', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '', { shouldDirty: true })+ })++ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult.status).toBe('success')+ if (submitResult.status !== 'success') {+ throw new Error('Expected successful submit result')+ }++ act(() => {+ result.current.markCurrentValuesAsSaved(+ submitResult.submittedState.addressValue,+ submitResult.submittedState.taxIdValues+ )+ })++ expect(result.current.form.getValues()).toEqual({+ tax_id_name: '',+ tax_id_type: '',+ tax_id_value: '',+ })+ })++ it('uses the latest address element value when building the submit payload', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()+ const taxId = makeTaxId({ type: 'eu_vat', value: '12345678', country: 'AT' })++ const { result } = renderHook(+ ({ customerProfile, taxId, onCustomerDataChange }: HookPropsWithTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, taxId, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.onAddressChange(+ makeAddressChangeEvent({+ name: 'Updated GmbH',+ address: { country: 'AT', city: 'Vienna', postal_code: '1010' },+ })+ )+ result.current.form.setValue('tax_id_name', 'AT VAT', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', 'eu_vat', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '12345678', { shouldDirty: true })+ })++ await waitFor(() => expect(result.current.addressCountry).toBe('AT'))+ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult).toEqual({+ status: 'success',+ submittedState: {+ addressValue: {+ name: 'Updated GmbH',+ address: {+ line1: '500 Market St',+ line2: '',+ city: 'Vienna',+ state: 'CA',+ postal_code: '1010',+ country: 'AT',+ },+ },+ taxIdValues: {+ tax_id_name: 'AT VAT',+ tax_id_type: 'eu_vat',+ tax_id_value: '12345678',+ },+ },+ })++ expect(onCustomerDataChange).toHaveBeenCalledWith({+ address: {+ line1: '500 Market St',+ line2: undefined,+ city: 'Vienna',+ state: 'CA',+ postal_code: '1010',+ country: 'AT',+ },+ billing_name: 'Updated GmbH',+ tax_id: {+ type: 'eu_vat',+ value: 'ATU12345678',+ country: 'AT',+ },+ })+ })++ it('submits an updated address without changing a missing tax ID', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()++ const { result } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsWithoutTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.onAddressChange(+ makeAddressChangeEvent({+ name: 'Updated Company',+ address: { city: 'Los Angeles', state: 'CA', postal_code: '90001' },+ })+ )+ })++ expect(result.current.isDirty).toBe(true)+ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult).toEqual({+ status: 'success',+ submittedState: {+ addressValue: {+ name: 'Updated Company',+ address: {+ line1: '500 Market St',+ line2: '',+ city: 'Los Angeles',+ state: 'CA',+ postal_code: '90001',+ country: 'US',+ },+ },+ taxIdValues: {+ tax_id_name: '',+ tax_id_type: '',+ tax_id_value: '',+ },+ },+ })++ expect(onCustomerDataChange).toHaveBeenCalledWith({+ address: {+ line1: '500 Market St',+ line2: undefined,+ city: 'Los Angeles',+ state: 'CA',+ postal_code: '90001',+ country: 'US',+ },+ billing_name: 'Updated Company',+ tax_id: null,+ })+ })++ it('resets dirty state and restores the initial address payload', async () => {+ const onCustomerDataChange = vi.fn()+ const customerProfile = makeCustomerProfile()++ const { result } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsWithoutTaxId) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps: { customerProfile, onCustomerDataChange },+ }+ )++ act(() => {+ result.current.onAddressChange(+ makeAddressChangeEvent({+ address: { city: 'Los Angeles', state: 'CA', postal_code: '90001' },+ })+ )+ result.current.form.setValue('tax_id_name', 'US EIN', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', 'us_ein', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '12-3456789', { shouldDirty: true })+ })++ await waitFor(() => expect(result.current.isDirty).toBe(true))++ act(() => {+ result.current.handleReset()+ })++ expect(result.current.isDirty).toBe(false)+ expect(result.current.addressCountry).toBe('US')++ act(() => {+ result.current.form.setValue('tax_id_name', 'US EIN', { shouldDirty: true })+ result.current.form.setValue('tax_id_type', 'us_ein', { shouldDirty: true })+ result.current.form.setValue('tax_id_value', '12-3456789', { shouldDirty: true })+ })++ const submitResult = await submitHook(result.current.handleSubmit)+ expect(submitResult).toEqual({+ status: 'success',+ submittedState: {+ addressValue: {+ name: 'Acme Inc',+ address: customerProfile.address,+ },+ taxIdValues: {+ tax_id_name: 'US EIN',+ tax_id_type: 'us_ein',+ tax_id_value: '12-3456789',+ },+ },+ })++ expect(onCustomerDataChange).toHaveBeenLastCalledWith({+ address: customerProfile.address,+ billing_name: 'Acme Inc',+ tax_id: {+ type: 'us_ein',+ value: '12-3456789',+ country: 'US',+ },+ })+ })++ it('syncs addressCountry when the customer profile loads after mount', async () => {+ const onCustomerDataChange = vi.fn<CustomerChangeHandler>()+ const initialProps: HookPropsHydrated = {+ customerProfile: undefined,+ onCustomerDataChange,+ }++ const { result, rerender } = renderHook(+ ({ customerProfile, onCustomerDataChange }: HookPropsHydrated) =>+ useBillingCustomerDataForm({+ customerProfile,+ taxId: null,+ onCustomerDataChange,+ }),+ {+ initialProps,+ }+ )++ expect(result.current.addressCountry).toBeUndefined()++ rerender({+ onCustomerDataChange,+ customerProfile: makeCustomerProfile({+ address: {+ line1: 'Schonhauser Allee 1',+ line2: '',+ city: 'Berlin',+ state: 'BE',+ postal_code: '10119',+ country: 'DE',+ },+ }),+ })++ await waitFor(() => expect(result.current.addressCountry).toBe('DE'))+ })+})