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:
parent
379de66e6f
commit
e8b70ec372
1 changed files with 18 additions and 3 deletions
|
|
@ -293,12 +293,12 @@
|
||||||
<span>#dollarFormat(cart_grand_total)#</span>
|
<span>#dollarFormat(cart_grand_total)#</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--- Tax --->
|
||||||
<cfif get_order_info.TaxRate GT 0>
|
<cfif get_order_info.TaxRate GT 0>
|
||||||
<cfset tax_amount = round(cart_grand_total * get_order_info.TaxRate * 100) / 100>
|
<cfset tax_amount = round(cart_grand_total * get_order_info.TaxRate * 100) / 100>
|
||||||
<cfelse>
|
<cfelse>
|
||||||
<cfset tax_amount = 0>
|
<cfset tax_amount = 0>
|
||||||
</cfif>
|
</cfif>
|
||||||
<cfset order_grand_total = cart_grand_total + tax_amount>
|
|
||||||
|
|
||||||
<cfif tax_amount GT 0>
|
<cfif tax_amount GT 0>
|
||||||
<div class="total-row">
|
<div class="total-row">
|
||||||
|
|
@ -307,14 +307,16 @@
|
||||||
</div>
|
</div>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
<!--- Payfrit Service Fee --->
|
||||||
<cfif PaymentPayfritsCut GT 0>
|
<cfif PaymentPayfritsCut GT 0>
|
||||||
<div class="total-row">
|
<div class="total-row">
|
||||||
<span>Service fee</span>
|
<span>Service fee</span>
|
||||||
<span>#dollarFormat(PaymentPayfritsCut)#</span>
|
<span>#dollarFormat(PaymentPayfritsCut)#</span>
|
||||||
</div>
|
</div>
|
||||||
</cfif>
|
</cfif>
|
||||||
<cfset order_grand_total = order_grand_total + PaymentPayfritsCut>
|
|
||||||
|
|
||||||
|
<!--- Delivery Fee --->
|
||||||
|
<cfset PaymentDeliveryFee = 0>
|
||||||
<cfif get_order_info.OrderTypeID EQ 3>
|
<cfif get_order_info.OrderTypeID EQ 3>
|
||||||
<cfmodule template="../modules/get_delivery_fee.cfm" OrderID="#get_order_info.ID#">
|
<cfmodule template="../modules/get_delivery_fee.cfm" OrderID="#get_order_info.ID#">
|
||||||
<cfset PaymentDeliveryFee = calculated_delivery_fee>
|
<cfset PaymentDeliveryFee = calculated_delivery_fee>
|
||||||
|
|
@ -322,9 +324,22 @@
|
||||||
<span>Delivery fee</span>
|
<span>Delivery fee</span>
|
||||||
<span>#dollarFormat(PaymentDeliveryFee)#</span>
|
<span>#dollarFormat(PaymentDeliveryFee)#</span>
|
||||||
</div>
|
</div>
|
||||||
<cfset order_grand_total = order_grand_total + PaymentDeliveryFee>
|
|
||||||
</cfif>
|
</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">
|
<div class="total-row grand-total">
|
||||||
<span>Total</span>
|
<span>Total</span>
|
||||||
<span>#dollarFormat(order_grand_total)#</span>
|
<span>#dollarFormat(order_grand_total)#</span>
|
||||||
|
|
|
||||||
Reference in a new issue