class Cards(models.Model): name = models.CharField( max_length=70, validators=[ RegexValidator(u'^[a-zA-ZáðéíóúýþæöÁÐÉÍÓÚÝÞÆÖ ]*$', 'Name must only contain alphabetic characters') ]) user = models.ForeignKey(User, on_delete=models.CASCADE) number = models.CharField( max_length=16, verbose_name=u"Credit Card Number:", validators=[ RegexValidator( u'^\d{16}$', 'Credit card number must be 16 characters long and ' 'must only contain numbers') ]) cvc = models.CharField( max_length=3, verbose_name=u"CVC:", validators=[ RegexValidator( u'^\d{3}$', 'CVC must be 3 characters long and must only contain numbers') ]) expiration = CardExpiryField('expiration date')
class BookSeat(models.Model): id = models.AutoField(primary_key=True) seat = models.OneToOneField(Seat, on_delete=models.CASCADE, unique=True) booking_price = MoneyField(default=0, default_currency='INR', max_digits=11, null=True, blank=True) name_on_card = models.CharField(max_length=150) cc_number = CardNumberField('card number') cc_expiry = CardExpiryField('expiration date') cc_code = SecurityCodeField('security code') created_at = models.DateTimeField(auto_now=True) updated_at = models.DateTimeField(auto_now_add=True) user = models.ForeignKey("user.User", on_delete=models.CASCADE, null=True, blank=True) def __str__(self): return "{}-{}".format(self.seat, self.user) def send_mail(self, user, email, movie, date): subject = "Seat Booked" message = "Hello {}, you have book movie {}, on date {}.".format( user, movie, date) try: send_mail(subject, message, email, [email]) except Exception as e: print(e)
class PaymentMethod(models.Model): user = models.ForeignKey('User', on_delete=models.CASCADE) cc_number = CardNumberField('card number') cc_expiry = CardExpiryField('expiration date') class Meta: db_table = 'paymentmethods'
class Customer(AbstractBaseUser): object = UserManager() role = models.CharField(max_length=50, choices=Roles, default='customer') username = models.CharField(max_length=50, unique=True) cust_first_name = models.CharField(max_length=50) cust_last_name = models.CharField(max_length=50) cust_email = models.EmailField(max_length=100, null=False, blank=False) address = models.CharField(max_length=200) city = models.CharField(max_length=50) state = models.CharField(max_length=50) zipcode = models.CharField(max_length=10) phone_number = models.CharField(max_length=50) cust_bill_card = CardNumberField('card number') cust_bill_expiry = CardExpiryField('expiration date') cust_bill_code = SecurityCodeField('security code') created_date = models.DateTimeField(default=timezone.now) updated_date = models.DateTimeField(auto_now_add=True) USERNAME_FIELD = "username" def created(self): self.created_date = timezone.now() self.save() def updated(self): self.updated_date = timezone.now() self.save() def __str__(self): return str(self.cust_email)
class CreditCard(models.Model): # first parameter: actual value to be set on the model # second parameter: human readable name cc_type = models.CharField(max_length=256, verbose_name="Credit Card Type", choices=[("Master", "Master"), ("Visa", "Visa")], default="Master") cc_number = CardNumberField(_('card number')) cc_expiry = CardExpiryField(_('expiration date')) cc_code = SecurityCodeField(_('security code'))
class cards_info(models.Model): card_info_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name_on_card = models.CharField(max_length=50, blank=False) cc_number = CardNumberField(help_text='card number') cc_expiry = CardExpiryField(help_text='expiration date') cc_code = SecurityCodeField(help_text='security code')
class Card(models.Model): holder_name = models.CharField(max_length = 200) number = models.CharField(max_length = 16) expiration_date = CardExpiryField(('expiration date')) cvv = models.IntegerField() def __srt__(self): return self.number
class Payment(models.Model): user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) card_number = CardNumberField(_("card number")) card_expiry = CardExpiryField(_("expiration date")) card_code = SecurityCodeField(_("security code")) def __str__(self): return "{}'s payment({})".format(self.user.username, str(self.card_number)[-4:])
class CreditCard(models.Model): customer = models.OneToOneField(Customer, on_delete=models.CASCADE) cc_name = models.CharField(max_length=50) cc_number = CardNumberField('card number') cc_expiry = CardExpiryField('expiration date') cc_code = SecurityCodeField('security code') def __str__(self): return f'Card: {self.cc_number}'
class PaymentInformation(models.Model): """ A model class to represent Payment Information from DB """ first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) card_number = CardNumberField() expiration_date = CardExpiryField() cvv = SecurityCodeField() def __str__(self): return self.first_name + " " + self.last_name
class Payment(models.Model): patient_user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) cc_number = CardNumberField('card number') cc_expiry = CardExpiryField('expiration date') cc_code = SecurityCodeField('security code') def __str__(self): return f"Credit card for {self.patient_user}"
class Billing(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) street = models.TextField() city = models.TextField() state = models.TextField() zipcode = models.TextField() cc_number = CardNumberField() cc_expiry = CardExpiryField() cc_code = SecurityCodeField() user = models.ForeignKey(User, related_name="billing_info", on_delete = models.CASCADE)
class PaymentInfo(models.Model): # þetta 3 party dummy card_holder = models.CharField(max_length=255) cc_number = CardNumberField() cc_expiry = CardExpiryField() cc_code = SecurityCodeField() user = models.ForeignKey(User, on_delete=models.CASCADE, default=None, blank=True, null=True) archived = models.BooleanField(default=False)
class Account(models.Model): card_number = CardNumberField(null=True) cvc = SecurityCodeField(null=True) expiry = CardExpiryField(null=True) brand = models.CharField(max_length=10, blank=True) last4 = models.CharField(max_length=5, blank=True) customer_id = models.CharField(max_length=70, blank=True) stripe_id = models.CharField(max_length=50, blank=True) token = models.CharField(max_length=100, blank=True) def __str__(self): return f"{self.customer_id}"
class CreditCard(models.Model): created_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) cc_number = CardNumberField('card number') cc_expiry = CardExpiryField('expiration date') cc_code = SecurityCodeField('security code') def get_absolute_url(self): """Returns the url to access a particular item instance.""" return reverse('card-detail', args=[str(self.id)]) def __str__(self): """String for representing the Model object.""" return self.cc_number
class PaymentOption(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=255) # user_id = models.ForeignKey(User, on_delete=models.CASCADE) cc_number = CardNumberField(_('card number')) cc_expiry = CardExpiryField(_('expiration date')) cc_code = SecurityCodeField(_('security code')) created_at=models.DateTimeField(auto_now_add=True) updated_at=models.DateTimeField(auto_now_add=True) insertedby = models.ForeignKey(User,related_name="+", on_delete=models.CASCADE) def __str__(self): return str(self.insertedby)
class CreditCardsUsed(models.Model): number = CardNumberField('numero') date_expiration= CardExpiryField('fecha de vencimiento') cod = SecurityCodeField('codigo de seguridad') card_name = models.CharField("nombre de tarjeta",max_length=50) bank = models.CharField(('banco'),max_length=50) def publish(self): self.save() def __str__(self): return str(self.number) class Meta: verbose_name = "Tarjeta Usada" verbose_name_plural = "Tarjetas Usadas"
class Information(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) email = models.EmailField() address1 = models.CharField(max_length=100) address2 = models.CharField(max_length=100, blank=True, null=True) city = models.CharField(max_length=100) country = CountryField(multiple=False) zip = models.CharField(max_length=100) phone = models.CharField(max_length=100) cc_number = CardNumberField(('card number')) cc_expiry = CardExpiryField(('expiration date')) cc_code = SecurityCodeField(('security code')) def __str__(self): return "{} - {}".format(self.first_name, self.last_name)
class Customer(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=200) last_name = models.CharField(max_length=200) email_id = models.EmailField(max_length=200) driver_license_state = models.CharField(max_length=10) driving_license_no = models.CharField(max_length=200) date_of_birth = models.DateField() residence_address = models.CharField(max_length=500) cc_holder_name = models.CharField(max_length=200) cc_number = CardNumberField(_('Card Number')) cc_expiry = CardExpiryField(_('Expiration Date')) cc_code = SecurityCodeField(_('Security Code')) def __str__(self): return self.first_name + self.last_name
class Card(models.Model): account = models.OneToOneField(BankAccount, on_delete=models.CASCADE, related_name='card') is_active = models.BooleanField(default=False) number = CardNumberField('card number') expires_date = CardExpiryField('expiration date', default='01/25') code = SecurityCodeField('security code') pin = models.PositiveIntegerField(validators=[MaxValueValidator(9999)]) daily_online_limit = models.PositiveIntegerField(blank=True, null=True, default=2000) daily_withdrawal_limit = models.PositiveIntegerField(default=2000) monthly_online_limit = models.PositiveIntegerField(default=5000) monthly_withdrawal_limit = models.PositiveIntegerField(default=5000) def __str__(self): return 'Card account: {}'.format(self.account)
class User(AbstractUser): credit_Card = CardNumberField('Número de tarjeta', null=True, unique=True) expired_Card = CardExpiryField('Fecha de vencimiento', null=True) secCode_Card = SecurityCodeField('Código de seguridad', null=True) tipo_tarjeta = models.CharField('Tipo de tarjeta', null=True, max_length=60) titular = models.CharField('Nombre del titular de la tarjeta', null=True, max_length=60) subscription = models.ForeignKey(Membresia, on_delete=models.CASCADE, null=True, blank=True) dni = models.IntegerField('DNI del titular de la tarjeta', null=True) def __str__(self): return self.username
class CreditCards(models.Model): number = CardNumberField('numero') date_expiration = CardExpiryField('fecha de vencimiento') cod = SecurityCodeField('codigo de seguridad') card_name = models.CharField("nombre de tarjeta", max_length=50) bank = models.CharField(('banco'), max_length=50) user = models.OneToOneField(Account, on_delete=models.CASCADE, verbose_name="usuario") def publish(self): self.save() def __str__(self): return self.card_name class Meta: verbose_name = "Tarjeta" verbose_name_plural = "Tarjetas"
class CardExpiry(models.Model): expiry = CardExpiryField('expiry date', null=True)
class Visa(models.Model): card_owner = models.CharField(max_length=100, blank=True) card_number = CardNumberField(('card number') ,null=True) card_expiry = CardExpiryField(('expiration date'), null=True) cvv = SecurityCodeField(('security code'), null=True)