Razorpay is one of the popular payment gateway . Razorpay provides payment services to merchants. A website admin can receive online payments using the Razorpay payment gateway for that you will need to integrate the Razorpay payment gateway. Integrate Razorpay payment gateway in PHP with the MYSQL database. This is the most important process of a PHP website we can receive online payments. This source code will help you with Razorpay payment gateway integration in the PHP website. Using this source code, you can create products and pay with the Razorpay payment gateway. You can check the payment status and all payments or orders on the orders page. You will get database tables in the source code zip file. First, users check products on the shop page and click on the buy now button for any product. After that, the user redirects to the checkout page. User fills in the details in checkout like name, email, mobile number, and address. After that user clicks on the process to order button. After that user redirects to the payment page. Now users can pay with the Razorpay payment gateway using a lot of payment options like UPI, Cards, Google pay, phone pe, paytm, online banking, etc. After payment, the user receives payment success details.web admin can check all payments on the payments page with payer details.
PHP SDK kit is available for Razorpay payment gateway integration in PHP.
1. First of all, create two MYSQL database tables. The first table is for products and the second table is for payment records.
2. Now, create a form. This form is used to create products and data insert into the database.
3. Display all products or items on the shop page. You can use it for digital or physical products like an eCommerce system in PHP.
4. Create a checkout page and get the product id from the URL. Fetch product details using id and save in session variables.
5. Now, Download Razorpay PHP SDK direct from GitHub and Razorpay test app to integrate the Razorpay payment gateway in PHP
6. Use pay.php code and session data to transfer user data on the Razorpay website with Razorpay API.
7. Now, use payment verify page code from Razorpay test app and display payment success data from the database.
8. Make a payments page to display all payments or orders in an HTML table.
We have created these files in this source code. You can get it and download complete source code in zip and integrate Razorpay payment gateway in PHP and MYSQL database.