RazorPay Is Not Defined

0
Hi team, I am using razorpay in my application for payment process. I have configured razorpay connector and everything correctly. But when I try to trigger the payment button there is a error appearing in console as “ RazorPay not defined”.I got to know that the error is due to the script tag of checkout in razorpay. So I included it using HTML snippet. Still the error persists. Can anyone suggest a solution for this.   Thanks in advance 
asked
1 answers
0

Hi Vignesh Hariharan,

 

This error occurs because the `checkout.js` file is not imported, which leads to the error `Razorpay is not defined` when you try to create a new instance with `var rzp1 = new Razorpay(options);`.

 

To resolve this issue, download the `checkout.js` file from the link below and place the downloaded file in your `javascriptsource` folder. Ensure you set the correct path in your import statement. For example:

"../../razorpayconnector/actions/checkout.js";

 

Download the `checkout.js`.

 

Download Checkout.js

 

Once you have included this file correctly, the `Razorpay` object should be defined, and you should no longer encounter this error.

 

Thanks,

Amit Gupta

 

answered