mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 10:53:23 +00:00
The test provider was using an in-memory Map to store payment sessions, which caused "Payment session not found" errors in several scenarios: 1. Next.js hot reload clearing the memory 2. Different execution contexts (API routes vs Payload admin) 3. Server restarts losing all sessions This fix updates all three test provider endpoints (UI, process, status) to fetch payment data from the database when not found in memory: - Tries in-memory session first (fast path) - Falls back to database query by providerId - Creates and caches session from database payment - Handles both string and object collection configurations This makes the built-in test UI work reliably out of the box, without requiring users to implement custom session management. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.6 KiB
4.6 KiB