# Path: src/cybersource/constants.py
# DECISION_ACCEPT = "ACCEPT"
# 
# DECISION_REVIEW = "REVIEW"
# 
# DECISION_DECLINE = "DECLINE"
# 
# DECISION_ERROR = "ERROR"


from cryptography.fernet import InvalidToken
from django.conf import settings
from django.db import models
from django.contrib.postgres.fields import HStoreField
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from oscar.core.compat import AUTH_USER_MODEL
from oscar.models.fields import NullCharField
from fernet_fields import EncryptedTextField
from .constants import (
    DECISION_ACCEPT,
    DECISION_REVIEW,
    DECISION_DECLINE,
    DECISION_ERROR,
)
import dateutil.parser
import logging
        "004": "Discover",
        "005": "DINERS_CLUB",
        "006": "CARTE_BLANCHE",
        "007": "JCB",
        "014": "ENROUTE",
        "021": "JAL",
        "024": "MAESTRO_UK_DOMESTIC",
        "031": "DELTA",
        "033": "VISA_ELECTRON",
        "034": "DANKORT",
        "036": "CARTE_BLEUE",
        "037": "CARTA_SI",
        "042": "MAESTRO_INTERNATIONAL",
        "043": "GE_MONEY_UK_CARD",
        "050": "HIPERCARD",
        "054": "ELO",
    }

    log = models.ForeignKey(
        CyberSourceReply, related_name="tokens", on_delete=models.CASCADE
    )
    token = models.CharField(max_length=100, unique=True)
    masked_card_number = models.CharField(max_length=25)
    card_type = models.CharField(max_length=10)

    class Meta:
        verbose_name = _("Payment Token")
        verbose_name_plural = _("Payment Token")

    @property

# Path: src/cybersource/constants.py
# DECISION_ACCEPT = "ACCEPT"
# 
# DECISION_REVIEW = "REVIEW"
# 
# DECISION_DECLINE = "DECLINE"
# 
# DECISION_ERROR = "ERROR"


# Path: src/cybersource/models.py
from cryptography.fernet import InvalidToken
from django.conf import settings
from django.db import models
from django.contrib.postgres.fields import HStoreField
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from oscar.core.compat import AUTH_USER_MODEL
from oscar.models.fields import NullCharField
from fernet_fields import EncryptedTextField
from .constants import (
    DECISION_ACCEPT,
    DECISION_REVIEW,
    DECISION_DECLINE,
    DECISION_ERROR,
)
import dateutil.parser
import logging

        "004": "Discover",
        "005": "DINERS_CLUB",
        "006": "CARTE_BLANCHE",
        "007": "JCB",
        "014": "ENROUTE",
        "021": "JAL",
        "024": "MAESTRO_UK_DOMESTIC",
        "031": "DELTA",
        "033": "VISA_ELECTRON",
        "034": "DANKORT",
        "036": "CARTE_BLEUE",
        "037": "CARTA_SI",
        "042": "MAESTRO_INTERNATIONAL",
        "043": "GE_MONEY_UK_CARD",
        "050": "HIPERCARD",
        "054": "ELO",
    }

    log = models.ForeignKey(
        CyberSourceReply, related_name="tokens", on_delete=models.CASCADE
    )
    token = models.CharField(max_length=100, unique=True)
    masked_card_number = models.CharField(max_length=25)
    card_type = models.CharField(max_length=10)

    class Meta:
        verbose_name = _("Payment Token")
        verbose_name_plural = _("Payment Token")

    @property

    def card_type_name(self):