Files
supabase/apps/studio/components/interfaces/Billing
Ignacio Dobronich 69e00c6bbc feat: validate and save tax id using the customer endpoint (#44682)
## Summary

Reorder AddPaymentMethodForm and PaymentMethodSelection to use a dry run
validation → Stripe payment setup → real update flow:

- Validate address and tax ID via `dry_run: true` before touching Stripe
- Proceed with Stripe payment method creation / 3DS only if validation
passes
- Persist the customer profile update with dry run disabled after Stripe
succeeds
- Add `dry_run` support
to `useOrganizationCustomerProfileUpdateMutation`
- Add `getFormValues()` to `PaymentMethodElementRef` to read address and
tax ID form state
- Delete the now-unused `organization-tax-id-update-mutation.ts`

## Test plan

### Adding a Payment Method

From the billing dashboard `/org/_/billing`:

- [ ]  Add a payment method with a valid tax ID: should dry-run
validate, then create the payment method via Stripe, then persist the
billing profile
- [ ]  Add a payment method with an invalid tax ID: should show a
validation error from the dry run and not proceed to Stripe payment
setup
- [ ]  Add a payment method with the "primary billing address" checkbox
unchecked: should skip the customer profile update entirely and only
create the payment method
- [ ]  Add a payment method where Stripe 3DS fails: billing profile
should not be persisted (only the dry run ran)

### Credit Top Up

- [ ]  Top up credits with a new payment method and valid tax ID: should
dry-run validate, then create the payment method, then process the
top-up
- [ ]  Top up credits with a new payment method and invalid tax ID:
should show a validation error from the dry run and not proceed to
Stripe payment method creation

### Plan Upgrade

- [ ]  Upgrade plan with a new payment method and valid tax ID: should
dry-run validate before creating the payment method
- [ ]  Upgrade plan with a new payment method and invalid tax ID: should
show a validation error and not proceed to Stripe
- [ ]  Upgrade plan with an existing payment method: should proceed
without dry-run validation
2026-04-14 13:42:34 -03:00
..