Stripe webhook: register URL + configure signing secret #27

Closed
opened 2026-03-25 22:25:59 +00:00 by mik-tf · 1 comment
Member

Problem

Stripe API keys (sk_test_) are configured from env.sh. But webhook signing secret (STRIPE_WEBHOOK_SECRET) is not set. Without it, webhook signature verification fails and payment confirmations don't auto-credit wallets.

Solution

Same approach as freezone:

  1. Go to Stripe Dashboard → Developers → Webhooks
  2. Add endpoint: https://dev-app.projectmycelium.org/api/webhooks/stripe
  3. Subscribe to: checkout.session.completed, payment_intent.succeeded
  4. Copy the Signing Secret (whsec_...)
  5. Set STRIPE_WEBHOOK_SECRET in deploy env
  6. Redeploy backend
  7. Test: initiate payment → complete on Stripe → verify wallet credited

Note: Freezone uses the same Stripe account (same sk_test_ key). We can register a separate webhook endpoint URL for the marketplace.

Reference

Freezone webhook handler: znzfreezone_backend/src/main.rs lines ~1500-1700
Freezone deploy config: znzfreezone_deploy/tfgrid/envs/dev/app.env

Testing

  • Stripe CLI: stripe trigger checkout.session.completed --webhook-url=...
  • Verify wallet balance increases after webhook

Signed-off-by: mik-tf

## Problem Stripe API keys (sk_test_) are configured from env.sh. But webhook signing secret (STRIPE_WEBHOOK_SECRET) is not set. Without it, webhook signature verification fails and payment confirmations don't auto-credit wallets. ## Solution Same approach as freezone: 1. Go to Stripe Dashboard → Developers → Webhooks 2. Add endpoint: https://dev-app.projectmycelium.org/api/webhooks/stripe 3. Subscribe to: checkout.session.completed, payment_intent.succeeded 4. Copy the Signing Secret (whsec_...) 5. Set STRIPE_WEBHOOK_SECRET in deploy env 6. Redeploy backend 7. Test: initiate payment → complete on Stripe → verify wallet credited **Note:** Freezone uses the same Stripe account (same sk_test_ key). We can register a separate webhook endpoint URL for the marketplace. ## Reference Freezone webhook handler: znzfreezone_backend/src/main.rs lines ~1500-1700 Freezone deploy config: znzfreezone_deploy/tfgrid/envs/dev/app.env ## Testing - Stripe CLI: stripe trigger checkout.session.completed --webhook-url=... - Verify wallet balance increases after webhook Signed-off-by: mik-tf
Author
Member

Fixed — Stripe webhook live

What was done

  1. Registered webhook endpoint on Stripe: https://dev-app.projectmycelium.org/api/webhooks/stripe
  2. Events: checkout.session.completed, payment_intent.succeeded
  3. Webhook signing secret configured on VM
  4. Payment provider switched from demo to stripe
  5. Real Stripe Checkout session creation tested (returns checkout.stripe.com URL)
  6. Webhook delivery tested with valid HMAC-SHA256 signature → 200 OK
  7. Backend confirms payment and logs credit amount

Test

  • Signed webhook test added to api_integration.sh
  • 24/24 integration tests PASS

Webhook ID: we_1TF0vPC6v6GB0mBYIjwvImbC

Signed-off-by: mik-tf

## Fixed — Stripe webhook live ### What was done 1. Registered webhook endpoint on Stripe: `https://dev-app.projectmycelium.org/api/webhooks/stripe` 2. Events: `checkout.session.completed`, `payment_intent.succeeded` 3. Webhook signing secret configured on VM 4. Payment provider switched from demo to stripe 5. Real Stripe Checkout session creation tested (returns `checkout.stripe.com` URL) 6. Webhook delivery tested with valid HMAC-SHA256 signature → 200 OK 7. Backend confirms payment and logs credit amount ### Test - Signed webhook test added to api_integration.sh - 24/24 integration tests PASS ### Webhook ID: we_1TF0vPC6v6GB0mBYIjwvImbC Signed-off-by: mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coopcloud_code/home#27
No description provided.