Where is transaction id for a successful payment for an order from payment gateway stored in cs-cart?
Need field and table name ?
Where is transaction id for a successful payment for an order from payment gateway stored in cs-cart?
Need field and table name ?
Hello! That data can be in the "cscart_order_transactions" table. The fields are called "payment_id" and "transaction_id".
This is a bit strange this table is empty for me and i do get trasaction id on my orders ? seems its being stored somewhere else.
This is a bit strange this table is empty for me and i do get trasaction id on my orders ? seems its being stored somewhere else.
Then payment data is in the "cscart_order_data" table. The field is called "data". But there is special data format.
how to read the same > also whats the length of this field ?
how to read the same > also whats the length of this field ?
You can create a custom php file in your cs-cart root folder, for example test.php. And put into that file the following content:
define(‘AREA’, ‘A’);
define(‘ACCOUNT_TYPE’, ‘admin’);require(dirname(FILE) . ‘/init.php’);
$orders_data = db_get_array(“SELECT * FROM ?:order_data WHERE type = ?s”, ‘P’);
if (!empty($orders_data)) {
foreach ($orders_data as $o_data) {
if (!empty($o_data[‘data’])) {
$payment_info = unserialize(fn_decrypt_text($o_data[‘data’]));
if (!empty($payment_info)) {
fn_print_r(“Order #” . $o_data[‘order_id’], $payment_info);
}
}
}
}fn_print_die(“end”);
And run it in your browser by the following link: [your_site_url]/test.php
ok thanks will try and let u know the result.
The type is 'P' and the format is serialized and encrypted.
So you read the order_data with type=='P' and order_id=[order_id] and then decrypt the result and then unserialize it.
The type is 'P' and the format is serialized and encrypted.
So you read the order_data with type=='P' and order_id=[order_id] and then decrypt the result and then unserialize it.
thanks mate for the explanation, really appreciated.