This is how I used to calculate things when I was selling my shareware app:
Per product sold:
The other costs are indirect costs: they cannot be assigned on a per-product basis, so totals only here:
Revenue = what the customer pays
Direct costs = payment processing fee + sales tax (if any)
Gross profit = revenue - direct costs
Since I used to run a sole proprietorship, all profit went directly into my own pockets:
Indirect costs = web hosting + books + company insurance + ...
Net profit = total gross profit - indirect costs
If you are incorporated that last bit is a little different. There's more to it, but this should give you some idea.
Personal costs = food + rent + medical insurance + ...
Personal profit = net profit - personal costs