RescueCart AI — Intelligent Payment Recovery & Payment Reliability

Inspiration

Every failed online payment represents more than a failed transaction. For merchants, it can mean lost revenue, frustrated customers, and hours spent manually investigating what went wrong.

We wanted to build a solution that goes beyond simply processing payments. What if merchants could monitor their transactions, understand payment failures, and receive intelligent recommendations to make better recovery decisions?

That idea led to RescueCart AI — an AI-powered payment recovery and payment reliability platform.

What it does

RescueCart AI brings payment processing, transaction monitoring, and AI-assisted recovery into one platform.

Our solution focuses on three key capabilities:

1. Reliable PayPal Payment Processing

  • PayPal Sandbox checkout integration.
  • Idempotency protection to help prevent duplicate order creation.
  • Server-side payment capture and verification.
  • Amount, currency, and product-reference validation.
  • Payment lifecycle tracking, including pending, approved, completed, failed, and uncertain outcomes.
  • Reconciliation support for uncertain payment outcomes.

2. Merchant Recovery Centre

A dedicated dashboard that gives merchants visibility into their payment operations.

  • Monitor and filter payment transactions.
  • View payment details and statuses.
  • Manually verify transaction status with PayPal.
  • Mark transactions for review.
  • Maintain persistent recovery action history using Supabase.

3. AI Payment Failure Analyst

We integrated Google Gemini to provide structured, AI-assisted payment failure analysis.

  • Analyse verified payment information.
  • Identify possible reasons behind payment failures.
  • Generate actionable recovery recommendations.
  • Distinguish provider-confirmed information from AI-inferred explanations.
  • Track recommendations reviewed by merchants.

The AI analyst is designed to support merchant decisions, not automatically retry, capture, or charge payments.

How we built it

We developed RescueCart AI using a full-stack architecture.

Frontend: Next.js, React, TypeScript and Tailwind CSS.

Backend: Next.js API routes and server-side payment logic.

Payment Integration: PayPal Sandbox for order creation, checkout and capture verification.

Database: Supabase PostgreSQL for payment records and recovery action history.

AI: Google Gemini API for structured payment failure analysis.

We also focused on reliability through idempotency, server-side verification, input validation, safe error handling and automated tests.

Challenges we faced

Building a reliable payment recovery system involved several interesting challenges.

Payment lifecycle reliability: A successful payment capture and a successful database update are not always the same event. We implemented verification and reconciliation logic to handle uncertain outcomes safely.

Duplicate payment prevention: We implemented idempotency mechanisms to reduce the risk of duplicate order creation during repeated requests.

PayPal API integration: Working with Sandbox credentials, payment verification and API permissions required careful debugging and separation of checkout functionality from reporting permissions.

AI structured output: Integrating Gemini required adapting the request schema and validating generated JSON to maintain compatibility with our existing application response contract.

Security: We ensured that payment verification happens server-side, sensitive credentials remain in environment variables, and AI recommendations cannot directly perform financial operations.

What we learned

Through this project, we gained practical experience in:

  • Payment gateway integration and transaction lifecycle management.
  • API reliability, idempotency and reconciliation.
  • Designing merchant-facing operational dashboards.
  • Integrating generative AI with structured outputs.
  • Database design and persistent recovery history.
  • Secure backend development and automated testing.

Most importantly, we learned that building a payment solution is not only about making transactions work. It is also about handling failures responsibly and giving merchants the information they need to make informed decisions.

What's next?

We envision expanding RescueCart AI with intelligent recovery workflows, payment failure trend analytics, recovery success measurement, merchant-approved retry scheduling and support for additional payment providers.

RescueCart AI — Don't just process payments. Understand them, recover intelligently, and build payment reliability.

Built With

Share this project:

Updates

Submission history