About ResolvePay Rescue

Inspiration

E-commerce returns and post-purchase complaints are notoriously broken. Customers are trapped in endless loops with conversational AI bots that hallucinate unbacked promises, while merchants struggle with unverified refunds, financial leakage, and vague return portals. ResolvePay Rescue was inspired by a simple conviction: post-purchase resolutions should be fast and fair for buyers, yet strictly governed, transparent, and mathematically foolproof for merchants. We wanted to build a system where AI assists with structured issue extraction, but deterministic code and double-entry accounting enforce the final word.

How We Built It

We engineered ResolvePay Rescue as a robust, enterprise-grade web application using a modern TypeScript monorepo architecture managed with pnpm workspaces:

  • Frontend: Built with Next.js 15 (App Router), styled using Tailwind CSS, and powered by TanStack Query for seamless asynchronous data fetching and state synchronization across web and email channels.
  • Backend & Services: Built around a modular NestJS API backend and dedicated NestJS background workers to handle asynchronous tasks reliably.
  • Data & Contracts: Powered by PostgreSQL 16 utilizing Drizzle ORM for type-safe relational database management, with strict Zod contracts ensuring end-to-end payload validation.
  • Integrations & AI: Integrated with Google Gemini for structured reasoning and advisory issue extraction, alongside PayPal REST APIs for payment captures and refunds, and Azure Blob storage for secure evidence management.

What We Learned

Building ResolvePay Rescue reinforced core lessons in high-stakes financial software engineering:

  1. AI Should Advise, Not Execute: We learned that relying on LLMs for financial decisions introduces unacceptable risk. By restricting AI strictly to advisory issue extraction while letting deterministic code authorize and book transactions, we achieved both flexibility and absolute safety.
  2. Cryptographic Binding Eliminates Dispute: Tying customer and merchant acceptance to hash-bound material terms ensures that what is agreed upon is precisely what executes.
  3. Resilience is Mandatory: External payment and fulfillment networks fail. Implementing idempotent saga execution with durable step recovery taught us how to build systems that never drop transactions or leave ledgers unbalanced.

Challenges We Faced

  • Enforcing Double-Entry Subledger Invariants: Maintaining rigorous, float-error-free accounting where every cent is accounted for across debits and credits required meticulous subledger design.
  • State-Machine Recovery: Managing complex multi-step workflows spanning PayPal captures, shipping adapters, and physical return inspections without risking partial or orphaned state updates.
  • Balancing AI Flexibility with Strict Schemas: Ensuring that unstructured complaints ingested from web forms and transactional email threads map cleanly and reliably into rigid Zod-validated business logic using Google Gemini.

Built With

Share this project:

Updates

Submission history