-
Notifications
You must be signed in to change notification settings - Fork 9
/
card_generator.py
109 lines (100 loc) · 5.41 KB
/
card_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import random
from datetime import datetime
from card_validator import CardValidator
class GetGenerate:
def __init__(self, count=1, credit_type="Visa"):
self.count = count
self.credit_type = credit_type
self.jdata = {"amex": ['34', '37'], "discover": ['65', '6011'],
"mastercard": ['51', '52', '53', '54', '55'], "visa": ['4']}
self.info_card = {}
self.ready_card = {}
self.beautiful_card = None
def cardInfo(self, card_list):
for card_number in card_list:
self.info_card.update({card_number: CardValidator(card_number).cardInfo()})
return self.info_card
def beautifulCard(self, card_list):
if type([]) == type(card_list):
self.beautiful_card = []
for card_ids in card_list:
out = []
template_base = ""
card_ids = str(card_ids)
while card_ids:
out.append(card_ids[-4:])
card_ids = card_ids[:-4]
template_base = ' '.join(out[::-1])
self.beautiful_card.append(template_base)
elif type({}) == type(card_list):
self.beautiful_card = {}
for idList in card_list:
card_ids = card_list[idList]['card']
out = []
template_base = ""
while card_ids:
out.append(card_ids[-4:])
card_ids = card_ids[:-4]
template_base = ' '.join(out[::-1])
jValue = {idList: {"card": template_base,
"data": card_list[idList]['data'],
"csv": card_list[idList]['csv']}}
self.beautiful_card.update(jValue)
return self.beautiful_card
def getCard(self, beautiful_card=None, bank_info=None):
if self.credit_type.lower() == "visa":
for x in range(self.count):
card_id = random.choice(self.jdata['visa'])
if random.randint(0, 1):
while 1:
card_number = f"{card_id}{random.randint(111111111111, 999999999999)}"
if CardValidator(card_number).luhnValidator():
data_value = int(datetime.now().strftime("%y")) + random.randint(2, 6)
json_value = {x: {"card": f"{card_number}",
"data": f"0{random.randint(1, 10)}/{data_value}",
"csv": random.randint(111, 999)}}
self.ready_card.update(json_value)
break
else:
while 1:
card_number = f"{card_id}{random.randint(111111111111111, 999999999999999)}"
if CardValidator(card_number).luhnValidator():
data_value = int(datetime.now().strftime("%y")) + random.randint(2, 6)
json_value = {x: {"card": f"{card_number}",
"data": f"0{random.randint(1, 10)}/{data_value}",
"csv": random.randint(111, 999)}}
self.ready_card.update(json_value)
break
else:
for x in range(self.count):
card_id = random.choice(self.jdata[self.credit_type.lower()])
if self.credit_type.lower() == "amex":
card_id = random.choice(self.jdata['amex'])
while 1:
card_number = f"{card_id}{random.randint(1111111111111, 9999999999999)}"
if CardValidator(card_number).luhnValidator():
data_value = int(datetime.now().strftime("%y")) + random.randint(2, 6)
json_value = {x: {"card": f"{card_number}",
"data": f"0{random.randint(1, 10)}/{data_value}",
"csv": random.randint(111, 9999)}}
self.ready_card.update(json_value)
break
else:
while 1:
card_number = f"{card_id}{random.randint(11111111111111, 99999999999999)}"
if CardValidator(card_number).luhnValidator():
data_value = int(datetime.now().strftime("%y")) + random.randint(2, 6)
json_value = {x: {"card": f"{card_number}",
"data": f"0{random.randint(1, 10)}/{data_value}",
"csv": random.randint(111, 999)}}
self.ready_card.update(json_value)
break
if beautiful_card:
self.ready_card = GetGenerate().beautifulCard(self.ready_card)
if bank_info:
jsonInfoBank = {}
for card_id in self.ready_card:
ready_info = CardValidator(self.ready_card[card_id]['card']).cardInfo()
jsonInfoBank.update({card_id: {"value": self.ready_card[card_id], "info": ready_info}})
self.ready_card = jsonInfoBank
return self.ready_card