# 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
            200,
            202,
            203,
            204,
            205,
            207,
            208,
            210,
            211,
            221,
            222,
            230,
            231,
            232,
            233,
            234,
            400,
            481,
            520,
        ):
            return DECISION_DECLINE

        # Errors
        if self.reason_code in (101, 102, 104, 150, 151, 152, 236, 240):
            return DECISION_ERROR

        # If we don't recognize the reason code, go by the decision field
        if self.decision in (
            DECISION_ACCEPT,
            DECISION_REVIEW,

# 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

            200,
            202,
            203,
            204,
            205,
            207,
            208,
            210,
            211,
            221,
            222,
            230,
            231,
            232,
            233,
            234,
            400,
            481,
            520,
        ):
            return DECISION_DECLINE

        # Errors
        if self.reason_code in (101, 102, 104, 150, 151, 152, 236, 240):
            return DECISION_ERROR

        # If we don't recognize the reason code, go by the decision field
        if self.decision in (
            DECISION_ACCEPT,
            DECISION_REVIEW,

            DECISION_DECLINE,