<?php
include 'database.php';//include database
$pricesql="SELECT * FROM `price`";//this is price table which i can update and this table contain 3 type of price
$response=mysqli_query($conn,$pricesql);
$price=mysqli_fetch_assoc($response);
$price_teacher= $price['price_teacher'];
$price_student= $price['price_student'];
$price_institute= $price['price_institute'];
}
}
```
include 'src/instamojo.php';
@$api = new Instamojo\Instamojo(test_d895d58336b76a4042ae3b70851, test_12bb1df4f178cbbbed8ddaa3d9b, 'https://test.instamojo.com/api/1.1/');
try {
$response = $api->paymentRequestCreate(array(
"purpose" => $product_name,
"custom_fields"=>$cars,
"amount" => $price,//here you can pass amount(remove my comment)
"send_email" => true,
"email" => $email,
"buyer_name"=> $name,
"phone"=>$phone,
"send_sms"=> true,
"allow_repeated_payments"=>false,
"redirect_url" => "http://localhost/bteacher/thankyou.php"
//"webhook"=>
));
$pay_url = $response['longurl'];
header("Location: $pay_url");
exit();
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
?>