• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
charmaine

charmaine

stripe

Public
Like
stripe
Home
Code
4
README.md
H
index-test.ts
H
index.ts
H
test.ts
Branches
1
Pull requests
Remixes
History
Environment variables
3
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
10/7/2025
Viewing readonly version of main branch: v10
View latest version
README.md

Stripe Invoice Payment Discord Notifier

This val receives Stripe webhook notifications when invoices are paid and sends notifications to Discord.

Setup Instructions

1. Environment Variables

You need to set these environment variables in your Val Town settings:

  • STRIPE_SECRET_KEY: Your Stripe secret key (starts with sk_)
  • STRIPE_WEBHOOK_SECRET: Your Stripe webhook endpoint secret (starts with whsec_)
  • DISCORD_WEBHOOK_URL: Your Discord webhook URL

2. Discord Webhook Setup

  1. Go to your Discord server settings
  2. Navigate to Integrations → Webhooks
  3. Click "New Webhook"
  4. Choose the channel where you want notifications
  5. Copy the webhook URL and set it as DISCORD_WEBHOOK_URL

3. Stripe Webhook Setup

  1. Go to your Stripe Dashboard → Developers → Webhooks
  2. Click "Add endpoint"
  3. Set the endpoint URL to your val's HTTP URL (you'll get this after deploying)
  4. Select the event: invoice.payment_succeeded
  5. Copy the webhook signing secret and set it as STRIPE_WEBHOOK_SECRET

4. Testing

You can test the webhook by:

  1. Creating a test invoice in Stripe
  2. Marking it as paid
  3. Checking your Discord channel for the notification

Features

  • ✅ Verifies Stripe webhook signatures for security
  • ✅ Sends rich Discord embeds with payment details
  • ✅ Includes invoice amount, customer email, and invoice number
  • ✅ Links to the hosted invoice when available
  • ✅ Proper error handling and logging

Webhook Events

Currently handles:

  • invoice.payment_succeeded - When an invoice is successfully paid

Security

  • Webhook signature verification ensures requests are from Stripe
  • Environment variables keep sensitive data secure
  • Proper error handling prevents information leakage
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.