Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: payment method selection when adding first card

Kevin Grünebergc5fca9a12861
diff --git a/studio/components/interfaces/BillingV2/Subscription/Tier/PaymentMethodSelection.tsx b/studio/components/interfaces/BillingV2/Subscription/Tier/PaymentMethodSelection.tsx
index 495f2b4ed72..f0008936b6a 100644
--- a/studio/components/interfaces/BillingV2/Subscription/Tier/PaymentMethodSelection.tsx
+++ b/studio/components/interfaces/BillingV2/Subscription/Tier/PaymentMethodSelection.tsx
@@ -147,7 +147,10 @@ const PaymentMethodSelection = ({
category: 'success',
message: 'Successfully added new payment method',
})
- await refetchPaymentMethods()
+ const { data } = await refetchPaymentMethods()
+ if (!selectedPaymentMethod && data?.length) {
+ onSelectPaymentMethod(data[0].id)
+ }
}}
/>
</>