Payment-Gateway-Using-PHP - Pay - PHP at Master KishanMaurya - Payment-Gateway-Using-PHP GitHub
Payment-Gateway-Using-PHP - Pay - PHP at Master KishanMaurya - Payment-Gateway-Using-PHP GitHub
4 stars 0 forks
Star Notifications
master
1 contributor
Raw Blame
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 ?>