The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Add CTA to update tax ID if run into tax ID issues when upgrading plan (#47767)
Joshen Lim87c5f74ceb22
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PaymentMethodSelection.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PaymentMethodSelection.tsxindex f6e2ff0b60f..4ea53cba689 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PaymentMethodSelection.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PaymentMethodSelection.tsx@@ -14,7 +14,7 @@ import {useState,} from 'react'import { toast } from 'sonner'-import { Checkbox, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'ui'+import { Button, Checkbox, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'ui'import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'@@ -32,6 +32,7 @@ import type { CustomerAddress, CustomerTaxId } from '@/data/organizations/types'import { SetupIntentResponse } from '@/data/stripe/setup-intent-mutation'import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'import { BASE_PATH, STRIPE_PUBLIC_KEY } from '@/lib/constants'+import { useOrgSettingsPageStateSnapshot } from '@/state/organization-settings'const stripePromise = loadStripe(STRIPE_PUBLIC_KEY)@@ -44,6 +45,7 @@ export interface PaymentMethodSelectionProps {onTaxIdChange?: (taxId: CustomerTaxId | null) => voiduseAsDefaultBillingAddress: booleanonUseAsDefaultBillingAddressChange: (useAsDefault: boolean) => void+ onClose?: () => void}const PaymentMethodSelection = forwardRef(function PaymentMethodSelection(@@ -56,10 +58,12 @@ const PaymentMethodSelection = forwardRef(function PaymentMethodSelection(onTaxIdChange,useAsDefaultBillingAddress,onUseAsDefaultBillingAddressChange,+ onClose,}: PaymentMethodSelectionProps,ref) {const { slug } = useParams()+ const snap = useOrgSettingsPageStateSnapshot()const { data: selectedOrganization } = useSelectedOrganizationQuery()const [captchaToken, setCaptchaToken] = useState<string | null>(null)const [captchaRef, setCaptchaRef] = useState<HCaptcha | null>(null)@@ -223,7 +227,31 @@ const PaymentMethodSelection = forwardRef(function PaymentMethodSelection(dry_run: true,})} catch (error) {- toast.error(error instanceof Error ? error.message : 'Failed to validate billing profile')+ const errorMessage =+ error instanceof Error ? error.message : 'Failed to validate billing profile'+ if (errorMessage.includes('The tax ID type does not match the billing address country')) {+ toast.error(+ <div>+ <p>{errorMessage} Update your billing address or tax ID before upgrading your plan.</p>+ <Button+ variant="default"+ className="mt-2"+ onClick={() => {+ if (onClose) {+ onClose()+ snap.setPanelKey(undefined)+ const el = document.getElementById('address')+ if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' })+ }+ }}+ >+ Update tax ID+ </Button>+ </div>+ )+ } else {+ toast.error(errorMessage)+ }return false}diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsxindex c264ddc1371..d0ce8da62a6 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/SubscriptionPlanUpdateDialog.tsx@@ -361,6 +361,7 @@ export const SubscriptionPlanUpdateDialog = ({onTaxIdChange={onTaxIdChange}useAsDefaultBillingAddress={useAsDefaultBillingAddress}onUseAsDefaultBillingAddressChange={onUseAsDefaultBillingAddressChange}+ onClose={onClose}/></div>)}