=== calculate_commission() — pure logic === PASS: 5% of GHS 100 = GHS 5.00 PASS: 5% of USD 250 = USD 12.50 (commission takes the donation currency) PASS: 10% of GHS 33.33 rounds to GHS 3.33 PASS: flat GHS 10 commission on a USD 5000 gift -- flat fee stays in the platform default currency, not the donation currency PASS: 5% of a GHS 1 gift is still recorded correctly (GHS 0.05) === record_commission_for_donation() — DB-touching, idempotent === PASS: commission recorded for a donation on a referred event PASS: commission amount is 5% of the donation (GHS 5.00) PASS: commission attributed to the correct affiliate PASS: new commission starts accrued PASS: confirming the same donation twice does not double-record commission PASS: organic (non-referred) event donation records no commission PASS: a failed (not successful) donation records no commission even if called directly PASS: new rate (10%) applies to a donation confirmed after the rate change PASS: earlier commission keeps the OLD rate it was calculated with, unaffected by the later change ================================== RESULTS: 14 passed, 0 failed ==================================