Getting total number of payments and percentage
SELECT pdate, 
       COUNT(status) total, 
       SUM(status='successful') successful,
       SUM(status='failed') failed,
       SUM(status='refunded') refunded, 
       SUM(status='successful')/COUNT(status)*100 successful_percent,
       SUM(status='failed')/COUNT(status)*100 failed_percent,
       SUM(status='refunded')/COUNT(status)*100 refunded_percent
FROM payments
GROUP BY pdate