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:
parent
6a8ded9857
commit
c17f624787
2 changed files with 3 additions and 2 deletions
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
|
|
|
|||
Reference in a new issue