Paypal transaction ID

Hi,



Can anyone tell me which table store the payapl transction ID?

Payment information is encrypted and stored in the cscart_order_detail table.

OH~ [color=#282828][font=arial, verdana, tahoma, sans-serif]It should be in the cscart_order_data table, with type = “P”. [/font][/color]



just find that in other post [url=“payment transaction id's - Developers' Corner - CS-Cart Community Forums”]payment transaction id's - Developers' Corner - CS-Cart Community Forums





But how do i decrypt it for checking

go look in core/fn.cart.php for how it's done. Search for 'payment_info' and you'll find it.

It is decrypted for you when you view the order. Are you doing some coding that needs this info?

I need to generate a paypal feed for our customer service to check the payment successful or not.



so that they can export the feed everyday and no need to paste one by one…

So do I just use “unserialize” then will retrieve the data?

$payment_info = db_get_field(“SELECT data FROM ?:order_data WHERE order_id = ?i AND type = 'P'”, $order_id);

if (!empty($payment_info)) {

$payment_info = unserialize(fn_decrypt_text($payment_info));

} else {

$payment_info = array();

}



This is the code in the file, but i cannot just use “unserialize($row[8])” in my generate program.

Could you help me?

shouldn't you unserialize $payment_info?



unserialize($payment_info);

You have to decrypt the text field first, then unserialize it.

Why don't you just use the order status to determine if the payment was successful from paypal or not. If the order is “Open” then it has not been successful (or has not completed properly) and if it's Processed then it has.

[quote name='tbirnseth' timestamp='1335212703' post='135309']

You have to decrypt the text field first, then unserialize it.

Why don't you just use the order status to determine if the payment was successful from paypal or not. If the order is “Open” then it has not been successful (or has not completed properly) and if it's Processed then it has.

[/quote]



But they need to check on paypal account, so they want to have a order list to check.

Here is my sql.



SELECT cscart_order_details.order_id, cscart_product_descriptions.product_id, cscart_product_descriptions.product, item_id, product_code, price, amount, timestamp AS time, cscart_order_data.data FROM cscart_order_details LEFT JOIN cscart_product_descriptions ON cscart_order_details.product_id = cscart_product_descriptions.product_id

LEFT JOIN cscart_orders ON cscart_order_details.order_id = cscart_orders.order_id

LEFT JOIN cscart_order_data ON cscart_orders.order_id = cscart_order_data.order_id AND cscart_order_data.type='P' WHERE cscart_order_details.order_id > 123456 ORDER BY order_id ASC



so what should i do with above sql? how to decrypt cscart_order_data.data?

You have to extract payment info separately, decrypt, unserialize and then add to the array of order data. It can't be done in sql directtly, it must be done in PHP.

[quote name='tbirnseth' timestamp='1335306196' post='135364']

You have to extract payment info separately, decrypt, unserialize and then add to the array of order data. It can't be done in sql directtly, it must be done in PHP.

[/quote]



actually, I use PHP, but base on the SQL code i make, how do i make it? i have try unserialize "cscart_order_data.data" which is unserialize($row[8]) or unserialize[size=4]b also not work. Could you help me?[/font][/b][/size]

copy/pasted the query and code from core/fn.cart.php.

If you can't do it from that, I probably can't explain it here.