Fix Stripe webhook and add dev webhook secret

- Add SubmittedOn = COALESCE(SubmittedOn, NOW()) to webhook for KDS timer
- Add test mode webhook secret for dev.payfrit.com
- Keep live mode webhook secret for biz.payfrit.com

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-19 10:08:35 -08:00
parent 6a8ded9857
commit c17f624787
2 changed files with 3 additions and 2 deletions

View file

@ -22,8 +22,8 @@ stripeLiveSecretKey = "sk_live_REPLACE_ME";
stripeLivePublishableKey = "pk_live_REPLACE_ME";
// Webhook secrets
stripeTestWebhookSecret = "";
stripeLiveWebhookSecret = "";
stripeTestWebhookSecret = "whsec_TJlxt9GPoUWeObmiWbjy8X5fChjQbJHp"; // dev.payfrit.com (test mode)
stripeLiveWebhookSecret = "whsec_8t6s9Lz0S5M1SYcEYvZ73qFP4zmtlG6h"; // biz.payfrit.com
// Select active keys based on mode
if (stripeMode == "test") {

View file

@ -82,6 +82,7 @@ try {
UPDATE Orders
SET PaymentStatus = 'paid',
PaymentCompletedOn = NOW(),
SubmittedOn = COALESCE(SubmittedOn, NOW()),
StatusID = CASE WHEN StatusID = 0 THEN 1 ELSE StatusID END
WHERE ID = :orderID
", { orderID: orderID });