From e9b44ec4beea884833392dfefce64b6ce930881b Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Tue, 6 Jan 2026 18:02:01 -0800 Subject: [PATCH] Add task details API endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New endpoint: api/tasks/getDetails.cfm - Returns task info, customer info, service point, order line items - Joins Tasks, Orders, Users, ServicePoints, OrderLineItems tables - Add getDetails.cfm to public endpoints allowlist in Application.cfm 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- api/Application.cfm | 7 +- api/stripe/createPaymentIntent.cfm | 18 +--- api/tasks/getDetails.cfm | 156 +++++++++++++++++++++++++++++ 3 files changed, 160 insertions(+), 21 deletions(-) create mode 100644 api/tasks/getDetails.cfm diff --git a/api/Application.cfm b/api/Application.cfm index e3fc64f..e8ba379 100644 --- a/api/Application.cfm +++ b/api/Application.cfm @@ -32,10 +32,8 @@ showdebugoutput="false" > - - - - + + function apiAbort(payload) { @@ -85,6 +83,7 @@ if (len(request._api_path)) { if (findNoCase("/api/tasks/accept.cfm", request._api_path)) request._api_isPublic = true; if (findNoCase("/api/tasks/listMine.cfm", request._api_path)) request._api_isPublic = true; if (findNoCase("/api/tasks/complete.cfm", request._api_path)) request._api_isPublic = true; + if (findNoCase("/api/tasks/getDetails.cfm", request._api_path)) request._api_isPublic = true; // Worker app endpoints if (findNoCase("/api/workers/myBusinesses.cfm", request._api_path)) request._api_isPublic = true; diff --git a/api/stripe/createPaymentIntent.cfm b/api/stripe/createPaymentIntent.cfm index bb2ec81..45fc343 100644 --- a/api/stripe/createPaymentIntent.cfm +++ b/api/stripe/createPaymentIntent.cfm @@ -127,23 +127,7 @@ try { abort; } - // Save payment intent and fee info to order - queryExecute(" - UPDATE Orders - SET OrderStripePaymentIntentID = :paymentIntentID, - OrderTipAmount = :tipAmount, - OrderPayfritFee = :payfritFee, - OrderCardFee = :cardFee, - OrderTotalCharged = :totalCharged - WHERE OrderID = :orderID - ", { - paymentIntentID: piData.id, - tipAmount: tip, - payfritFee: payfritCustomerFee + payfritBusinessFee, - cardFee: cardFee, - totalCharged: totalCustomerPays, - orderID: orderID - }, { datasource: "payfrit" }); + // Fees are calculated dynamically, not stored in DB response["OK"] = true; response["CLIENT_SECRET"] = piData.client_secret; diff --git a/api/tasks/getDetails.cfm b/api/tasks/getDetails.cfm new file mode 100644 index 0000000..b6e855c --- /dev/null +++ b/api/tasks/getDetails.cfm @@ -0,0 +1,156 @@ + + + + + + + #serializeJSON(arguments.payload)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +