payfrit-works/api/config/stripe.cfm
John Mizerek d225133c68 Add menu builder required selection UI and fix portal issues
Menu Builder - Required Selections:
- Added "Selection Rules" section for modifier groups
- Required (Yes/No) dropdown to mark if customer must select an option
- Max Selections input (0 = unlimited) to limit selections
- Visual "Required" badge (red) and "Max X" badge in modifier list
- Updated saveFromBuilder.cfm to persist ItemRequiresChildSelection
  and ItemMaxNumSelectionReq to database

Portal Fixes:
- Fixed menu-builder link to include BASE_PATH for local dev
- Fixed stats.cfm to not reference non-existent Categories table
- Menu items count now uses ItemParentItemID > 0 (not ItemCategoryID)

Stripe Configuration:
- Added api/config/stripe.cfm for centralized Stripe key management
- Supports test/live mode switching
- Fee configuration variables (5% customer, 5% business, 2.9% + $0.30 card)

Payment Intent API:
- Updated createPaymentIntent.cfm with proper fee structure
- Customer pays: subtotal + tax + tip + 5% Payfrit fee + card processing
- Platform receives 10% total (5% from customer + 5% from business)
- Saves fee breakdown to order record

Beacon Management:
- Updated switchBeacons.cfm to move beacons between businesses
- Currently configured: Big Dean's (27) -> In-N-Out (17)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 01:56:12 -08:00

44 lines
1.4 KiB
Text

<cfscript>
/**
* Stripe Configuration
*
* This file contains Stripe API keys and settings.
* DO NOT commit this file to version control with live keys!
*
* To switch between test/live:
* - Set stripeMode = "test" or "live"
* - Keys will be selected automatically
*/
// Mode: "test" or "live"
stripeMode = "test";
// Test keys (safe to commit)
stripeTestSecretKey = "sk_test_LfbmDduJxTwbVZmvcByYmirw";
stripeTestPublishableKey = "pk_test_sPBNzSyJ9HcEPJGC7dSo8NqN";
// Live keys (DO NOT commit real values)
stripeLiveSecretKey = "sk_live_REPLACE_ME";
stripeLivePublishableKey = "pk_live_REPLACE_ME";
// Webhook secrets
stripeTestWebhookSecret = "";
stripeLiveWebhookSecret = "";
// Select active keys based on mode
if (stripeMode == "test") {
application.stripeSecretKey = stripeTestSecretKey;
application.stripePublishableKey = stripeTestPublishableKey;
application.stripeWebhookSecret = stripeTestWebhookSecret;
} else {
application.stripeSecretKey = stripeLiveSecretKey;
application.stripePublishableKey = stripeLivePublishableKey;
application.stripeWebhookSecret = stripeLiveWebhookSecret;
}
// Fee Configuration
application.payfritCustomerFeePercent = 0.05; // 5% customer pays to Payfrit
application.payfritBusinessFeePercent = 0.05; // 5% business pays to Payfrit
application.cardFeePercent = 0.029; // 2.9% Stripe fee
application.cardFeeFixed = 0.30; // $0.30 Stripe fixed fee
</cfscript>