array (
"name" => $_POST['applicant_name'],
"email" => $_POST['email_id'],
"contact" => $_POST['mobile_number']
),
"type" => "link",
"view_less" => 1,
"amount" => (int)$product_price * 100,
"currency" => "INR",
"description" => "Registration Fee",
"reminder_enable" => false,
"sms_notify" => 0,
"email_notify" => 0,
"expire_by" => 1793630556,
"options" => array (
"checkout" => array (
"readonly" => array (
"email" => "1",
"contact" => "1"
)
)
)
);
$header_data = array (
"Content-type: application/json"
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.razorpay.com/v1/invoices/",
CURLOPT_USERPWD => $user_pwd,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($post_data),
CURLOPT_HTTPHEADER => $header_data
));
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response);
$payment_link = $data->short_url;
// Mailer
$host_name = $_SERVER['HTTP_HOST'];
$website_name = strtoupper($host_name);
$mail = new PHPMailer(true);
try {
// $mail->isSMTP();
// // $mail->SMTPDebug = 2;
// $mail->CharSet = 'UTF-8';
// $mail->Host = $host_name;
// $mail->SMTPAuth = true;
// $mail->Username = 'order@'.$host_name.'';
// $mail->Password = 'freeDOM@611#';
// $mail->SMTPSecure = 'tls';
// $mail->Port = 587;
// $mail->setFrom('order@'.$host_name.'', $website_name);
// $mail->addAddress($_POST["email_id"]);
// $mail->isHTML(true);
// $mail->Subject = "⚠️Ref : Your ".$_POST['form_name']." Form";
// $mail->Body =
// "
// Dear ".$_POST['applicant_name'].",
//
// Thank you for submitting your application for ".$_POST['form_name']." on our website.
//
// This mail is an acknowledgement of successful submission of your application, on our website. This mail does not confirm the
// payment status against the submitted application.
//
// If you have already made payment, then please sit back and relax, your order will be processed and acknowledgement of the same will be sent on your registered email address.
//
// If you have not yet made the payment, processing of your application will not be done unless you make the payment. Click on the link below to make payment.
//
// Pay Here
//
// Regards,
// Team Processing,
// For Order Status: order@".$host_name."
// ";
// $mail->send();
}
catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>