Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ynormeco
/
.trash
/
ynorme.in
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ynormeco/.trash/ynorme.in/paymentpage.php
<?php session_start(); require("functions.php"); //file which has required functions require('makepayment/config.php'); require('makepayment/razorpay-php/Razorpay.php'); use Razorpay\Api\Api; ?> <html> <head><title>Payment Page </title> <script language="JavaScript"> function successClicked() { document.paymentpage.submit(); } function failClicked() { document.paymentpage.status.value = "N"; document.paymentpage.submit(); } function pendingClicked() { document.paymentpage.status.value = "P"; document.paymentpage.submit(); } </script> </head> <body bgcolor="white"> <?php $key = "jP13oLf2l0uLupcrmObaIFHCXf7da2nq"; //replace ur 32 bit secure key , Get your secure key from your Reseller Control panel //This filter removes data that is potentially harmful for your application. It is used to strip tags and remove or encode unwanted characters. $_GET = filter_var_array($_GET, FILTER_SANITIZE_STRING); //Below are the parameters which will be passed from foundation as http GET request $paymentTypeId = 12; //payment type id $transId = 13; //This refers to a unique transaction ID which we generate for each transaction $userId = "schfgv@gmail.com"; //userid of the user who is trying to make the payment $userType = "custemer"; //This refers to the type of user perofrming this transaction. The possible values are "Customer" or "Reseller" $transactionType ="CustomerAddFund"; //Type of transaction (ResellerAddFund/CustomerAddFund/ResellerPayment/CustomerPayment) $invoiceIds = "ResellerPayment"; //comma separated Invoice Ids, This will have a value only if the transactiontype is "ResellerPayment" or "CustomerPayment" $debitNoteIds = "CustomerPayment"; //comma separated DebitNotes Ids, This will have a value only if the transactiontype is "ResellerPayment" or "CustomerPayment" $description = "sdfvdvdvdvd"; $sellingCurrencyAmount =243; //This refers to the amount of transaction in your Selling Currency $accountingCurrencyAmount = 54; //This refers to the amount of transaction in your Accounting Currency $redirectUrl = "ynorme.in"; //This is the URL on our server, to which you need to send the user once you have finished charging him $checksum = $_GET["checksum"]; //checksum for validation if(verifyChecksum($paymentTypeId, $transId, $userId, $userType, $transactionType, $invoiceIds, $debitNoteIds, $description, $sellingCurrencyAmount, $accountingCurrencyAmount, $key, $checksum)) { //YOUR CODE GOES HERE /** * since all these data has to be passed back to foundation after making the payment you need to save these data * * You can make a database entry with all the required details which has been passed from foundation. * * OR * * keep the data to the session which will be available in postpayment.php as we have done here. * * It is recommended that you make database entry. **/ $_SESSION['redirecturl']=$redirectUrl; $_SESSION['transid']=$transId; $_SESSION['sellingcurrencyamount']=$sellingCurrencyAmount; $_SESSION['accountingcurencyamount']=$accountingCurrencyAmount; $api = new Api($keyId, $keySecret); $receipt= $paymentTypeId; $amount= $sellingCurrencyAmount; $name=$_GET['name']; $des= $description; $email= $_GET['emailAddr']; $contact= $_GET['telNo']; $address= $_GET['address1']; $merchant_id= $userId; $amount1 = $amount*100; echo "<br><br><p align='center'> <img src='https://www.ynorme.com/images/logo.png' > </p><br>"; echo "<h2 align='center'> Confirm Payment Details</h2>"; echo "<p align='center' style='line-height:30px;'><strong>Customer Name :</strong> ".$_GET['name']."<br>"; echo "<strong>Email Id :</strong> ".$email."<br>"; echo "<strong>Contact Number :</strong> ".$contact."<br>"; echo "<strong>Description :</strong> ".$des."<br>"; echo "<strong>Payment Amount</strong> : ".$amount."<br></p>"; // // We create an razorpay order using orders api // Docs: https://docs.razorpay.com/docs/orders // $orderData = [ 'receipt' => $receipt, 'amount' => $amount1, // 2000 rupees in paise 'currency' => 'INR', 'payment_capture' => 1 // auto capture ]; $razorpayOrder = $api->order->create($orderData); $razorpayOrderId = $razorpayOrder['id']; $_SESSION['razorpay_order_id'] = $razorpayOrderId; $displayAmount = $amount = $orderData['amount']; $data = [ "key" => $keyId, "amount" => $amount, "name" => "$name", "description" => "$des", "image" => "https://www.ynorme.com/images/logo.png", "prefill" => [ "name" => "$name", "email" => "$email", "contact" => "$contact", ], "notes" => [ "address" => "$address", "merchant_order_id" => "$merchant_id", ], "theme" => [ "color" => "#F37254" ], "order_id" => $razorpayOrderId, ]; $json = json_encode($data); ?> <form action="makepayment/verify.php" method="POST"> <script src="makepayment/checkout.js" data-key="<?php echo $data['key']?>" data-amount="<?php echo $data['amount']?>" data-currency="INR" data-name="<?php echo $data['name']?>" data-image="<?php echo $data['image']?>" data-description="<?php echo $data['description']?>" data-prefill.name="<?php echo $data['prefill']['name']?>" data-prefill.email="<?php echo $data['prefill']['email']?>" data-prefill.contact="<?php echo $data['prefill']['contact']?>" data-notes.shopping_order_id="<?php echo $data['order_id']?>" data-order_id="<?php echo $data['order_id']?>" <?php if ($displayCurrency !== 'INR') { ?> data-display_amount="<?php echo $data['display_amount']?>" <?php } ?> <?php if ($displayCurrency !== 'INR') { ?> data-display_currency="<?php echo $data['display_currency']?>" <?php } ?> > </script> <!-- Any extra fields to be submitted with the form but not sent to Razorpay --> <!-- <input type="hidden" name="shopping_order_id" value="3456">--> <p align="center"> <input type="submit" value="Make Payment" style="width:180px; height:40px; color:#fff; background-color:#006600; border:none; border-radius:5px;" /> </p> </form> <br><br><br> <p align="center"> <a href="postpayment.php?status=N" style="text-decoration:none; color:#000000;"> <em>Click Here to Cancle Payment</em> </a> </p> <?php } else { /**This message will be dispayed in any of the following case * * 1. You are not using a valid 32 bit secure key from your Reseller Control panel * 2. The data passed from foundation has been tampered. * * In both these cases the customer has to be shown error message and shound not * be allowed to proceed and do the payment. * **/ echo "Checksum mismatch !"; } ?> </body> </html>