Payment Gateway in Oracle APEX using Razorpay
Razorpay Payment Gateway Integration in Oracle APEX (Step-by-Step Guide)
In this blog, I’ll show you how to integrate Razorpay and PayU payment gateways in your Oracle APEX application — similar to my Stripe payment gateway blog. You’ll get step-by-step instructions to implement both gateways, from obtaining API keys to processing payments inside Oracle APEX.
👉 I also have a YouTube video demonstrating the Razorpay integration you can check here:
https://youtu.be/T9OyXVbBlPQYouTube
Razorpay Payment Gateway Integration in Oracle APEX
Step 1: Create a Razorpay Account
Go to https://razorpay.com and sign up for an account.
Navigate to the Dashboard → API Keys.
Generate your Test API Key ID and Secret Key (you will replace these with Live keys later).
Step 2: Create Required Database Objects
Before integration, set up tables and procedures to store order/payment data. Upload your SQL scripts via:
SQL Workshop → SQL Scripts → Upload & Run
Created page items for the payment to get its value and forwading that values to the payment website for the test mode to get performed.
Step 3: Create Order in Razorpay (PL/SQL Process)
Set up a Page Process (After Submit) that creates a Razorpay Order using REST API:
Sample code :
DECLARE
l_response CLOB;
BEGIN
l_response := apex_web_service.make_rest_request(
p_url => 'https://api.razorpay.com/v1/orders',
p_http_method => 'POST',
p_username => '<<YOUR_RAZORPAY_KEY_ID>>',
p_password => '<<YOUR_RAZORPAY_SECRET>>',
p_body => 'amount=' || :PXX_AMOUNT*100 || '¤cy=INR&receipt=receiptnumber'
);
END;
Step 4: Add Razorpay Checkout Script
On your page’s HTML Header, add:
Then add a Dynamic Action on your button to trigger JavaScript:
Comments
Post a Comment