New Jan 6, 2025

The id provided does not exist razorpay in nextjs/nodejs

Libraries, Frameworks, etc. All from Newest questions tagged reactjs - Stack Overflow View The id provided does not exist razorpay in nextjs/nodejs on stackoverflow.com

I am creating order from the frontend and back end send me the subscription id for that user.

now I am open the payment popup of razorpay. Sometimes it says that "The id provided does not exist.".

This happens when I pay once from the browser and try to pay a second time at that time I get this kind of error.

to overcome this problem I have to clear the data of the browser like cookies and localstorage.

const options: any = {
            key_id: "rzp_test_dVxxxxxxx",
            subscription_id: userSubscriptionId,
            name: 'test-payment',
            handler: function (response: any) {
                    console.log('Payment Successful:', response);
                   },
            theme: {
                color: '#1570EF',
            },
        };

const paymentObject = new (window as any).Razorpay(options); paymentObject.open();

Scroll to top