News:

Looking for documentation? Take a look on our wiki

Main Menu

how to store txn_id in database

Started by thestupid, February 12, 2009, 14:39:27 PM

Previous topic - Next topic

thestupid

hello, i need to save txn_id in database, how to do this? please help me.

loop123

#1
in notify.php u will get txn_id returned by paypal.

but i don't know  where to store in order_payment table column name order_trans_id or elsewhere

u can write update query in notify.php to store this txn_id.

loop123

#2
u can also write code in administrator/components/com_virtuemart/html/checkout.result.php

here is the code

$transaction_id = "";

            if(isset($_POST['txn_id']))
            {   
                $transaction_id = $vmInputFilter->safeSQL($_POST['txn_id']);      //trim(stripslashes($_POST['txn_id']));
            }

$query = "UPDATE #__{vm}_order_payment SET order_payment_trans_id = '$transaction_id' WHERE order_id = '$order_id' ";

//$order_id is already fetched in else part

thestupid

loop123 thanx alot. i will try this out.