Файловый менеджер - Редактировать - /home/d46091/e-udyogaadhaar.com/cashfree-response.php
Назад
<?php session_start(); ob_start(); include_once('./config.php'); include_once('./vendor/autoload.php'); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; function generate($length = 7) { $chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars)-1)]; } return 'SAVE_RESPONSE_' . strtoupper($token); } $response = file_get_contents('php://input'); file_put_contents('./cashfree-log/'.generate(13), $response); $data = explode('&', urldecode($response)); $secretKey = CASHFREE_KEY_SECRET; $orderId = $_POST["orderId"]; $orderAmount = $_POST["orderAmount"]; $referenceId = $_POST["referenceId"]; $txStatus = $_POST["txStatus"]; $paymentMode = $_POST["paymentMode"]; $txMsg = $_POST["txMsg"]; $txTime = $_POST["txTime"]; $signature = $_POST["signature"]; $data = $orderId.$orderAmount.$referenceId.$txStatus.$paymentMode.$txMsg.$txTime; $hash_hmac = hash_hmac('sha256', $data, $secretKey, true) ; $computedSignature = base64_encode($hash_hmac); if ($signature == $computedSignature) { if ($txStatus == 'SUCCESS') { $sql = " UPDATE msme_form SET payment_id = '".$referenceId."', payment_status = 'Paid' WHERE order_id = '".$orderId."' "; $result = $conn->query($sql); $_SESSION['orderId'] = $orderId; $sql = "SELECT * FROM msme_form WHERE order_id = '".$_SESSION['orderId']."'"; $result = $conn->query($sql); $row = $result->fetch_assoc(); // echo $row['email_id']; $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'e-udyogaadhaar.com'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@e-udyogaadhaar.com'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@e-udyogaadhaar.com", "Eudyog Aadhaar"); $mail->addAddress("".$row['email_id'].""); $mail->isHTML(true); $mail->Subject = "Payment Successful For ".$row['form_name'].""; $mail->Body = " <span style='color:black'>Dear <strong>".$row['applicant_name']."</strong>, <br><br> Your payment for ".$row['form_name']." is successful. <br> <strong>NOTE : Final Certificate will be delivered within 2-3 working days.</strong> <br><br> Your order details are as follows: <br> APPLICANT NAME: ".strtoupper($row["applicant_name"])."<br> EMAIL ID: ".strtoupper($row['email_id'])."<br> MOBILE NUMBER: ".strtoupper($row['mobile_number'])."<br> AMOUNT PAID: ".strtoupper($row['total_amount'])."<br> PAYMENT ID: ".strtoupper($row["payment_id"])."<br> ORDER ID: ".strtoupper($row['order_id'])."<br> PAYMENT STATUS: PAID <br><br> Regards,<br> Team Processing <div style='background: #005ea5; padding: 15px; margin: 15px 0; display: block'> <span style='font-size:18px; color: #ffffff'> Note:<br> 1) Your application along with payment has been received and the same will be processed by our experts in next 24 - 48 working hours.<br> <strong>2) At the time of processing, one link will be sent to you for OTP collection. We collect OTP only through system generated automatic links, linked to client's application to reduce human intervention.</strong><br> 3) Normally certificate generation takes 10 - 15 working days. However due to restrictions placed by COVID-19, this may take longer than usual. </span> </div> <br> Due to system upgradation on account of financial year change, processing of certificates will be delayed. <br> Your application has been queued up for processing and the final certificate will be sent on your registered email address within 7 - 10 working days. <br> We expect your cooperation for the same. <br> <span>For Order Status / Queries / Grievance <a href='https://eudyogaadhaar.org/complaint-form.php'>Click Here</a> </span> "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@e-udyogaadhaar.com"); $mail->isHTML(true); $mail->Subject = "Payment Received For ".$row["form_name"].""; $mail->Body = " APPLICANT NAME: ".$row["applicant_name"]."<br> EMAIL ID: ".$row['email_id']."<br> MOBILE NUMBER: ".$row['mobile_number']."<br> AMOUNT PAID: ".$row['total_amount']."<br> PAYMENT ID: ".$row["payment_id"]."<br> ORDER ID: ".$row['order_id']."<br> PAYMENT STATUS: Paid "; $mail->send(); header ('location: ./success.php'); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } else { echo 'Payment Failed'; } } else { echo 'Payment Failed'; } ?> <!-- Event snippet for Purchase new one conversion page --> <!-- <script> gtag('event', 'conversion', { 'send_to': 'AW-618236684/8G6oCJiasusBEIyW5qYC', 'transaction_id': '' }); </script> -->
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка