How aldenelevado/stripe-checkout-sample1 works
This sample lets a shopper start a one-time purchase from a Vue page, obtain a hosted Stripe Checkout URL from Laravel, and redirect to Stripe. Laravel creates the session from default or request-supplied product details and returns its URL; it also exposes a demo redirect-info endpoint and success/cancel response routes. The frontend additionally offers a demo direct-link action. Routing details are based on the README and route file paths in the tree; the API route declarations themselves were not sampled.
Main entry points: StripeCheckoutController.php Checkout controller · App.vue Checkout page · api.php API routes · main.js Vue entry
Components 9
Vue frontend
- Vue entry
vue-frontend/src/main.js - Checkout page
vue-frontend/src/App.vue
Laravel backend
- API routes
laravel/routes/api.php - Checkout controller
laravel/app/Http/Controllers/StripeCheckoutController.php - Stripe config
laravel/config/services.php - Web routes
laravel/routes/web.php
Hosted payment
- Stripe Checkout
- Hosted checkout
Other components
- Shopper
Connections 16
- Shopper → Checkout page: uses
- Vue entry → Checkout page: mounts
- Checkout page → API routes: fetches session
- API routes → Checkout controller: dispatches
- Checkout controller → Stripe config: reads key
- Checkout controller → Stripe Checkout: creates session
- Stripe Checkout → Checkout controller: returns URL
- Checkout controller → API routes: returns JSON
- API routes → Checkout page: session response
- Checkout page → Hosted checkout: redirects to URL
- Hosted checkout → Stripe Checkout: hosts payment
- Shopper → Checkout page: opens demo link
- Checkout page → Hosted checkout: sets demo URL
- API routes → Checkout controller: dispatches redirect info
- Checkout controller → API routes: returns endpoint info
- Stripe Checkout → Web routes: redirects after checkout