One-Time Payment
Capturing one time payments is heck easy with LaunchFa.st. Post payment processes such as updating users in a database, or sending them emails becomes super easy with APIs shipped with LaunchFa.st.
Accept Payments via Stripe
To start accepting payments via Stripe and creating checkout sessions:
- Update the
STRIPE_SECRET_KEYin the.envfile - Import the Button-Checkout component to start accepting payments. For example on the homepage:
---import ButtonCheckout from '@/components/Button-Checkout.astro'---
<html> <body> <ButtonCheckout /> </body></html><script>import ButtonCheckout from '@/components/Button-Checkout.svelte'</script>
<ButtonCheckout />Click the pay button to make a payment with the credit card number 4242 4242 4242 4242.
The Stripe webhook will be fired and the user will be created in the database.
You can add your own logic in src/pages/api/stripe/webhook.js like sending an email using the resend helper, turning on a boolean in the database for specific access, etc.
Accept Payments via Lemon Squeezy
Once you’re done setting up your Lemon Squeezy account and adding a product(s), import the Button-LS-Checkout component to start accepting payments. For example on the homepage:
---import ButtonLSCheckout from '@/components/Button-LS-Checkout.astro'---
<html> <body> <ButtonLSCheckout product_url="https://launchfast.lemonsqueezy.com/checkout/buy/30dd570f-3598-440d-a29a-1e002bda0eb6?checkout[discount_code]=M0OTIWMA" /> </body></html><script>import ButtonLSCheckout from '@/components/Button-LS-Checkout.svelte'</script>
<ButtonLSCheckout product_url="https://launchfast.lemonsqueezy.com/checkout/buy/30dd570f-3598-440d-a29a-1e002bda0eb6?checkout[discount_code]=M0OTIWMA"/>Click the pay button to make a payment with the credit card number 4242 4242 4242 4242.
The Lemon Squeezy webhook will be fired and the user will be created in the database.
You can add your own logic in src/pages/api/lemonsqueezy/webhook.js like sending an email using the resend helper, turning on a boolean in the database for specific access, etc.