Hi,
I think the checkout_process.php fail to create records into cc_logrefill and cc_logpayment table. Here is some part of the epayment log I found:
Quote:
........
[12/09/2010 00:06:41]:[checkout_process.php line:316-transactionID=66 CARD FOUND IN DB (25)]
[12/09/2010 00:06:41]:[checkout_process.php line:328-transactionID=66 Update_table cc_card : credit = credit+'10' - CLAUSE : id='25']
[12/09/2010 00:06:41]:[checkout_process.php line:344-transactionID=66 Add_table cc_logrefill : date, credit, card_id, description,agent_id - VALUES '2010-09-12 00:06:41', '10', '25', 'paypal',NULL]
[12/09/2010 00:06:41]:[checkout_process.php line:350-transactionID=66 Add_table cc_logpayment : date, payment, card_id, id_logrefill, description,agent_id - VALUES '2010-09-12 00:06:41', '10', '25', '', 'paypal',NULL ]
........
If you look at the empty data field just before 'paypal' in the last line which seems like it failed to return a ID from new inserted cc_logrefill record hence no cc_logrefill inserted. That made me wonder what actually is trying to do so I had a look at checkout_process.php.
Around line: 344 -350 (see log above) I found this piece of code which I believe is the code that actually insert the new refill and payment log into the table:
Quote:
$field_insert = "date, credit, card_id, description,agent_id";
$value_insert = "'$nowDate', '".$amount_without_vat."', '$id', '".$transaction_data[0][4]."',$id_agent_insert";
$instance_sub_table = new Table("cc_logrefill", $field_insert);
$id_logrefill = $instance_sub_table -> Add_table ($DBHandle, $value_insert, null, null, 'id'); <== (*** Is this suppose to be single quote or double? ***)
write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__."-transactionID=$transactionID"." Add_table cc_logrefill : $field_insert - VALUES $value_insert");
$field_insert = "date, payment, card_id, id_logrefill, description,agent_id";
$value_insert = "'$nowDate', '".$amount_paid."', '$id', '$id_logrefill', '".$transaction_data[0][4]."',$id_agent_insert ";
$instance_sub_table = new Table("cc_logpayment", $field_insert);
$id_payment = $instance_sub_table -> Add_table ($DBHandle, $value_insert, null, null,"id");
write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__."-transactionID=$transactionID"." Add_table cc_logpayment : $field_insert - VALUES $value_insert");
Then I look at the database table structure:
Quote:
cc_logrefill Table:
Field name,Type,Allow nulls?,Key,Default value,Extras
id, bigint(20), No, Primary, NULL, auto_increment
date, timestamp, No, None, CURRENT_TIMESTAMP
credit, decimal(15,5), No, None, NULL
card_id, bigint(20), No, None, NULL
description, mediumtext, Yes, None, NULL
refill_type, tinyint(4), No, None, 0
added_invoice, tinyint(4), No, None, 0
Quote:
cc_logpayment Table:
Field name, Type, Allow nulls?, Key, Default value, Extras
id, int(11), No, Primary, NULL, auto_increment
date, timestamp, No, None, CURRENT_TIMESTAMP
payment, decimal(15,5), No, None, NULL
card_id, bigint(20), No, None, NULL
id_logrefill, bigint(20), Yes, None, NULL
description, mediumtext, Yes, None, NULL
added_refill, smallint(6), No, None, 0
payment_type, tinyint(4), No, None, 0
added_commission, tinyint(4), No, None, 0
I couldn't figure it out what caused the failing insert new records in cc_logrefill and cc_logpayment? I query the table but it remains empty after several payment attempts using the paypal module.
What I would expect to happen is when the Paypal payment processed:
- Update customer balance
- Create a new refill record
- Create a new payment record that can offset the overdue debt balance (To Pay under Customer Balance)
Please correct me if I misinterpret the process flow for the epayment.
Can anyone help? I need to properly log a refill and payment when customer make a top up epayment so we can trace what happen in payment flow.
Many thanks.