Skip to content

fix: add payment backend routes for Razorpay order creation and verification#86

Open
rishab11250 wants to merge 1 commit into
mayo-byte07:mainfrom
rishab11250:gssoc/fix/payment-routes
Open

fix: add payment backend routes for Razorpay order creation and verification#86
rishab11250 wants to merge 1 commit into
mayo-byte07:mainfrom
rishab11250:gssoc/fix/payment-routes

Conversation

@rishab11250
Copy link
Copy Markdown
Contributor

Description

Implements the two missing payment backend endpoints (/api/payment/create-order and /api/payment/verify) that the frontend Razorpay checkout calls. The payment/subscription upgrade flow is now fully functional.

Fixes #47

Changes Made

  • Initialized Razorpay with RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET from environment variables
  • Added POST /api/payment/create-order — validates planId (plus/professional) and billing (monthly/yearly), creates a Razorpay order with ₹50/₹500 for Plus and ₹399/₹4,000 for Professional, stores plan info in order notes
  • Added POST /api/payment/verify — validates the Razorpay payment signature using validatePaymentVerification(), fetches the order to get plan details from notes, updates the user's subscription_plan, subscription_billing, and subscribed_at in the database
  • Added PLANS pricing map with all four price tiers
  • Both routes are protected by the existing requireAuth middleware

Screenshots (if applicable)

N/A

Checklist

  • I have linked the relevant issue above.
  • I have tested my changes locally.
  • My code follows the project's style guidelines.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 27, 2026

@rishab11250 is attempting to deploy a commit to the Mayo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mayo-byte07
Copy link
Copy Markdown
Owner

make a backend with frontend part where 3 services you are providing like free and all more two stages with specific feature addition in the way you go up selecting the best stages , try to do this if needed any help message me at linkedin

@rishab11250
Copy link
Copy Markdown
Contributor Author

Can u make a issue for this and assign me to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Payment backend routes don't exist — /api/payment/create-order and /api/payment/verify return 404

2 participants