[login to view URL] rows from remittance table where status value = 1 and UPDATE_DT is null.
2. Convert the data read to Credit Transfer xml and add those xml structures to ISO 20022 abiding xml file.
[login to view URL] a new data row to transfer_packet table where created xml file is written in xml_file column of the data row.
4. Update the read remittance table rows as follows:
remittance.transfer_packet_id = PRIMARY key of the newly inserted transfer_packet table row
[login to view URL] = 2.
I have made the following modifications to Herokus' database at your disposal.
/* Create a table for transferring xml structures to and from Banks. */
CREATE TABLE `transfer_packet` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(20) DEFAULT NULL, /* Remittance, Payment, etc... */
`total_amount` decimal(20,2) NOT NULL,
`transferred_date` date DEFAULT NULL,
`IBAN` varchar(34) DEFAULT NULL, /* Payors's = [login to view URL]'s IBAN. */
`BIC` varchar(11) DEFAULT NULL, /* Payor's = [login to view URL]'s BIC. */
`xml_file` LONGTEXT NOT NULL,
`status` tinyint(4) unsigned NOT NULL, /* 0 = Cancelled, 1 = Waiting for transfer, 2 = Transferred. */
`ORIG_ID` bigint(20) unsigned DEFAULT NULL,
`INSERT_DT` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`UPDATE_DT` datetime DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `orig_id_idx` (`ORIG_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/* English staus value descriptions. */
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (1, 'transfer_packet', 'status', 0, 'Cancelled');
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (1, 'transfer_packet', 'status', 1, 'Waiting for transfer');
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (1, 'transfer_packet', 'status', 2, 'Transferred');
/* Finnnish staus value descriptions. */
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (2, 'transfer_packet', 'status', 0, 'Mitätöity');
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (2, 'transfer_packet', 'status', 1, 'Odottaa siirtoa');
insert into text_param_values (language, for_object, for_attribute, text_code, text_value) values (2, 'transfer_packet', 'status', 2, 'Siirretty');
/* Foreign key column to remittance table. */
alter table remittance add column `transfer_packet_id` bigint(20) unsigned default null;
alter table remittance add KEY `transfer_packet_id_idx` (`transfer_packet_id`);
alter table remittance add CONSTRAINT `TransferPacket` FOREIGN KEY (`transfer_packet_id`) REFERENCES `transfer_packet` (`ID`) ON UPDATE CASCADE;
Since I have provided all the files necessary, even the xml to ISO20022 converter, the project will cost 55 euro and should be done today itself.
The [login to view URL] is showing how to write the code in codeigniter ( module) to update so a similar [login to view URL] file needs to be created as well in codeigniter(module) . A controller could be created just to test if everything is working.