Exemplo n.º 1
0
    def test_040_add_value_gsb(self):
        card = HpsTrackData()
        card.value = '%B6277220572999800^   /                         ^49121010557010000016000000?F;6277220572999800=49121010557010000016?'

        response = self.service.prepaid_add_value(15.00).with_track_data(card).execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
Exemplo n.º 2
0
    def test_038_add_value_gsb(self):
        card = HpsTrackData()
        card.value = '%B6277220330000248^ TEST CARD^49121010000000000694?;6277220330000248=49121010000000000694?'

        response = self.service.prepaid_add_value(15.00).with_track_data(card).execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
Exemplo n.º 3
0
    def test_040_add_value_gsb(self):
        card = HpsTrackData()
        card.value = '%B6277220572999800^   /                         ^49121010557010000016000000?F;6277220572999800=49121010557010000016?'

        response = self.service.prepaid_add_value(15.00).with_track_data(
            card).execute()

        self.assertIsNotNone(response)
        self.assertEqual('00', response.response_code)
Exemplo n.º 4
0
class TestCreditCard(object):
    # valid visa
    valid_visa = HpsCreditCard()
    valid_visa.cvv = 123
    valid_visa.exp_month = 12
    valid_visa.exp_year = 2025
    valid_visa.number = "4012002000060016"

    # valid visa no cvv
    valid_visa_no_cvv = copy.deepcopy(valid_visa)
    valid_visa_no_cvv.cvv = None

    # valid visa track data
    valid_visa_track = HpsTrackData()
    valid_visa_track.method = HpsTrackDataMethod.swipe
    valid_visa_track.value = '%B4012001000000016^VI TEST CREDIT^251200000000000000000000?'
    valid_visa_track.value += ';4012001000000016=25120000000000000000?'

    # valid visa track data e3 v1
    valid_visa_track_e3v1 = HpsTrackData()
    valid_visa_track_e3v1.method = HpsTrackDataMethod.swipe
    valid_visa_track_e3v1.value = '<E1050711%B4012001000000016^VI TEST CREDIT^251200000000000000000000?|m3VpZL7Km3cqqty3xcIUJ+hKb1lwraqDBvnqQjZybcl95ywOAmdNTKTua|+++++++/q6S49jif|11;4012001000000016=25120000000000000000?|1dxxl54agM6av5oo3myo37RH4wo|+++++++/q6S49jif|00|||/wECAQECAoFGAgEH2wMBTDT6jRZwb3NAc2VjdXJlZXhjaGFuZ2UubmV0AemN+EBuiWATgwIPfIVLybYKTlitSTmJYek5yD3nxtfsR0Rfd9UAaMTxDEGYeQDVmlgJICy8r0RE3QK5tgGCmWXF+GzMmAyB5h4o+jqbIluSs/MbKURSand61aTi5rRhbQSeBNjlvajCtZULmXXjpn6nuXI4QhN89sYwYm5tFwwA6yBN6fDDx8cH5I7MB6wn+AjVzrCCvV347WA2iujV0ZjTFDPT|>'
    valid_visa_track_e3v1.encryption_data = HpsEncryptionData()
    valid_visa_track_e3v1.encryption_data.version = '01'

    # valid visa track data e3 v2
    valid_visa_track_e3v2 = HpsTrackData()
    valid_visa_track_e3v2.method = HpsTrackDataMethod.swipe
    valid_visa_track_e3v2.value = '1dxxl54agM6av5oo3myo37RH4wo'
    valid_visa_track_e3v2.encryption_data = HpsEncryptionData()
    valid_visa_track_e3v2.encryption_data.version = '02'
    valid_visa_track_e3v2.encryption_data.encrypted_track_number = '2'
    valid_visa_track_e3v2.encryption_data.ktb = '/wECAQECAoFGAgEH2wMBTDT6jRZwb3NAc2VjdXJlZXhjaGFuZ2UubmV0AemN+EBuiWATgwIPfIVLybYKTlitSTmJYek5yD3nxtfsR0Rfd9UAaMTxDEGYeQDVmlgJICy8r0RE3QK5tgGCmWXF+GzMmAyB5h4o+jqbIluSs/MbKURSand61aTi5rRhbQSeBNjlvajCtZULmXXjpn6nuXI4QhN89sYwYm5tFwwA6yBN6fDDx8cH5I7MB6wn+AjVzrCCvV347WA2iujV0ZjTFDPT'

    # valid visa proximity data
    valid_visa_proximity = HpsTrackData()
    valid_visa_proximity.method = HpsTrackDataMethod.proximity
    valid_visa_proximity.value = '%B4012001000000016^VI TEST CREDIT^251200000000000000000000?'
    valid_visa_proximity.value += ';4012001000000016=25120000000000000000?'

    # valid visa track data e3 v1
    valid_visa_proximity_e3v1 = HpsTrackData()
    valid_visa_proximity_e3v1.method = HpsTrackDataMethod.proximity
    valid_visa_proximity_e3v1.value = '<E1050711%B4012001000000016^VI TEST CREDIT^251200000000000000000000?|m3VpZL7Km3cqqty3xcIUJ+hKb1lwraqDBvnqQjZybcl95ywOAmdNTKTua|+++++++/q6S49jif|11;4012001000000016=25120000000000000000?|1dxxl54agM6av5oo3myo37RH4wo|+++++++/q6S49jif|00|||/wECAQECAoFGAgEH2wMBTDT6jRZwb3NAc2VjdXJlZXhjaGFuZ2UubmV0AemN+EBuiWATgwIPfIVLybYKTlitSTmJYek5yD3nxtfsR0Rfd9UAaMTxDEGYeQDVmlgJICy8r0RE3QK5tgGCmWXF+GzMmAyB5h4o+jqbIluSs/MbKURSand61aTi5rRhbQSeBNjlvajCtZULmXXjpn6nuXI4QhN89sYwYm5tFwwA6yBN6fDDx8cH5I7MB6wn+AjVzrCCvV347WA2iujV0ZjTFDPT|>'
    valid_visa_proximity_e3v1.encryption_data = HpsEncryptionData()
    valid_visa_proximity_e3v1.encryption_data.version = '01'

    # valid visa track data e3 v2
    valid_visa_proximity_e3v2 = HpsTrackData()
    valid_visa_proximity_e3v2.method = HpsTrackDataMethod.proximity
    valid_visa_proximity_e3v2.value = '1dxxl54agM6av5oo3myo37RH4wo'
    valid_visa_proximity_e3v2.encryption_data = HpsEncryptionData()
    valid_visa_proximity_e3v2.encryption_data.version = '02'
    valid_visa_proximity_e3v2.encryption_data.encrypted_track_number = '2'
    valid_visa_proximity_e3v2.encryption_data.ktb = '/wECAQECAoFGAgEH2wMBTDT6jRZwb3NAc2VjdXJlZXhjaGFuZ2UubmV0AemN+EBuiWATgwIPfIVLybYKTlitSTmJYek5yD3nxtfsR0Rfd9UAaMTxDEGYeQDVmlgJICy8r0RE3QK5tgGCmWXF+GzMmAyB5h4o+jqbIluSs/MbKURSand61aTi5rRhbQSeBNjlvajCtZULmXXjpn6nuXI4QhN89sYwYm5tFwwA6yBN6fDDx8cH5I7MB6wn+AjVzrCCvV347WA2iujV0ZjTFDPT'

    # valid mastercard
    valid_mastercard = HpsCreditCard()
    valid_mastercard.cvv = 123
    valid_mastercard.exp_month = 12
    valid_mastercard.exp_year = 2025
    valid_mastercard.number = "5473500000000014"

    # valid mastercard no cvv
    valid_mastercard_no_cvv = copy.deepcopy(valid_mastercard)
    valid_mastercard_no_cvv.cvv = None

    # valid discover card
    valid_discover = HpsCreditCard()
    valid_discover.cvv = 123
    valid_discover.exp_month = 12
    valid_discover.exp_year = 2025
    valid_discover.number = "6011000990156527"

    # valid discover no cvv
    valid_discover_no_cvv = copy.deepcopy(valid_discover)
    valid_discover_no_cvv.cvv = None

    # valid amex
    valid_amex = HpsCreditCard()
    valid_amex.cvv = 1234
    valid_amex.exp_month = 12
    valid_amex.exp_year = 2025
    valid_amex.number = "372700699251018"

    # valid amex no cvv
    valid_amex_no_cvv = copy.deepcopy(valid_amex)
    valid_amex_no_cvv.cvv = None

    # valid jcb
    valid_jcb = HpsCreditCard()
    valid_jcb.cvv = 123
    valid_jcb.exp_month = 12
    valid_jcb.exp_year = 2025
    valid_jcb.number = "3566007770007321"

    # valid jcb no cvv
    valid_jcb_no_cvv = copy.deepcopy(valid_jcb)
    valid_jcb_no_cvv.cvv = None

    # invalid card
    invalid_card = HpsCreditCard()
    invalid_card.cvv = 123
    invalid_card.exp_month = 12
    invalid_card.exp_year = 2025
    invalid_card.number = "12345"