-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpay.php
More file actions
33 lines (28 loc) · 1018 Bytes
/
pay.php
File metadata and controls
33 lines (28 loc) · 1018 Bytes
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
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$amount = $_POST['price'];
include './instamojo/instamojo.php';
$api = new Instamojo\Instamojo('test_edd5f76577b52c19eb08ebef02b','test_df6e62fa8e4e1dc3bbdcf6eed80','https://test.instamojo.com/api/1.1/');
try {
$response = $api->paymentRequestCreate(array(
"purpose" => "Donation",
"amount" => $amount,
"send_email" => true,
"email" => "$email",
"buyer_name" => "$name",
"phone" => "$phone",
"send_sms" => true,
"allow_repeated_payments"=> false,
"redirect_url" => "https://careprovider.000webhostapp.com/CarerSystem/CarerSystem/thankyou.php",
//"webhook" => ""
));
// print_r($response);
$pay_url =$response['longurl'];
header("location: $pay_url");
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
?>