From 96c2ed3fc1e5c8f8d0a06390339417836002fbdb Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 2 Mar 2026 12:59:22 -0800 Subject: [PATCH] Fix cash payment fee: use real Payfrit platform fee, not 2.25% cash handling fee MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit submitCash.cfm: Calculate platform fee from subtotal * PayfritFee, store in Orders.PlatformFee and Payments.PaymentPayfritsCut on submission. complete.cfm: Replace bogus 2.25% cash transaction fee with the real platform fee (customer fee + business fee = 2 × PayfritFee × subtotal). Credit full Payfrit revenue to User 0. Record business fee in PaymentPayfritNetworkFees. Co-Authored-By: Claude Opus 4.6 --- api/orders/submitCash.cfm | 34 +++++++++++++++++++++++++++------ api/tasks/complete.cfm | 40 ++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/api/orders/submitCash.cfm b/api/orders/submitCash.cfm index 5d0fc12..29ce89a 100644 --- a/api/orders/submitCash.cfm +++ b/api/orders/submitCash.cfm @@ -40,10 +40,13 @@ - + @@ -56,6 +59,21 @@ + + + + + + + + - + - - + + + + + + + + + - - - - - - - + - + @@ -296,12 +299,12 @@ }, { datasource = "payfrit" })> - - + + @@ -333,7 +336,7 @@ ) VALUES ( :sentBy, :receivedBy, :orderID, 0, 0, :cashAmount, - :payfritCut, 0, 0, + :payfritCut, 0, :bizFee, 'Cash payment', NOW() ) ", { @@ -341,7 +344,8 @@ receivedBy: businessOwnerUserID, orderID: qTask.OrderID, cashAmount: CashReceivedCents / 100, - payfritCut: feeCents / 100 + payfritCut: payfritRevenueCents / 100, + bizFee: round(businessFeeDollars * 100) / 100 }, { datasource = "payfrit" })> @@ -410,7 +414,9 @@ - + + +