Inspiration
"One of the three mugs arrived chipped." A small merchant reading that message has to figure out what happened, what a fair resolution looks like, and how to carry it out. I built Remedy to bring the customer's message, an AI recommendation, and the PayPal transaction into one workspace.
What it does
Gemini pulls a short quote from the customer's message and suggests a next step. Remedy checks that the quote appears word for word in the original message, so the merchant can see which words the suggestion is based on. In the demo, the buyer approves a $72 PayPal Sandbox purchase for three mugs. The merchant reviews the complaint and can explicitly approve a $24 partial refund for the damaged mug.
A separate policy preview lets merchants adjust a review threshold and see how it affects six sample cases. The preview is a simulation and leaves the payment workflow untouched.
How I built it
I built the merchant workspace in Next.js, React, and TypeScript. Server routes call Gemini for message review and PayPal's Orders and Payments APIs for checkout, capture, and refunds. SQLite stores transaction state locally, and the Render deployment uses PostgreSQL.
Challenges and what I learned
An early sandbox checkout failed because of a seller currency restriction. I switched to separate US sandbox buyer and seller accounts and verified the full flow on the Render deployment. PayPal confirmed the $72 capture and the $24 partial refund. A repeated refund request returned the original refund, and the completed status was still visible after reloading the transaction state.
The biggest lesson was that the AI review and the payment flow need different checks. For the review, I can verify that the quoted words came from the customer's message, though not that the recommendation is correct. For the refund, Remedy needs explicit merchant approval, and it shows the refund as complete only when PayPal reports it as completed.
Built With
- api
- css
- gemini
- next.js
- paypal
- postgresql
- react
- render
- rest
- sandbox
- sqlite
- typescript