Проверка успешности отправки транзакции в реселлерклубе

Интеграция с платежным шлюзом Resellerclub:
http://manage.uk.resellerclub.com/kb/servlet/KBServlet/faq411.html
Мне нужно отправить сообщение об успешной транзакции в resellerclub, чтобы назначить купленный продукт клиенту. delivery.php дает статус транзакции.

Мой postpayment.php

<?php
session_start();
///session_save_path("./");
require("functions.php");
require ("delivery.php");
?>



<html>
<head><title>Post Payment</title></head>
<body bgcolor="white">
<font size=4>
<?php
$key = "AfKdTauRYnPQUFztasCNkr9yCLCfeQhd";


$transId = $_REQUEST['pid'];
$rid = $_REQUEST['rid'];

# Display/execute steps according to status.
echo "Transaction ID: " . $pid . "<br>";
echo "Gateway ID: " . $rid . "<br>";
echo "Transaction Status: " . $_SESSION['TRANSACTION_STATUS'] . "<br>";
echo "Redirect URL: ". $_SESSION['redirecturl'] . "<br><br>";

# Check transaction status value
if($_SESSION['TRANSACTION_STATUS'] == "SUCCESS")
$status = "Y";
else
$status = "N";


srand((double)microtime()*1000000);
$rkey = rand();

$redirectUrl = $_SESSION['redirecturl'];
$sellingCurrencyAmount = $_SESSION['sellingcurrencyamount'];
$accountingCurrencyAmount = $_SESSION['accountingcurencyamount'];

$checksum      =generateChecksum($transId,$sellingCurrencyAmount,$accountingCurrencyAmount,$status, $rkey,$key);

echo "<a href=" . $redirectUrl . "?" . "transid=" . $transId . "&status=" .      $status . "&rkey=" . $rkey . "&checksum=" . $checksum . "&sellingamount=" . $sellingCurrencyAmount . "&accountingamount=" . $accountingCurrencyAmount . ">"  . "</a>";

$rURL = $redirectUrl . "?" . "transid=" . $transId . "&status=" . $status .  "&rkey=" . $rkey . "&checksum=" . $checksum . "&sellingamount=" . $sellingCurrencyAmount . "&accountingamount=" . $accountingCurrencyAmount;

echo "<br><br>";
?>
Redirecting....
<form name="f1" method="post" action="<?php echo $redirectUrl;?>">
<input type="hidden" name="transid" value="<?php echo $transId;?>">
<input type="hidden" name="status" value="<?php echo $status;?>">
<input type="hidden" name="rkey" value="<?php echo $rkey;?>">
<input type="hidden" name="checksum" value="<?php echo $checksum;?>">
<input type="hidden" name="sellingamount" value="<?php echo  $sellingCurrencyAmount;?>">
<input type="hidden" name="accountingamount" value="<?php echo     $accountingCurrencyAmount;?>">

<input type="submit" value="Click here to Continue"><BR>
</form>



<script>
window.location = "<?php echo $rURL; ?>";
</script>

Тем не менее платежи показывают authstarted, и мне нужно вручную подтвердить платежи. Любое решение ??

страница postpayment.php не видна напрямую во время оформления заказа. Я пытался добавить

<script type="text/javascript">
window.onload=function(){
var auto = setTimeout(function(){ autoRefresh(); }, 100);

function submitform(){
alert('test');
document.forms["myForm"].submit();
}

function autoRefresh(){
clearTimeout(auto);
auto = setTimeout(function(){ submitform(); autoRefresh(); }, 10000);
}
}
</script>

Это для автоматической отправки формы при загрузке страницы. До сих пор не работает..

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …