Add processing fee to receipt, match actual charge

Shows: subtotal, tax, service fee, processing fee (Stripe 2.9% + $0.30), total

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-15 17:08:27 -08:00
parent 379de66e6f
commit e8b70ec372

View file

@ -293,12 +293,12 @@
<span>#dollarFormat(cart_grand_total)#</span>
</div>
<!--- Tax --->
<cfif get_order_info.TaxRate GT 0>
<cfset tax_amount = round(cart_grand_total * get_order_info.TaxRate * 100) / 100>
<cfelse>
<cfset tax_amount = 0>
</cfif>
<cfset order_grand_total = cart_grand_total + tax_amount>
<cfif tax_amount GT 0>
<div class="total-row">
@ -307,14 +307,16 @@
</div>
</cfif>
<!--- Payfrit Service Fee --->
<cfif PaymentPayfritsCut GT 0>
<div class="total-row">
<span>Service fee</span>
<span>#dollarFormat(PaymentPayfritsCut)#</span>
</div>
</cfif>
<cfset order_grand_total = order_grand_total + PaymentPayfritsCut>
<!--- Delivery Fee --->
<cfset PaymentDeliveryFee = 0>
<cfif get_order_info.OrderTypeID EQ 3>
<cfmodule template="../modules/get_delivery_fee.cfm" OrderID="#get_order_info.ID#">
<cfset PaymentDeliveryFee = calculated_delivery_fee>
@ -322,9 +324,22 @@
<span>Delivery fee</span>
<span>#dollarFormat(PaymentDeliveryFee)#</span>
</div>
<cfset order_grand_total = order_grand_total + PaymentDeliveryFee>
</cfif>
<!--- Calculate Processing Fee (Stripe 2.9% + $0.30) --->
<cfset totalBeforeCardFee = cart_grand_total + tax_amount + PaymentPayfritsCut + PaymentDeliveryFee>
<cfset cardFeePercent = 0.029>
<cfset cardFeeFixed = 0.30>
<cfset totalCustomerPays = (totalBeforeCardFee + cardFeeFixed) / (1 - cardFeePercent)>
<cfset cardFee = round((totalCustomerPays - totalBeforeCardFee) * 100) / 100>
<div class="total-row">
<span>Processing fee</span>
<span>#dollarFormat(cardFee)#</span>
</div>
<cfset order_grand_total = round(totalCustomerPays * 100) / 100>
<div class="total-row grand-total">
<span>Total</span>
<span>#dollarFormat(order_grand_total)#</span>