- Updated customAmountSchema min value from 0.01 to 5
- Adjusted validation logic and error messages to reflect new minimum
- Modified DONATION_PRODUCTS minAmount for custom tier to 5
- Ensures donations meet the new minimum threshold for processing
- Add detailed secure logging throughout the donation creation API route for production debugging, including request receipt, validation results, amount calculations, PIX creation success, and error handling
- Update custom donation amount schema to allow minimum 0.01 and maximum 100,000 for broader donation flexibility
- Modify secure logger to always output data in production for improved monitoring and troubleshooting
Refactored the createDonationSchema from a combination of .object().and(z.union()) to a discriminatedUnion based on the "anonymous" field. This improves type safety and validation logic by explicitly handling anonymous and identified donations, ensuring customAmount is properly validated in both cases. The change maintains the same validation rules while simplifying the schema structure.
- Add rate limiting to prevent abuse on /api/donations/create endpoint
- Replace manual input validation with Zod schema for better error handling and type safety
- Switch from console.log to secureLogger to comply with LGPD and avoid exposing sensitive data
- Remove sensitive request body logging in AbacatePay client for improved security
Replaced hardcoded Portuguese text with next-intl translation keys in the support page, header, and donation card components to enable internationalization and support multiple languages. This improves the app's accessibility and localization capabilities.
- Updated support page grid layout to accommodate new custom donation card
- Enhanced API route to validate and process custom donation amounts (min/max limits)
- Modified donation card component to include custom amount input field
- Ensures users can donate any amount within specified range, improving donation flexibility
- Changed from server to client component to enable interactive features like confetti animation
- Removed server-side translations and hardcoded Portuguese text for simplicity
- Added confetti effect on page load and improved success icon with animations
- Updated buttons and share functionality for better user experience
- This enhances the donation thank you page with celebratory elements and client-side interactivity
Replace simple debug log with comprehensive logging of environment variables, including NODE_ENV, API key (masked), webhook secret, and base URL, to improve debugging and visibility in both development and production environments.
- Replaced signature-based verification with secret validation using webhookSecret query parameter for improved compatibility
- Added CORS headers in next.config.ts for webhook API routes to handle external requests from varying IPs
- Updated abacatepay.ts verifyWebhookSignature method for backward compatibility, now delegating validation to route handler
Improve webhook handling in AbacatePay route to accurately detect paid events, support anonymous donations, and log structured data for future database and email integrations. Add frontend logic in DonationCard to check payment confirmation via localStorage for real-time UI updates without API polling.
Updated ABACATEPAY_SETUP.md with comprehensive setup guide, including environment variables, API key instructions, webhook configuration, donation flow, and field details for better integration clarity. Added required fields (phone, CPF/CNPJ) to the donation form in app/[locale]/apoiar/page.tsx to collect essential donor information and improve compliance. This ensures smoother setup and more robust donation processing.
Add donation functionality to encourage community support, including a footer card on the home page, a highlighted "Apoiar" link in the header, and comprehensive English messages for the donation section to promote transparency and user engagement.
- Updated Header.tsx to use current locale in navigation links for proper routing
- Increased MiniSparkline chart dimensions in market-stats.tsx for better visibility
- Added under-construction translations for market, about, and prices pages in en.json and pt.json
- Minor formatting adjustments with added blank lines across multiple components
These changes improve internationalization and user experience by ensuring locale-aware navigation and providing informative placeholders for upcoming features.
Added Tailwind CSS and tw-animate-css imports to globals.css. Introduced a custom dark variant and an extensive @theme inline block with CSS variables for colors, radii, and animations. Included keyframes for shimmer-slide, spin-around, gradient, shine, and background-position-spin to enable consistent theming and dynamic UI effects across the application.