-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment.php
36 lines (28 loc) · 885 Bytes
/
payment.php
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
<?php
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Amount=$_POST['Amount'];
$Phone=$_POST['phone'];
$purpose='Donation';
include 'instamojo/Instamojo.php';
$api = new Instamojo\Instamojo('test_3743a7a31d4c8d710f488ba8e39', 'test_2df6effdc4b9b2e6dd53dddd5a1', 'https://test.instamojo.com/api/1.1/');
try {
$response = $api->paymentRequestCreate(array(
"purpose" => $purpose,
"amount" => $Amount,
"send_email" => true,
"email" => $Email,
"buyer_name" =>$Name,
"phone"=>$Phone,
"send_sms" => true,
"allow_repeated_payments" =>false,
"redirect_url" => "https://payment-gateway-integration.000webhostapp.com/redirect.php"
));
//print_r($response);
$pay_url=$response['longurl'];
header("location: $pay_url");
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
?>