If you sell to customers in India, you want UPI, and for that you want Razorpay. If you also sell abroad, Stripe Checkout is the easiest way to take cards. The starter does both from one FastAPI app, with one rule that matters more than either provider: the browser never decides that a payment succeeded.
Prices live on the server
Products and their prices are a dictionary in backend/app/api/payments.py :
PRODUCTS : dict [ str , dict ] = { " pro " : { " name " : " Pro upgrade " , " plan " : " pro " , # profiles.plan after payment " prices " : { " stripe " : ( 1900 , " usd " ), " razorpay " : ( 149900 , " inr " )}, }, }
Enter fullscreen mode
Exit fullscreen mode
Amounts are in minor units (cents and paise). The client sends a product id, never an amount, so nobody can buy the Pro plan for one rupee by editing a request.
Pending until a webhook says otherwise
Checkout creates a pending row in payments and returns the provider's checkout URL or order.…