コード例 #1
0
    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
コード例 #2
0
 def test_extract_phone(self):
     expected = '1144558899' 
     result = ISO8583Parser.extract_phone(MOCK_MESSAGE_REQ)
     self.assertEquals(result, expected)