Payments
Payments Service File Structure
DirectorySNAPCASTER-BACKEND
Directoryservices
Directorypayment
Directorysrc
Directoryconfig
- database.ts
- stripeService.ts
Directorycontrollers
- paymentController.ts
- stripeEventHandlers.ts
Directorymiddleware
- authMiddleware.ts
Directoryroutes
- paymentRoutes.ts
Directorytypes
- types.d.ts
- types.ts
- .gitignore
- babel.config.js
- docker-entrypoint.sh
- Dockerfile
- nodemon.json
- package.json
- pnpm-lock.yaml
- ts.config.json
- …
POST /webhook
STRIPE payments webhook that lets Snapcaster know if the user changes the status of their subscription through the STRIPE payments web portal.
HTTP 200 OK
HTTP 400 Bad Request
POST /createCheckoutSession
Creates a user payments checkout session on STRIPE’s payment web platform.
HTTP 200 OK
HTTP 404 Not Found | User email not found
HTTP 500 Internal Server Error | Create checkout session failed
POST /createPortalSession
Creates a payment portal session on STRIPE’s payment web platform.
HTTP 200 OK
HTTP 404 Not Found | Stripe id not found
HTTP 500 Internal Server Error | Create portal session failed