���� JFIF fdasasfas213sdaf
Server IP : 88.222.243.16 / Your IP : 216.73.216.200 Web Server : LiteSpeed System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64 User : u479334040 ( 479334040) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u479334040/domains/adjointinfocom.com/public_html/ |
Upload File : |
<?php $base_url="https://adjointinfocom.com"; $payMode="production"; // for live change it to "production" if($payMode=='production'){ // live api details define('client_id',"46664145a544fc253377af7a76146664"); define('secret_key',"cfsk_ma_prod_d4fe4ab1a7579616f3265839f3ac43b8_f35acb8c"); $APIURL="https://api.cashfree.com/pg/orders"; }else{ // test api details define('client_id',"TEST395335a9a8790407e8b85a3af0533593"); define('secret_key',"TESTb3e39a0ad997f4c6ee93bc4c11c4ffd86ba7d4b4"); $APIURL="https://sandbox.cashfree.com/pg/orders"; } //===========*********************============ if(isset($_POST['amount']) && $_POST['amount'] !='' && $_POST['mobile'] !='' && $_POST['cust_name'] !='' && $_POST['email'] !=''){ function generateOrderId($prefix = '') { // Use uniqid with more entropy $uniqid = uniqid($prefix, true); $randomNumber = mt_rand(100000, 999999); $orderId = $uniqid . $randomNumber; $orderId = hash('sha256', $orderId); $orderId = substr($orderId, 0, 20); return strtoupper($orderId); } $orderId = generateOrderId('ORD_'); $orderAmount=$_POST['amount']; $customer_id=uniqid(); $customer_name=$_POST['cust_name']; $customer_email=$_POST['email']; $customer_phone=$_POST['mobile']; $paymentSessionId=''; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $APIURL, 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 =>'{ "order_id":"'.$orderId.'", "order_amount": '.$orderAmount.', "order_currency": "INR", "customer_details": { "customer_id": "'.$customer_id.'", "customer_name": "'.$customer_name.'", "customer_email": "'.$customer_email.'", "customer_phone": "'.$customer_phone.'" }, "order_meta": { "return_url": "'.$base_url.'/success.php?order_id='.$orderId.'", "notify_url":"'.$base_url.'/callback.php", "payment_methods": "cc,dc,upi" } }', CURLOPT_HTTPHEADER => array( 'X-Client-Secret: '.secret_key, 'X-Client-Id: '.client_id, 'Content-Type: application/json', 'Accept: application/json', 'x-api-version: 2023-08-01' ), )); $response = curl_exec($curl); curl_close($curl); //echo $response; $resData=json_decode($response); if(isset($resData->cf_order_id) && $resData->cf_order_id !=''){ $cf_order_id=$resData->cf_order_id; $order_id=$resData->order_id; $payment_session_id=$resData->payment_session_id; $paymentSessionId=$payment_session_id; }else{ echo $response; } ?> <?php if(isset($paymentSessionId) && $paymentSessionId !=''){ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Payment Confirmation</title> <script src="https://sdk.cashfree.com/js/v3/cashfree.js"></script> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; } .infoBox { background-color: #fff; width: 400px; margin: 50px auto; padding: 20px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); } .infoBox h5 { text-align: center; color: #333; font-size: 24px; margin-bottom: 20px; } table { width: 100%; border-collapse: collapse; } td { padding: 8px; font-size: 16px; color: #333; } td:nth-child(1) { font-weight: bold; } td:nth-child(3) { text-align: right; } .amount { color: green; font-weight: bold; font-size: 18px; } button { background-color: #28a745; color: #fff; border: none; padding: 10px 20px; font-size: 16px; width: 100%; cursor: pointer; border-radius: 5px; transition: background-color 0.3s ease; } button:hover { background-color: #218838; } @media (max-width: 600px) { .infoBox { width: 90%; padding: 15px; } .infoBox h5 { font-size: 20px; } td { font-size: 14px; } button { font-size: 14px; } } </style> </head> <body> <div class="infoBox"> <h5>Confirm Your Details</h5> <table> <tr> <td>Name</td> <td>:</td> <td><?php echo $customer_name; ?></td> </tr> <tr> <td>Email</td> <td>:</td> <td><?php echo $customer_email; ?></td> </tr> <tr> <td>Mobile No.</td> <td>:</td> <td><?php echo $customer_phone; ?></td> </tr> <tr> <td>Pay Amount</td> <td>:</td> <td class="amount"><?php echo "Rs. " . $orderAmount; ?></td> </tr> <tr> <td colspan="3"> <button type="button" id="renderBtn"> Confirm & Pay </button> </td> </tr> </table> </div> <script> const cashfree = Cashfree({ mode: "<?php echo $payMode ?>" //or production, }); document.getElementById("renderBtn").addEventListener("click", () => { cashfree.checkout({ paymentSessionId: "<?php echo $paymentSessionId ?>" }); }); </script> </body> </html> <?php } }else{ echo "<h5>Payment request failed</h5>"; } ?>