Eric Cho
2010-04-24 20:16:35 UTC
Hello.
I did some of test for CitrusDB.
I'm using that based on prepaycc (pre-pay Credit card), everything was fine but refund.
When I tried to refund in the Billing's refund menu (http://localhost/citrus-2.1/index.php?load=refund&type=tools&billingid=45&submit=Submit),
That records didn't exported when I tried export for one text file in the http://localhost/citrus-2.1/index.php?load=refundcc&type=tools .
(There's result file for that but content was empty.)
So, I analyzed related source, I found something miss.
1. refunded = 'y' shouldn't do there, because refund export page works as loading refunded<>'y'
tools/refund.php line 51~61 has been changed as commentation.
2. DB scheme.
DROP TABLE IF EXISTS `payment_history`;
CREATE TABLE `payment_history` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`creation_date` DATE NOT NULL DEFAULT '0000-00-00',
`transaction_code` VARCHAR(32) DEFAULT NULL,
`billing_id` INT(11) NOT NULL DEFAULT '0',
`creditcard_number` VARCHAR(16) DEFAULT NULL,
`creditcard_expire` INT(4) UNSIGNED ZEROFILL DEFAULT NULL,
`billing_amount` DECIMAL(9,2) DEFAULT NULL,
`response_code` VARCHAR(100) DEFAULT NULL,
`paid_from` DATE NOT NULL DEFAULT '0000-00-00',
`paid_to` DATE NOT NULL DEFAULT '0000-00-00',
`invoice_number` INT(128) DEFAULT NULL,
`status` SET('authorized','declined','pending','donotreactivate','collections','turnedoff','credit','canceled','cancelwfee','pastdue','noticesent','waiting') DEFAULT NULL,
`payment_type` SET('creditcard','prepaycc','check','cash','eft','nsf','discount') DEFAULT NULL,
`check_number` VARCHAR(32) DEFAULT NULL,
`avs_response` VARCHAR(32) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `billing_id_index` (`billing_id`)
) ENGINE=MYISAM AUTO_INCREMENT=142 DEFAULT CHARSET=latin1;
(To sum up, there's only change of adding one enum for payment_type column as 'prepaycc' next to 'creditcard')
3. Not solved yet, I passed this step by wrote response as 'No' in the import file.
tools/importcc.php line 79~
if ($response_id == 'N') { if ($transaction_code == 'CREDIT' OR $transaction_code == '38') {
It's weird.. CREDIT (Refund) is suppose to be 'N' as response ??
I wonder whether that is your intention or not.
My object of this mail is confirm that is whether good approach, and if so, willing to help for you.
Please let me know if there's something wrong
Have a good weekend! :)
Regards.
I did some of test for CitrusDB.
I'm using that based on prepaycc (pre-pay Credit card), everything was fine but refund.
When I tried to refund in the Billing's refund menu (http://localhost/citrus-2.1/index.php?load=refund&type=tools&billingid=45&submit=Submit),
That records didn't exported when I tried export for one text file in the http://localhost/citrus-2.1/index.php?load=refundcc&type=tools .
(There's result file for that but content was empty.)
So, I analyzed related source, I found something miss.
1. refunded = 'y' shouldn't do there, because refund export page works as loading refunded<>'y'
tools/refund.php line 51~61 has been changed as commentation.
2. DB scheme.
DROP TABLE IF EXISTS `payment_history`;
CREATE TABLE `payment_history` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`creation_date` DATE NOT NULL DEFAULT '0000-00-00',
`transaction_code` VARCHAR(32) DEFAULT NULL,
`billing_id` INT(11) NOT NULL DEFAULT '0',
`creditcard_number` VARCHAR(16) DEFAULT NULL,
`creditcard_expire` INT(4) UNSIGNED ZEROFILL DEFAULT NULL,
`billing_amount` DECIMAL(9,2) DEFAULT NULL,
`response_code` VARCHAR(100) DEFAULT NULL,
`paid_from` DATE NOT NULL DEFAULT '0000-00-00',
`paid_to` DATE NOT NULL DEFAULT '0000-00-00',
`invoice_number` INT(128) DEFAULT NULL,
`status` SET('authorized','declined','pending','donotreactivate','collections','turnedoff','credit','canceled','cancelwfee','pastdue','noticesent','waiting') DEFAULT NULL,
`payment_type` SET('creditcard','prepaycc','check','cash','eft','nsf','discount') DEFAULT NULL,
`check_number` VARCHAR(32) DEFAULT NULL,
`avs_response` VARCHAR(32) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `billing_id_index` (`billing_id`)
) ENGINE=MYISAM AUTO_INCREMENT=142 DEFAULT CHARSET=latin1;
(To sum up, there's only change of adding one enum for payment_type column as 'prepaycc' next to 'creditcard')
3. Not solved yet, I passed this step by wrote response as 'No' in the import file.
tools/importcc.php line 79~
if ($response_id == 'N') { if ($transaction_code == 'CREDIT' OR $transaction_code == '38') {
It's weird.. CREDIT (Refund) is suppose to be 'N' as response ??
I wonder whether that is your intention or not.
My object of this mail is confirm that is whether good approach, and if so, willing to help for you.
Please let me know if there's something wrong
Have a good weekend! :)
Regards.