add endpoint GET /api/v1/service-providers/authorize
add new webhook endpoint POST /api/v1/webhooks/stripe/connect
New Postgres Functions
add function update onboarding statuses on the stripe_users & service_providers tables
Other
add npm script to push migrations to local database (usage pnpm supabase:db-push-local or npm run supabase:db-push-local)
fix environment variables not loading in in vitest test suites
Diagrams
Service Provider Onboarding
Stripe Connect Webhook Handler
This starts once the onboarding has been completed and will update the onboarding status on both the stripe_users and service_providers tables. We use a postgres function since it implicitly wraps the two updates into a single transaction.
Note: Stripe Payment webhooks will be handled by a separate endpoint.
Related
4
29
33
Testing Instructions
Automated Testing
Run vitest tests via npm test
Manual Testing
As a Service Provider
Create a service provider account and navigate to /api/v1/service-providers/authorize.
This should return a redirect link to Stripe. Complete onboarding with Stripe. Keep an eye out for the prompts to use the Test Phone, Account Details, etc.
This should trigger a webhook which we will use to update the onboarding status on both of the stripe_users & service_providers tables
Note: Testing the webhook requires ngrok to be running as a reverse proxy and a webhook to be setup with Stripe.
As a Customer User
Sign up as a new user and navigate to /api/v1/service-providers/authorize.
Summary
Database
account_url
field fromstripe_users
tableNew Endpoints
GET /api/v1/service-providers/authorize
POST /api/v1/webhooks/stripe/connect
New Postgres Functions
stripe_users
&service_providers
tablesOther
pnpm supabase:db-push-local
ornpm run supabase:db-push-local
)Diagrams
Service Provider Onboarding
Stripe Connect Webhook Handler This starts once the onboarding has been completed and will update the onboarding status on both the
stripe_users
andservice_providers
tables. We use a postgres function since it implicitly wraps the two updates into a single transaction.Note: Stripe Payment webhooks will be handled by a separate endpoint.
Related
4
29
33
Testing Instructions
Automated Testing
npm test
Manual Testing
As a Service Provider
/api/v1/service-providers/authorize
.stripe_users
&service_providers
tablesNote: Testing the webhook requires ngrok to be running as a reverse proxy and a webhook to be setup with Stripe.
As a Customer User
/api/v1/service-providers/authorize
.