Skip to content

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.

  1. HTTP 200 OK
  2. HTTP 400 Bad Request

POST /createCheckoutSession

Creates a user payments checkout session on STRIPE’s payment web platform.

  1. HTTP 200 OK
  2. HTTP 404 Not Found | User email not found
  3. HTTP 500 Internal Server Error | Create checkout session failed

POST /createPortalSession

Creates a payment portal session on STRIPE’s payment web platform.

  1. HTTP 200 OK
  2. HTTP 404 Not Found | Stripe id not found
  3. HTTP 500 Internal Server Error | Create portal session failed