Managed to record all info in its test database, if i may ask one last thing (hopefuly), with payment has closes payment procesing to record all this in database logs?
I figured out how to do returnOK, returnFail link, but have problems figuring out how to record this transaction id in db before i move to payment procesors website.
$amount = $_POST['post_amount'];
$currency = $_POST['post_currency'];
$ip = $_POST['post_ip'];
$description = urlencode(htmlspecialchars($_POST['post_description'], ENT_QUOTES));
$language = $_POST['post_language'];
$extra = $_POST['extra'];
$merchant = new Merchant($ecomm_server_url, $cert_url, $cert_pass, 1);
$resp = $merchant -> startSMSTrans($amount, $currency, $ip, $description, $language);
if (substr($resp,0,14)=="TRANSACTION_ID") {
$trans_id = substr($resp,16,28);
$url = $ecomm_client_url."?trans_id=". urlencode($trans_id);
$sql = mysql_query("INSERT INTO $db_table_transaction VALUES ('', '$trans_id', '$amount', '$currency', '$ip', '$description', '$language', '---', '???', '???', '???', '???', now(), '$resp', '', '')", '$extra');
header("Location: $url");
if (!$sql) {
die('*** Invalid query: ' . mysql_error());
}
}else{
echo $resp;
$resp = htmlentities($resp, ENT_QUOTES);
$sql = mysql_query("INSERT INTO $db_table_error VALUES ('', now(), 'startsmstrans', '$resp')
");
if (!$sql) {
die('*** Invalid query2: ' . mysql_error());
}
}
mysql_close($link);