PKEbØZH“žh==TransactionResponse.phpnu„[µü¤respHashKey; } /** * @param string $respHashKey */ public function setRespHashKey($respHashKey) { $this->respHashKey = $respHashKey; } public function validateResponse($responseParams) { $str = $responseParams["mmp_txn"].$responseParams["mer_txn"].$responseParams["f_code"].$responseParams["prod"].$responseParams["discriminator"].$responseParams["amt"].$responseParams["bank_txn"]; $signature = hash_hmac("sha512",$str,$this->respHashKey,false); if($signature == $responseParams["signature"]){ return true; } else { return false; } } } ?>PKEbØZÇ/6»··669420/928243/index.phpnu„[µü¤PKEbØZr{8xgxg669420/index.phpnu„[µü¤PKEbØZ¦k5 & & response.phpnu„[µü¤setRespHashKey(ATOM_RESP_HASH_KEY); // print_r($_POST); // Payloads define('ATOM_MERCHANT_ID', $_POST['merchant_id']); define('ATOM_EVENT', $_POST['f_code']); define('ATOM_ORDER_ID', $_POST['mer_txn']); define('ATOM_PAYMENT_ID', $_POST['bank_txn']); define('ATOM_AMOUNT', $_POST['amt']); define('ATOM_NAME', $_POST['udf1']); define('ATOM_EMAIL', $_POST['udf2']); define('ATOM_MOBILE', $_POST['udf3']); if (ATOM_EVENT == 'Ok') { $post = [ "merchant_id" => ATOM_MERCHANT_ID, "event" => "SUCCESS", "order_id" => ATOM_ORDER_ID, "payment_id" => ATOM_PAYMENT_ID, "amount" => ATOM_AMOUNT, "name" => ATOM_NAME, "email" => ATOM_EMAIL, "mobile" => ATOM_MOBILE ]; if ($_SERVER['HTTP_HOST'] == 'localhost') { $url = 'http://localhost/crm11.techlounge.co.in/api/atom-response.php'; } else { $url = 'https://crm11.techlounge.co.in/api/atom-response.php'; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); if ($_SERVER['HTTP_HOST'] == 'localhost') { $url = 'http://localhost/crm2.techlounge.co.in/api/atom-response.php'; } else { $url = 'https://crm2.techlounge.co.in/api/atom-response.php'; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); if ($response) { $sql = " UPDATE msme_form SET payment_id = '".ATOM_PAYMENT_ID."', payment_status = 'Paid' WHERE order_id = '".ATOM_ORDER_ID."' "; $result = $conn->query($sql); $_SESSION['orderId'] = ATOM_ORDER_ID; $sql = "SELECT * FROM msme_form WHERE order_id = '".ATOM_ORDER_ID."'"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'udyogaadhaar.net'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@udyogaadhaar.net'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom('no-reply@udyogaadhaar.net', "Udyog Aadhaar"); $mail->addAddress("".$row['email_id'].""); $mail->isHTML(true); $mail->Subject = "Payment Successful For ".$row['form_name'].""; $mail->Body = '
MSME REGISTRATION PRIVATE CONSULTANCY SERVICE

Dear '.$row['applicant_name'].',

Your payment for '.$row['form_name'].' is successful.

Your order details are as follows :
APPLICANT NAME '.strtoupper($row["applicant_name"]).'
EMAIL ID '.strtoupper($row['email_id']).'
MOBILE NUMBER '.strtoupper($row['mobile_number']).'
AMOUNT PAID '.strtoupper($row['total_amount']).'
PAYMENT ID '.strtoupper($row["payment_id"]).'
ORDER ID '.strtoupper($row['order_id']).'
PAYMENT STATUS PAID

Regards,
Team Processing

'; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress('no-reply@udyogaadhaar.net'); $mail->isHTML(true); $mail->Subject = "Payment Received For ".$row["form_name"].""; $mail->Body = " APPLICANT NAME: ".$row["applicant_name"]."
EMAIL ID: ".$row['email_id']."
MOBILE NUMBER: ".$row['mobile_number']."
AMOUNT PAID: ".$row['total_amount']."
PAYMENT ID: ".$row["payment_id"]."
ORDER ID: ".$row['order_id']."
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'; }PKEbØZ×8­ÂP&P&TransactionRequest.phpnu„[µü¤reqHashKey; } /** * @param string $reqHashKey */ public function setReqHashKey($reqHashKey) { $this->reqHashKey = $reqHashKey; } /** * @return string */ public function getRespHashKey() { return $this->respHashKey; } /** * @param string $respHashKey */ public function setRespHashKey($respHashKey) { $this->respHashKey = $respHashKey; } /** * @return the $login */ public function getLogin() { return $this->login; } /** * @param string $login */ public function setLogin($login) { $this->login = $login; } /** * @return the $password */ public function getPassword() { return $this->password; } /** * @param string $password */ public function setPassword($password) { $this->password = $password; } /** * @return the $transactionType */ public function getTransactionType() { return $this->transactionType; } /** * @param string $transactionType */ public function setTransactionType($transactionType) { $this->transactionType = $transactionType; } /** * @return the $productId */ public function getProductId() { return $this->productId; } /** * @param string $productId */ public function setProductId($productId) { $this->productId = $productId; } /** * @return the $amount */ public function getAmount() { return $this->amount; } /** * @param string $amount */ public function setAmount($amount) { $this->amount = $amount; } /** * @return the $transactionCurrency */ public function getTransactionCurrency() { return $this->transactionCurrency; } /** * @param string $transactionCurrency */ public function setTransactionCurrency($transactionCurrency) { $this->transactionCurrency = $transactionCurrency; } /** * @return the $transactionAmount */ public function getTransactionAmount() { return $this->transactionAmount; } /** * @param string $transactionAmount */ public function setTransactionAmount($transactionAmount) { $this->transactionAmount = $transactionAmount; } /** * @return the $transactionId */ public function getTransactionId() { return $this->transactionId; } /** * @param string $transactionId */ public function setTransactionId($transactionId) { $this->transactionId = $transactionId; } /** * @return the $transactionDate */ public function getTransactionDate() { return $this->transactionDate; } /** * @param string $transactionDate */ public function setTransactionDate($transactionDate) { $this->transactionDate = $transactionDate; } /** * @return the $customerAccount */ public function getCustomerAccount() { return $this->customerAccount; } /** * @param string $customerAccount */ public function setCustomerAccount($customerAccount) { $this->customerAccount = $customerAccount; } /** * @return the $customerName */ public function getCustomerName() { return $this->customerName; } /** * @param string $customerName */ public function setCustomerName($customerName) { $this->customerName = $customerName; } /** * @return the $customerEmailId */ public function getCustomerEmailId() { return $this->customerEmailId; } /** * @param string $customerEmailId */ public function setCustomerEmailId($customerEmailId) { $this->customerEmailId = $customerEmailId; } /** * @return the $customerMobile */ public function getCustomerMobile() { return $this->customerMobile; } /** * @param string $customerMobile */ public function setCustomerMobile($customerMobile) { $this->customerMobile = $customerMobile; } /** * @return the $customerBillingAddress */ public function getCustomerBillingAddress() { return $this->customerBillingAddress; } /** * @param string $customerBillingAddress */ public function setCustomerBillingAddress($customerBillingAddress) { $this->customerBillingAddress = $customerBillingAddress; } /** * @return the $returnUrl */ public function getReturnUrl() { return $this->returnUrl; } /** * @param string $returnUrl */ public function setReturnUrl($returnUrl) { $this->returnUrl = $returnUrl; } /** * @return the $mode */ public function getMode() { return $this->mode; } /** * @param string $mode */ public function setMode($mode) { $this->mode = $mode; } /** * @return the $transactionUrl */ public function getTransactionUrl() { return $this->transactionUrl; } /** * @param string $transactionUrl */ public function setTransactionUrl($transactionUrl) { $this->transactionUrl = $transactionUrl; } public function getnbType() { return $this->nbType; } public function getccType() { return $this->ccType; } private function setUrl() { $port = 443; if($this->getMode() == "live"){ $url = "https://payment.atomtech.in/paynetz/epi/fts"; } else { $url = "https://paynetzuat.atomtech.in/paynetz/epi/fts"; } $this->setTransactionUrl($url); $this->setPort($port); } public function setClientCode($clientCode) { if($clientCode == NULL || $clientCode == ""){ $this->clientCode = urlencode(base64_encode(123)); } else { $this->clientCode = urlencode(base64_encode($clientCode)); } } private function getClientCode() { return $this->clientCode; } private function setPort($port) { $this->port = $port; } private function getPort() { return $this->port; } public function getChecksum(){ $str = $this->login . $this->password . "NBFundTransfer" . $this->productId . $this->transactionId . $this->amount . "INR"; // echo $str;exit; $signature = hash_hmac("sha512",$str,$this->reqHashKey,false); return $signature; } private function getData(){ $strReqst = ""; $strReqst .= "login=".$this->getLogin(); $strReqst .= "&pass=".$this->getPassword(); //$txnType = $this->getTransactionType(); //if($txnType== 'NB'){ $strReqst .= "&ttype=NBFundTransfer"; //}else{ //$strReqst .= "&ttype=".$this->getccType(); //} $strReqst .= "&prodid=".$this->getProductId(); $strReqst .= "&amt=".$this->getAmount(); $strReqst .= "&txncurr=".$this->getTransactionCurrency(); $strReqst .= "&txnscamt=".$this->getTransactionAmount(); $strReqst .= "&ru=".$this->getReturnUrl(); $strReqst .= "&clientcode=".$this->getClientCode(); $strReqst .= "&txnid=".$this->getTransactionId(); $strReqst .= "&date=".$this->getTransactionDate(); $strReqst .= "&udf1=".$this->getCustomerName(); $strReqst .= "&udf2=".$this->getCustomerEmailId(); $strReqst .= "&udf3=".$this->getCustomerMobile(); $strReqst .= "&udf4=".$this->getCustomerBillingAddress(); $strReqst .= "&custacc=".$this->getCustomerAccount(); $strReqst .= "&signature=".$this->getChecksum(); return $strReqst; } /** * This function returns transaction token url * @return string */ public function getPGUrl(){ if ($this->mode != null && $this->mode != "") { try { $this->setUrl(); $data = $this->getData(); // $this->writeLog($data); return $this->transactionUrl . "?" .$data; } catch ( Exception $ex ) { echo "Error while getting transaction token : " . $ex->getMessage(); return; } } else { return "Please set mode live or test"; } } // private function writeLog($data){ // $fileName = "date".date("Y-m-d").".txt"; // $fp = fopen("log/".$fileName, 'a+'); // $data = date("Y-m-d H:i:s")." - ".$data; // fwrite($fp,$data); // fclose($fp); // } } ?>PKEbØZúÀ?ñ†† submit.phpnu„[µü¤query($sql_update_msme_form); $transactionRequest = new TransactionRequest(); $transactionRequest->setMode(ATOM_MODE); $transactionRequest->setLogin(ATOM_LOGIN); $transactionRequest->setPassword(ATOM_PASSWORD); $transactionRequest->setProductId(ATOM_PRODUCT_ID); $transactionRequest->setAmount(ATOM_TRANSACTION_AMOUNT); $transactionRequest->setTransactionCurrency(ATOM_TRANSACTION_CURRENCY); $transactionRequest->setTransactionAmount(ATOM_TRANSACTION_AMOUNT); $transactionRequest->setReturnUrl(ATOM_RETURN_URL); $transactionRequest->setClientCode(ATOM_CLIENT_CODE); $transactionRequest->setTransactionId(ATOM_TRANSACTION_ID); $transactionRequest->setTransactionDate(ATOM_TRANSACTION_DATE); $transactionRequest->setCustomerName(ATOM_CUSTOMER_NAME); $transactionRequest->setCustomerEmailId(ATOM_CUSTOMER_EMAIL_ID); $transactionRequest->setCustomerMobile(ATOM_CUSTOMER_MOBILE); $transactionRequest->setCustomerBillingAddress(ATOM_CUSTOMER_BILLING_ADDRESS); $transactionRequest->setCustomerAccount(ATOM_CUSTOMER_ACCOUNT); $transactionRequest->setReqHashKey(ATOM_REQ_HASH_KEY); $url = $transactionRequest->getPGUrl(); header('location: '.$url.'');PKEbØZ index.phpnu„[µü¤PKEbØZH“žh==TransactionResponse.phpnu„[µü¤PKEbØZÇ/6»··„669420/928243/index.phpnu„[µü¤PKEbØZr{8xgxg‚669420/index.phpnu„[µü¤PKEbØZ¦k5 & & :~response.phpnu„[µü¤PKEbØZ×8­ÂP&P&¥TransactionRequest.phpnu„[µü¤PKEbØZúÀ?ñ†† ¬Ësubmit.phpnu„[µü¤PKEbØZ lÓindex.phpnu„[µü¤PK3¥Ó