How are you showing a list of payments? I would think a simple report in a new layout could do this for you.
A slower manual way:
You could also go into Table view, right click or click down arrow on the heading for Cash or Credit Card. If they are in a value list, sort by value list, and right click or click down arrow again and select Trainling Sub Totals > Running Count
In a List View layout based on the payment table, you can add a sub summary layout part "when sorted by Type". If you add a non running summary field that computes the total of payment to the sub summary layout part, you will see the sub total for each payment type if you also sort your records by Type. Put the same summary field in the footer, header or a grand summary part and you'll see the grand total.