Razorpay Payment Gateway Integration using PHP

Welcome back to shortlearner.com, in this post we will see how to implement Razorpay payment gateway with the help of PHP and CURL.

Razorpay is very popular payment gateway which provides all the clean, fast, secure payments services with hassle free integration.

Razorpay payment gateway in php

It allows online business to accept and process payments ,payments modes like including major Credit Cards, Debit Cards, Net-banking, Wallets & UPI. With the easiest integration, completely online onboarding, feature filled checkout and best in class performance, quickly go live with Razorpay and experience the future of payments.


Also Read :
Get Domain name from URL
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

so readers please just follow the below steps for implementing payment gateway in very easy way.

Create Account and Integrate Payment Gateway

  • At first Create Account.
  • After successful sign up and generate Key ID and Secret Key
Razorpay Payment Gateway Integration using PHP

Razorpay Payment Gateway features:

  • Accept All the payment methods like debit card, credit card, netbanking,UPI and wallets.
  • Razorpay payment gateway is very safe and secure
  • Easy to integration
  • Payment gateway kit available on multiple programming language
  • UPI and Multi Bank EMI options

Before starts to implement the Razorpay Payment Gateway Integration using PHP with cURL, look files structure, we are splits the process in several parts so it will be easy to understand the overall developing process.
Step1: Create a file constants.php and define Key ID and Secret Key

Note:please guys never share your secret key to anyone.

Step 2: Create another php file named index.php

in the below index.php code , we are declaring amount , currency , success URL and failure URL into some hidden input tags. so it will automatic redirect to success or failure page according to there response status.

Step 3: Create a file named callback.php
The file handles the payment process.

Step 4: Put the below script code in index.php file
We will use the chekout.js of Razorpay payment gateway for deduction of payment.

Step 5: now in the second last step we are creating a success.php file
so if transaction status is success than success.php page will show the message of transaction success.

Step 6: Create a file named failed.php

Create header.php and footer.php section of the web page.

footer.php

Copy Text From One Field To Another using JavaScript

Welcome back to shortlearner.com, in our previous post we learn how to read and display a txt file with the help of JavaScript.
today in this post we will see how to Copy Text From One Field To Another using JavaScript.

Copy Text From One Field To Another using  JavaScript

Also Read :
Get Domain name from URL
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

so most of the time we need to Copy Text From One Field To Another using Check Box with JavaScript.

for example if we are creating an e-commerce platform and we want to make it user friendly.

so we are creating a check box which will hep user to copy all the fields of billing address to shipping address.

in the below example there are two buyers , buyer 1 and buyer 2.
we take name, email and contact number information from buyer 1 and put it into buyer 2 by clicking on the checkbox

hope this post will help you.
keep coding, keep learning

Read and display the text file using javascript

Welcome back to shortlerner.com, in our previous post we was learn How to Send Attachment With Email with the help of PHP. today in this post we will see how to read and display a text file data into html text area tag with the help of JavaScript.

Read and display the text file using javascript

so here we are creating a file tag where user upload the text file and there is another html form element text area.

so whenever user upload the file we use some JavaScript functions which will read the file and display all the data of the file inside the text area.

Also Read :
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

simply just copy the above code and put it on your root directory.
hope this post will helps you, if you still facing some bugs or error to than feel free to contact.

thanks for reading the post and please share this code with your developer buddy.

keep coding , keep learning

Send Attachment With Email using php

Welcome back to shortlearner.com, in our previous post we learn how to add pagination using PHP and MySQL. so today in this post we will see how to Send Attachment With Email using php.

so first of all we should take an overview of our working scenario.
in the below code we are created a form with having email, subject,message and attachment fields.

once the form is submitted our script is check that the file’s format is valid or not.
if the file format is valid than the attachment is concatenate with our message field and with the help of MIME (Multipurpose Internet Mail Extensions) version and its content type and boundary.

we will send the attachment. once the mail is send successfully our script will display the success message and if the mail isn’t sent than it will display failure message as well.

send email with attachment in php

Also Read :
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

guys this code is not works on local server like xampp,wamp and appserv. so try it on live server.

delete multiple records using checkbox php

Welcome back to shortlearner.com, in our previous post we learn How to Create pagination using php and mysql . now in this post we will learn how to delete multiple records using checkbox with the help of PHP and MySQL.

delete multiple records in PHP

before start this tutorial first of all we should understand the overall scenario of this post.
now first of all we need to create a database connection , so in this example my database name is testdb .

after creating a database connection we fetch all the records from our user table and designed it in a tabular format with checkbox field, and also create a java script function that will help us to select all check boxes at a time.
so just follow the below code.

Also Read :
Get Domain name from URL
Unable to create a directory a wordpress error
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

copy the above code and save it on htdocs directory of your xampp server.
there is a www folder if you are using WAMP or Appserv local server.

share this code with your developer buddies and if you have another way to make it simple ,please feel free to contact we will update your method also in this post.

keep coding, keep learning