0% found this document useful (0 votes)
1K views1 page

Gift Card Generator - Py.

[OR_CCREU_02]

Uploaded by

623homerepairs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views1 page

Gift Card Generator - Py.

[OR_CCREU_02]

Uploaded by

623homerepairs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import random

from datetime import datetime, timedelta

def calculate_checksum(card_number):
def digits_of(n):
return [int(d) for d in str(n)]
digits = digits_of(card_number)
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
checksum = sum(odd_digits)
for d in even_digits:
checksum += sum(digits_of(d * 2))
return checksum % 10

def generate_gift_card():
bin_number = "40975819" # Specific BIN
amount = 500.00 # Fixed amount
expiration_date = (datetime.now() + timedelta(days=7*365)).strftime("%Y-%m-%d")
# Expiration date
security_code = str(random.randint(100, 999)) # 3-digit security code

# Generate 9 random digits


random_digits = ''.join([str(random.randint(0, 9)) for _ in range(9)])
card_number_without_checksum = bin_number + random_digits

# Calculate checksum
checksum_digit = calculate_checksum(card_number_without_checksum)
full_card_number = card_number_without_checksum + str(checksum_digit)

return {
"card_number": full_card_number,
"amount": amount,
"expiration_date": expiration_date,
"security_code": security_code
}

# Example usage
gift_card = generate_gift_card()
print(f"Generated Gift Card: {gift_card}")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy