What's fixed in v1.2.0:
- Fixed a critical crash on startup caused by a syntax error in the PayPal order creation (line 322 — missing comma between return_url and cancel_url)
- Fixed payment redirect routes — /donate/success and /donate/cancel were being incorrectly treated as donation tokens by Express, causing redirect failures after payment
- Fixed a crash when ADMIN_ROLES environment variable is left empty in .env
- Fixed guild.iconURL() crash when the bot couldn't find the Discord server on startup
- Fixed setImage() error when BACKGROUND_URL is not set
- Security fix — PayPal Client ID is no longer hardcoded in donate.html. It is now loaded securely from your .env via a server-side endpoint
- Fixed PayPal button rendering — buttons now wait for the SDK to fully load before initializing, preventing a race condition that caused the payment buttons to not appear
We recommend all users update to this version immediately.
Payment System Update - Key Changes:
Why This Works Better:
- PayPal Integration Fix
- Removed orderId from the return_url parameter
- Now using only the token parameter: .../success?token=${token}
- Resolved the "INVALID_PARAMETER_SYNTAX" PayPal API error
- Improved Request Structure
- Kept orderId as reference_id for internal tracking
- Maintained all security validations (token, amount checks)
- Streamlined the PayPal order creation request
- System Stability
- All existing functionality remains intact
- Successful donations still update Discord and databases
- Error handling remains robust
- PayPal now receives clean, valid URLs without placeholder variables
- The token alone is sufficient to process successful payments
- Simpler implementation while maintaining all tracking capabilities
