Payments
Enable payment processing with Stripe.
Syntax
$ vela enable payments The payments module creates the necessary database tables and code for payment processing, webhook events, receipts, sweeps and more.
Database tables
The payments module creates the following database tables:
stripe_products
stripe_prices
Webhooks
Stripe webhooks are scaffolded in src/routes/webhooks/stripe, with the payment intent
succeeded event included by default.
Customers
If authentication is enabled with the vela enable auth command, Stripe customers will
be created for the authenticated user on sign up and a user's payment methods can be saved and managed
in the user's billing settings page.
Database tables
These additional tables are created if authentication is enabled:
stripe_customers
stripe_payment_methods
transactions
Webhooks
In addition to the payment intent succeeded event, the payment method attached event is included by default for the authenticated user.
Cron jobs
PocketBase cron jobs run to keep the application database in sync with Stripe. Products and prices
are synced every two minutes, configured in data/hooks/stripe.pb.js. Stripe customers
are synced as well if authentication is enabled. The cron jobs trigger HTTP requests to the
application at /api/stripe/sync/<type>, with a shared secret key stored as an
environment variable INTERNAL_JOB_SECRET.