def process_hub_request(self, msg): phone = ISO8583Parser.extract_phone(msg) batch_date = self._construct_date_for_batch() amount = ISO8583Parser.extract_amount(msg) amount = amount.rjust(3, '0') amount = 'VVS' + amount batch = phone + batch_date pos = DEFAULT_POS passw = BANELCO_PASS entity = BANELCO_ID checksum = self._hash_info(batch, phone, entity, amount, pos, passw) xml_string = self._ensamble_xml(batch, phone, entity, amount, pos, checksum) response_xml = self.send_xml_request_to_hub(xml_string) return response_xml
def test_extract_amount(self): expected = '10' result = ISO8583Parser.extract_amount(MOCK_MESSAGE_REQ) self.assertEquals(result, expected)