Inspiration

Typing “Pay John $200 for the website” is easy. Knowing whether the amount makes sense, whether you have paid John before, and whether the payment fits your budget takes more thought.

As AI makes it easier to act on instructions, we wanted to build a useful pause before checkout. Our work on PathGuard, a separate project for checking crypto destinations, helped shape that idea: check the details before money moves.

PathGuard Pay brings that approach to natural-language payment requests and PayPal checkout.

What it does

PathGuard Pay turns a written payment instruction into a request with a recipient, amount, currency, and purpose. It checks that request against payment history, risk rules, and the user’s spending limits.

Each request receives one of three results:

  • ALLOW: the request passes the current checks and can continue to checkout.
  • REVIEW: the user must review the warning and confirm with their password, or an authorized staff member must review it.
  • BLOCK: the request cannot proceed.

Users can set spending limits, connect an optional saved PayPal wallet, and follow their requests through transaction history. Each transaction has a details page with its PayPal Order ID and Capture ID when available.

The app also includes in-app notifications, payment insights, AI-assisted operational summaries, and an admin dashboard.

The working demo uses PayPal Sandbox, so no real money moves. Checkout uses the configured merchant account; recipient names help describe and assess requests, rather than routing person-to-person payouts.

How we built it

We built the backend with Python and FastAPI, using SQLAlchemy for database access. SQLite supports local development, while the hosted app uses PostgreSQL on Render.

The frontend uses React and Vite, with a dark interface designed around separate tasks: checking a payment, reviewing a warning, managing limits, and following transaction progress.

We use OpenRouter to extract payment details from natural language and generate operational summaries. AI helps interpret information, while backend rules enforce spending limits and payment decisions.

For payments, we integrated PayPal’s Sandbox Orders API for order creation, buyer approval, verification, and server-side capture. We also added optional PayPal Vault support, with saved-wallet tokens encrypted using Fernet.

GitHub Actions runs backend tests, PostgreSQL persistence checks, and the frontend build.

Challenges we ran into

One challenge was deciding where AI should stop. Understanding a sentence is useful, but a model’s response should not be enough to authorize a payment. We separated instruction extraction from the rules that control checkout.

The review flow needed careful work too. Flagging a request was only half the job: users needed a clear way to understand the warning, confirm or reject the request, and continue to PayPal after approval.

Payment state also proved more involved than a simple success message. Creating an order, receiving buyer approval, and capturing a payment are different steps. We had to handle returns, cancellations, errors, and repeated capture attempts without confusing those states.

Deployment brought another set of challenges: moving from SQLite to PostgreSQL, configuring hosted callback URLs, and connecting the frontend and API correctly.

Accomplishments that we're proud of

We’re proud of completing the full Sandbox journey: a written instruction becomes a checked payment request, continues through PayPal approval, and returns as a completed transaction with a capture reference.

We also built a review flow that ordinary users can use without needing an administrator. Password confirmation adds a deliberate step when a request needs attention, while blocked requests remain blocked.

The visual redesign was another milestone. Separating the dashboard, payments, reviews, and settings made the app easier to follow and gave the safety decisions more room to be understood.

Finally, we’re pleased that the project runs as a hosted application with persistent storage, automated checks, and transaction records users can inspect.

What we learned

We learned that payment safety depends as much on clear communication as it does on backend checks. A warning needs to explain what happened and give the user a sensible next step.

We also learned to distinguish between what AI understands and what the system can verify. A correctly extracted instruction does not prove that a recipient is trustworthy or that a payment should proceed.

Working with PayPal reinforced the importance of treating checkout as a sequence of states. Approval is not the same as capture, and an interrupted browser session should not leave users guessing about their payment.

What's next for PathGuard Pay

Our next priorities are verified PayPal webhooks, stronger payment reconciliation, and database-level locking for concurrent spending reservations.

We also want to improve account recovery, session management, and rate limiting, alongside clearer payment explanations and more testing with users.

Further ahead, we’d like to explore voice instructions and an MCP interface for AI agents. Those interfaces would use the same spending controls, review requirements, and checkout rules.

The goal remains simple: make payment instructions easier to act on while giving people a clear moment to check them first.

Built With

Share this project:

Updates

Submission history