0% found this document useful (0 votes)
426 views

Payment-Gateway-Using-PHP - Pay - PHP at Master KishanMaurya - Payment-Gateway-Using-PHP GitHub

This document describes code for a payment gateway using PHP and Instamojo. It includes code to create a payment request on Instamojo using the user's name, email, phone and amount. If the payment is successful, the data is inserted into a transaction database table. The code redirects the user to the Instamojo payment page. Exceptions are caught and printed if the payment request fails.

Uploaded by

Muhammad Tahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
426 views

Payment-Gateway-Using-PHP - Pay - PHP at Master KishanMaurya - Payment-Gateway-Using-PHP GitHub

This document describes code for a payment gateway using PHP and Instamojo. It includes code to create a payment request on Instamojo using the user's name, email, phone and amount. If the payment is successful, the data is inserted into a transaction database table. The code redirects the user to the Instamojo payment page. Exceptions are caught and printed if the payment request fails.

Uploaded by

Muhammad Tahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

KishanMaurya / Payment-Gateway-Using-PHP

Instamozo -PaymentGateway-PHP (PHP , Bootstrap 4+ , Css , HTML-5 , Jquery)

4 stars 0 forks

Star Notifications

Code Issues Pull requests Actions Projects Security Insights

master

Payment-Gateway-Using-PHP / pay.php / Jump to

KishanMaurya Payment Gateway Using Php History

1 contributor

Raw Blame

32 lines (32 sloc) 1.21 KB

1 <?php
2 $con=mysqli_connect('localhost','root','','payment');
3 if (isset($_POST['payment']) && $_POST['amt'] >=99) {
4 $name=$_POST['name'];
5 $email=$_POST['email'];
6 $phone=$_POST['phone'];
7 $amount=$_POST['amt'];
8 $pay_to='MCA Foundation (Save Tree , Save India)';
9 include 'instamojo\Instamojo.php';
10 $api = new Instamojo\Instamojo('test_3fca8eebb469e6292a0003326f6', 'test_69ae86fc88c4fccf0809d1641df',
11 try {
12 $response = $api->paymentRequestCreate(array(
13 "purpose" => $pay_to,
14 "user_name" => $name,
15 "email" => $email,
16 "phone" => $phone,
17 "amount" => $amount,
18 "send_email" => true,
19 "allow_repeated_payments" => false,
20 "redirect_url" => "http://localhost/Payment/thankyou.php"
21 ));
22 // print_r($response);
23 $url=$response['longurl'];
24 header("location:$url");

25 }
26 catch (Exception $e) {
27 print('Error: ' . $e->getMessage());
28 }
29 $query="INSERT INTO transaction (name,email,phone,amount,pay_to) VALUES ('$name','$email','$phone'
30 $run=mysqli_query($con,$query);
31 }
32 ?>

You might also like