mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 18:08:45 +01:00
adds a /pay/{token} redirect endpoint that generates a short URL
pointing to a stripe checkout sessions in setup mode. The TUI shows a QR
code and URL on the payment page so users can add a card via the browser
instead of entering raw card data over SSH.
the checkout.session.completed webhook saves the card to the database.
the TUI polls GET /api/v1/cards every second and auto-proceeds to
confirmation once the new card is detected.
also adds a dev.sh startup script that runs all four required processes.
(SSH server, API server, Stripe CLI listener, ngrok) in a single
terminal
20 lines
491 B
Bash
Executable File
20 lines
491 B
Bash
Executable File
#!/bin/bash
|
|
# Load .env to get the Stripe key
|
|
set -a; source .env; set +a
|
|
|
|
# Kill all background jobs on exit
|
|
trap 'kill $(jobs -p) 2>/dev/null' EXIT
|
|
|
|
echo "Starting API server..."
|
|
(cd api && go run main.go) &
|
|
|
|
echo "Starting Stripe webhook listener..."
|
|
stripe listen --api-key "$STRIPE_SECRET_KEY" --forward-to localhost:8080/api/v1/webhooks/stripe &
|
|
|
|
echo "Starting ngrok..."
|
|
ngrok http 8080 --log stdout &
|
|
|
|
echo ""
|
|
echo "Starting SSH server (Ctrl+C to stop everything)..."
|
|
go run main.go
|