To process any payment on Cashfree PG, the merchant needs to create an order in the cashfree system. This order must be created from your backend (as it uses your secret key). Read more
Initialize JS SDK
Once you receive payment_session_id from create order response, you need to use Cashfree's JS SDK 2.0.0 to redirect the customer to the web checkout page. Read more
const paymentSessionId = "";
const cashfree = new Cashfree(paymentSessionId);
Use redirect function to redirect to pre-built checkout page.