У меня есть настройка кода платежного шлюза на моем Общий хостинг Linux сервер по этому URL (тестовая ссылка):
Я вдруг начал получать HTTP 403 ошибка по этой ссылке, даже не изменив ни одной строки кода.
Интересно, если я удалю redirecturl=http%3A%2F%2Fmanage.india.resellerclub.com%2Fservlet%2FTestCustomPaymentAuthCompletedServlet
параметр из URL, ошибка перестает появляться, но тогда это нарушит требование перенаправления URL моего платежного шлюза для завершения платежа.
Этот код принимает платежи от Razorpay и перенаправляет пользователя на мой ResellerClub
учетная запись.
Вот мой код:
<?php
// if (session_status !== PHP_SESSION_ACTIVE) {
session_start();
// }
require("functions.php"); //file which has required functions
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="https://transact.theadm.in/favi.ico">
<title>Order Summary | Payment Page</title>
<!-- Bootstrap core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<style>
html {
position: relative;
min-height: 100%;
}
.container {
width: auto;
max-width: 680px;
padding: 0 15px;
}
</style>
</head>
<body>
<?php
$key = "XXXXX"; //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 = $_GET["paymenttypeid"]; //payment type id
//echo $paymentTypeId;
$transId = $_GET["transid"]; //This refers to a unique transaction ID which we generate for each transaction
$userId = $_GET["userid"]; //userid of the user who is trying to make the payment
$userType = $_GET["usertype"]; //This refers to the type of user perofrming this transaction. The possible values are "Customer" or "Reseller"$transactionType = $_GET["transactiontype"]; //Type of transaction (ResellerAddFund/CustomerAddFund/ResellerPayment/CustomerPayment)
$invoiceIds = $_GET["invoiceids"]; //comma separated Invoice Ids, This will have a value only if the transactiontype is "ResellerPayment" or "CustomerPayment"$debitNoteIds = $_GET["debitnoteids"]; //comma separated DebitNotes Ids, This will have a value only if the transactiontype is "ResellerPayment" or "CustomerPayment"
$sellingCurrencyAmount = $_GET["sellingcurrencyamount"]; //This refers to the amount of transaction in your Selling Currency
$accountingCurrencyAmount = $_GET["accountingcurrencyamount"]; //This refers to the amount of transaction in your Accounting Currency
$description = $_GET["description"];
if($transactionType == "CustomerAddFund" || $transactionType=="ResellerAddFund")
$des2="Add Funds <i>(INR ".$sellingCurrencyAmount.")</i>";
else
$des2= $description. " <i>(INR " .$sellingCurrencyAmount. ")</i>";
$redirectUrl = $_GET["redirecturl"]; //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;
$RazorPayAmount=($accountingCurrencyAmount/10)*1000;
echo <<<FORM
<div class="container">
<div class="page-header">
<h2><img src="https://transact.theadm.in/logo.png" width="279" height="40"/> <span class="pull-right">Order Summary</span></h2>
</div>
<br />
<p class="lead">{$des2} <span class="lead pull-right">₹{$accountingCurrencyAmount}</span></p>
<br />
<p>Click on the Pay Now button below to finalize your order via our our payment provider's secure environment.</p>
<form name="paymentpage" action="https://transact.theadm.in/in/postpayment.php" class="text-right">
<script
src="https://checkout.razorpay.com/v1/checkout.js"data-key="XXXXX"data-amount="{$RazorPayAmount}"data-name="TheAdm.in"data-description="{$description}"data-netbanking="true"data-prefill.name="{$_GET["name"]}"data-prefill.email="{$_GET["emailAddr"]}"data-prefill.contact="{$_GET["telNo"]}"data-notes.shopping_order_id="{$transId}">
</script>
</form>
</div>
FORM;
}
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>
Я перепробовал все, что знаю, но эта ошибка, похоже, не решена. Может ли кто-нибудь помочь мне?
Задача ещё не решена.
Других решений пока нет …