Razorpay – India’s First Converged Payment Solution. Payment gateway solution for India with robust, developer friendly API and simple economic pricing. In this post describes how to integrate razorpay payment gateway in php. First of all, You have to create an account in RazorPay. Then create a auth keys from your account. Once payment done you have to capture that transaction with txn id. otherwise that amount should not credited to your bank account. Here we explains see the implementations steps for razorpay payment gateway.

See our demo video on Youtube:

Razorpay Integration Steps:

Step 1:

Create a account in razorpay and click here.razorpay-signup


Step 2:

Get your API keys to access test account in razorpay.

razorpay api keys

Step 3:

Integrate this checkout form in your payment.php file.

Add following line to your <head> tag, if not already there:

<meta name="viewport" content="width=device-width">
<form action="charge.php" method="POST">
    <!-- Note that the amount is in paise = 50 INR -->
        data-buttontext="Pay with Razorpay"
        data-description="Test Txn with RazorPay"
        data-prefill.name="Harshil Mathur"
        data-prefill.email="[email protected]"
    <input type="hidden" value="Hidden Element" name="hidden">

Step 4: 

After the payment is done, a form will be submitted to the url specified in previous step with razorpay_payment_id. This means, the payment is authorized and you can capture it now. Final step you got the transaction id so you store that id in your transaction_history table.

Thanks for reading this article. Please share this article and subscribe our youtube channel: SUBSCRIBE

Share Your Thoughts

Inline Feedbacks
View all comments
Subscribe Our Channel

Email Subscription
Watch Tutorials
Copyright © 2015 - 2021 PHPEXPERTISE.COM