Currently I have integrate the paypal with my site and this is working after successful payment. I have set IPN so that this can be update in my Database. But in database only few variable are inserted like PAYMENT_ID, Payment_Status,TXN_ID, Country_Code
. This is code for inserting this data in database.
//Payment data
$item_number = $_POST['item_number'];
$txn_id = $_POST['txn_id'];
$payment_gross = $_POST['mc_gross'];
$currency_code = $_POST['mc_currency'];
$payment_status = $_POST['payment_status'];
//Check if payment data exists with the same TXN ID.
$prevPayment = $db->query("SELECT payment_id FROM payments WHERE txn_id = '".$txn_id."'");
if($prevPayment->num_rows > 0){
exit();
}else{
//Insert tansaction data into the database
$insert = $db->query("INSERT INTO payments(item_number,txn_id,payment_gross,currency_code,payment_status) VALUES('".$item_number."','".$txn_id."','".$payment_gross."','".$currency_code."','".$payment_status."')");
}
I want to add User id and PostURL of the Post from where this payment is made.
Or some any unique identifier so that I can cross which user have make which post payment .