Project

General

Profile

Actions

Task #804

open

Epic #786: Square Payment Gateway Integration

Feature #802: Purchase Stack (Cart System)

Total Calculation Logic

Added by Redmine Admin about 2 months ago. Updated about 1 month ago.

Status:
Ready for Client
Priority:
Normal
Assignee:
Start date:
04/22/2026
Due date:
% Done:

0%

Estimated time:

Description

Implement backend logic to calculate total payable amount by summing all cart items. Include support for taxes, discounts, or additional charges if applicable.

Actions #1

Updated by Deeksha Singh about 2 months ago

Module: Cart Total Calculation (Amount, Tax, Discount)

TC_ID: CART_TOTAL_01
Title: Verify total calculation for single item
Preconditions: Cart contains one item
Steps:

Add one item to cart
Fetch cart total
Test Data: Item price = 100
Expected Result: Total = 100

TC_ID: CART_TOTAL_02
Title: Verify total calculation for multiple items
Preconditions: Multiple items in cart
Steps:

Add multiple items
Fetch total
Test Data: Item1 = 100, Item2 = 200
Expected Result: Total = 300

TC_ID: CART_TOTAL_03
Title: Verify total calculation with item quantities
Preconditions: Quantity supported
Steps:

Add item with quantity >1
Fetch total
Test Data: Price = 100, Qty = 3
Expected Result: Total = 300

TC_ID: CART_TOTAL_04
Title: Verify tax calculation on total amount
Preconditions: Tax rules configured
Steps:

Add items
Calculate total
Test Data: Total = 100, Tax = 10%
Expected Result: Final total = 110

TC_ID: CART_TOTAL_05
Title: Verify discount application on total
Preconditions: Discount available
Steps:

Add items
Apply discount
Test Data: Total = 200, Discount = 20
Expected Result: Final total = 180

TC_ID: CART_TOTAL_06
Title: Verify combined tax and discount calculation
Preconditions: Tax and discount enabled
Steps:

Add items
Apply discount and tax
Test Data: Total = 200, Discount = 20, Tax = 10%
Expected Result: Final total calculated correctly as per business logic

TC_ID: CART_TOTAL_07
Title: Verify additional charges (if applicable)**
Preconditions: Extra charges configured (e.g., service fee)
Steps:

Add items
Calculate total
Test Data: Total = 100, Fee = 10
Expected Result: Final total = 110

TC_ID: CART_TOTAL_08
Title: Verify total recalculation after item removal
Preconditions: Items in cart
Steps:

Add multiple items
Remove one item
Fetch total
Test Data: Item1 = 100, Item2 = 200
Expected Result: Total updated correctly

TC_ID: CART_TOTAL_09
Title: Verify total recalculation after quantity update
Preconditions: Item in cart
Steps:

Update quantity
Fetch total
Test Data: Price = 100, Qty change 1 → 3
Expected Result: Total updated accordingly

TC_ID: CART_TOTAL_10
Title: Verify rounding of total amount
Preconditions: Decimal pricing
Steps:

Add items with decimal values
Calculate total
Test Data: 99.99, 49.99
Expected Result: Total rounded as per currency rules

TC_ID: CART_TOTAL_11
Title: Verify total consistency between UI and backend
Preconditions: Items in cart
Steps:

Check UI total
Compare with backend response
Test Data: Cart items
Expected Result: UI and backend totals match

TC_ID: CART_TOTAL_12
Title: Verify handling of zero or negative values
Preconditions: Invalid data scenario
Steps:

Add item with zero/negative price
Test Data: Price = 0 / -10
Expected Result: Validation error or ignored in calculation

TC_ID: CART_TOTAL_13
Title: Verify calculation with empty cart
Preconditions: No items in cart
Steps:

Fetch total
Test Data: Empty cart
Expected Result: Total = 0

TC_ID: CART_TOTAL_14
Title: Verify no manipulation of total from frontend
Preconditions: API accessible
Steps:

Modify total in request
Send to backend
Test Data: Altered total
Expected Result: Backend recalculates and ignores frontend value

TC_ID: CART_TOTAL_15
Title: Verify performance for large number of items
Preconditions: Large cart
Steps:

Add many items (50+)
Calculate total
Test Data: Bulk items
Expected Result: Total calculated correctly without delay

Actions #2

Updated by Deeksha Singh about 1 month ago

  • Status changed from New to Ready for Client
Actions

Also available in: Atom PDF