How yogeshs130/payflow works
PayFlow Copilot turns a seller’s plain-language order into an editable payment draft, then creates and captures a PayPal Sandbox payment after seller approval. The browser owns review and checkout callbacks; the Node backend owns parsing, validation, credentials, and PayPal API calls. The shared cents helper supports both browser totals and server-side price checks. The README documents the intended end-to-end flow; sampled source confirms the browser requests and backend integrations. This is a Sandbox prototype, not a production payment system.
Main entry points: app.js Browser Workflow · server.mjs Order Creation · money.js Cents Conversion · index.html Order Page
Components 12
Seller Interface
- Order Page
public/index.html - Browser Workflow
public/app.js
Order Backend
- Order Parsing
server.mjs - PayPal Config
server.mjs - Order Creation
server.mjs - Payment Capture
server.mjs - PayPal Authentication
server.mjs
Money Handling
- Cents Conversion
public/money.js
External Services
- Gemini API
- PayPal JS SDK
- PayPal Sandbox API
Other components
- Seller
Connections 24
- Seller → Order Page: enters order
README.md - Order Page → Browser Workflow: hosts workflow
README.md - Browser Workflow → Order Parsing: requests draft
public/app.js - Order Parsing → Gemini API: requests extraction
server.mjs - Gemini API → Order Parsing: returns draft data
server.mjs - Order Parsing → Cents Conversion: validates price
server.mjs - Order Parsing → Browser Workflow: returns draft
public/app.js - Browser Workflow → Cents Conversion: rounds total
public/app.js - Browser Workflow → PayPal Config: fetches client ID
public/app.js - PayPal Config → Browser Workflow: returns client ID
README.md - Browser Workflow → PayPal JS SDK: loads and renders
public/app.js - PayPal JS SDK → Browser Workflow: signals approval
public/app.js - Browser Workflow → Order Creation: requests order
public/app.js - Order Creation → Cents Conversion: validates price
server.mjs - Order Creation → PayPal Authentication: gets token
server.mjs - PayPal Authentication → PayPal Sandbox API: requests token
server.mjs - Order Creation → PayPal Sandbox API: creates Sandbox order
README.md - PayPal Sandbox API → Order Creation: returns order ID
README.md - Order Creation → Browser Workflow: returns order ID
public/app.js - Browser Workflow → Payment Capture: requests capture
public/app.js - Payment Capture → PayPal Authentication: gets token
server.mjs - Payment Capture → PayPal Sandbox API: captures payment
README.md - PayPal Sandbox API → Payment Capture: returns payment status
README.md - Payment Capture → Browser Workflow: returns result
public/app.js