VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Payment VM 1.1 => PayPal / PayPal Pro VM 1.1 => Topic started by: thestupid on February 12, 2009, 14:39:27 PM

Title: how to store txn_id in database
Post by: thestupid on February 12, 2009, 14:39:27 PM
hello, i need to save txn_id in database, how to do this? please help me.
Title: Re: how to store txn_id in database
Post by: loop123 on February 13, 2009, 06:04:37 AM
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.
Title: Re: how to store txn_id in database
Post by: loop123 on February 14, 2009, 05:42:49 AM
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
Title: Re: how to store txn_id in database
Post by: thestupid on February 14, 2009, 08:28:29 AM
loop123 thanx alot. i will try this out.