Skip to content

Instantly share code, notes, and snippets.

View vaxxnsh's full-sized avatar

Akshit vaxxnsh

View GitHub Profile
@vaxxnsh
vaxxnsh / checkout.ts
Last active September 13, 2025 12:42
Razorpay Payment Integration for E-Commerce Production-ready checkout and webhook flow for an e-commerce store with real users. Secure Razorpay order creation and signature verification Prisma ORM for carts, orders, and payments Auto-clears cart after payment and notifies admin via email
const handleCheckout = async (data: ShippingAddress) => {
const userId = getUserId();
if (!userId) {
setError("You must be logged in to checkout");
return;
}
try {
setIsLoading(true);