-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpayment.php
More file actions
42 lines (31 loc) · 1.96 KB
/
payment.php
File metadata and controls
42 lines (31 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php include "config.php"; ?>
<?php
// payment with rozarpay
$apikey = "rzp_test_ND6O9kA1rtn8eX";
?>
<?php
if (isset($_POST['save'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$amount = $_POST['amount'];
$reason = $_POST['reason'];
// Real Escape String
$name = mysqli_real_escape_string($conn, $name);
$email = mysqli_real_escape_string($conn, $email);
$mobile = mysqli_real_escape_string($conn, $mobile);
$amount = mysqli_real_escape_string($conn, $amount);
$reason = mysqli_real_escape_string($conn, $reason);
if ($name == '' || $email == '' || $amount == '' || $reason == '') {
echo "Please Enter All Data!";
} else {
$query = "INSERT INTO `contra` (`contra_id`, `name`, `email`, `mobile`, `amount`, `reason`) VALUES (NULL, '$name', '$email', '$mobile','$amount', '$reason');";
$result = mysqli_query($conn, $query);
}
}
?>
<?php include "header.php"; ?>
<form action="payment.php" method="POST">
<script src="https://checkout.razorpay.com/v1/checkout.js" data-key="<?php echo $apikey; ?>" // Enter the Test API Key ID generated from Dashboard → Settings → API Keys data-amount="<?php echo $amount * 100; ?>" // Amount is in currency subunits. Hence, 29935 refers to 29935 paise or ₹299.35. data-currency="INR"//You can accept international payments by changing the currency code. Contact our Support Team to enable International for your account data-id="<?php echo 'OID' . rand(10, 100) . 'END'; ?>"//Replace with the order_id generated by you in the backend. data-buttontext="Pay with Razorpay" data-name="Covid-19 Awareness" data-description="Help for whom who fighting with corona virus" data-image="" data-prefill.name="<?php echo $_POST['name']; ?>" data-prefill.email="<?php echo $_POST['email']; ?>" data-prefill.email="" data-theme.color=" #9F44D3"></script><input type="hidden" custom="Hidden Element" name="hidden">
</form>
<?php include "footer.php"; ?>