Resellerclub custom payment gateway integration : http://manage.uk.resellerclub.com/kb/servlet/KBServlet/faq411.html I need to send transaction success message to resellerclub in order to assign the purchased product to the client. delivery.php gives transaction status.
My 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>
Still the payments show authstarted and i need to manually approve the payments. Any solution ??
the page postpayment.php is not directly visible during checkout. I tried to add
<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>
This is to auto submit the form on page load. Still not working..