diff --git a/src/pages/admin/AdminDonations.js b/src/pages/admin/AdminDonations.js index 248ecc5..4e53094 100644 --- a/src/pages/admin/AdminDonations.js +++ b/src/pages/admin/AdminDonations.js @@ -28,7 +28,13 @@ import { Loader2, Download, FileDown, - Calendar + Calendar, + ChevronDown, + ChevronUp, + ExternalLink, + Copy, + CreditCard, + Info } from 'lucide-react'; const AdminDonations = () => { @@ -43,6 +49,7 @@ const AdminDonations = () => { const [statusFilter, setStatusFilter] = useState('all'); const [startDate, setStartDate] = useState(''); const [endDate, setEndDate] = useState(''); + const [expandedRows, setExpandedRows] = useState(new Set()); useEffect(() => { fetchData(); @@ -157,6 +164,27 @@ const AdminDonations = () => { }); }; + const toggleRowExpansion = (donationId) => { + setExpandedRows((prev) => { + const newExpanded = new Set(prev); + if (newExpanded.has(donationId)) { + newExpanded.delete(donationId); + } else { + newExpanded.add(donationId); + } + return newExpanded; + }); + }; + + const copyToClipboard = async (text, label) => { + try { + await navigator.clipboard.writeText(text); + toast.success(`${label} copied to clipboard`); + } catch (error) { + toast.error('Failed to copy to clipboard'); + } + }; + const getStatusBadgeVariant = (status) => { const variants = { completed: 'default', @@ -385,12 +413,15 @@ const AdminDonations = () => {
@@ -400,51 +431,182 @@ const AdminDonations = () => {
- {donation.donor_name || 'Anonymous'} -
-- {donation.donor_email || 'No email'} -
-- {donation.amount} -
-- {donation.payment_method || 'N/A'} -
-+ {donation.donor_name || 'Anonymous'} +
++ {donation.donor_email || 'No email'} +
++ {donation.amount} +
++ {donation.payment_method || 'N/A'} +
+
+ {donation.stripe_payment_intent_id.substring(0, 20)}...
+
+
+
+ {donation.stripe_charge_id.substring(0, 20)}...
+
+
+
+ {donation.stripe_customer_id.substring(0, 20)}...
+
+
+ Webhook Events:
+Webhook Events to Configure:
✅ Currently Handled:
+✅ Required (Configure in Stripe):
🔔 Automatically Triggered:
+These fire automatically with checkout.session.completed
+🔄 Coming Soon:
+🔄 Coming Soon (Recurring Subscriptions):
Webhook Events:
+Webhook Events to Configure:
✅ Currently Handled:
+✅ Required (Configure in Stripe):
🔔 Automatically Triggered:
+These fire automatically with checkout.session.completed
+🔄 Coming Soon:
+🔄 Coming Soon (Recurring Subscriptions):
+ {sub.stripe_payment_intent_id.substring(0, 20)}...
+
+
+
+ {sub.stripe_charge_id.substring(0, 20)}...
+
+
+
+ {sub.stripe_subscription_id.substring(0, 20)}...
+
+
+
+ {sub.stripe_invoice_id.substring(0, 20)}...
+
+
+
+ {sub.stripe_customer_id.substring(0, 20)}...
+
+
+