This is the prepared code for the NeuralNine YouTube video tutorial, before the AI redesign. It contains only the core functionality, so it's easy to learn from.
Two Flask demos using the PayPal Python SDK (sandbox):
1_shop– web shop with one-time payments2_saas– SaaS app with subscriptions and webhooks
Requires uv and a PayPal developer account.
cd 1_shop
cp .env.example .envFill in .env:
FLASK_SECRET– any random stringPAYPAL_CLIENT_ID/PAYPAL_CLIENT_SECRET– from your sandbox app in the PayPal developer dashboard
Run it:
uv run app.pyOpen http://localhost:5000.
cd 2_saas
cp .env.example .envFill in .env:
FLASK_SECRET,PAYPAL_CLIENT_ID,PAYPAL_CLIENT_SECRET– same as aboveBASE_URL– your public URL (e.g. fromngrok http 5001)PAYPAL_WEBHOOK_ID– create a webhook in the developer dashboard pointing to<BASE_URL>/webhookPLAN_ID_BASIC/PLAN_ID_PRO– runuv run setup_plans.pyonce and paste the printed IDs
Run it:
uv run app.pyOpen http://localhost:5001.
Warning: The apps run with
debug=True. Exposing them through ngrok in debug mode is a security risk (the Werkzeug debugger allows remote code execution). Setdebug=Falsebefore tunneling.