# Path: src/cybersource/constants.py
# DECISION_REVIEW = "REVIEW"
# 
# DECISION_ACCEPT = "ACCEPT"


from unittest import skipUnless, mock
from decimal import Decimal as D
from django.conf import settings
from django.core import mail
from django.urls import reverse
from django.utils import timezone
from django.utils.crypto import get_random_string
from oscar.core.loading import get_model
from oscar.test import factories
from rest_framework import status
from rest_framework.test import APITestCase
from cybersource.models import CyberSourceReply
from ..constants import DECISION_REVIEW, DECISION_ACCEPT
from . import factories as cs_factories
import datetime
import uuid
        # Mask Card data
        token_resp_data["req_card_number"] = (
            "xxxxxxxxxxxx" + token_resp_data["req_card_number"][-4:]
        )
        token_resp_data.pop("req_card_cvn", None)
        # Add auth fields
        token_resp_data["auth_amount"] = token_request_data.get("amount", "0.00")
        token_resp_data["auth_avs_code"] = "Y"
        token_resp_data["auth_avs_code_raw"] = "Y"
        token_resp_data["auth_code"] = "00000D"
        token_resp_data["auth_cv_result"] = "M"
        token_resp_data["auth_cv_result_raw"] = "M"
        token_resp_data["auth_response"] = "85"
        token_resp_data["auth_time"] = datetime.datetime.utcnow().strftime(
            "%Y-%m-%dT%H:%M:%SZ"
        )
        token_resp_data["decision"] = "ACCEPT"
        token_resp_data["message"] = "Request was processed successfully."
        token_resp_data["payment_token"] = get_random_string(16)
        token_resp_data["reason_code"] = "100"
        token_resp_data["request_token"] = get_random_string(80)
        token_resp_data["transaction_id"] = get_random_string(
            22, allowed_chars="0123456789"
        )
        # Sign and return data
        cs_factories.sign_reply_data(token_resp_data)
        token_resp_data["utf8"] = "✓"
        return token_resp_data

    def check_finished_order(

# Path: src/cybersource/constants.py
# DECISION_REVIEW = "REVIEW"
# 
# DECISION_ACCEPT = "ACCEPT"


# Path: src/cybersource/tests/test_checkout.py
from unittest import skipUnless, mock
from decimal import Decimal as D
from django.conf import settings
from django.core import mail
from django.urls import reverse
from django.utils import timezone
from django.utils.crypto import get_random_string
from oscar.core.loading import get_model
from oscar.test import factories
from rest_framework import status
from rest_framework.test import APITestCase
from cybersource.models import CyberSourceReply
from ..constants import DECISION_REVIEW, DECISION_ACCEPT
from . import factories as cs_factories
import datetime
import uuid

        # Mask Card data
        token_resp_data["req_card_number"] = (
            "xxxxxxxxxxxx" + token_resp_data["req_card_number"][-4:]
        )
        token_resp_data.pop("req_card_cvn", None)
        # Add auth fields
        token_resp_data["auth_amount"] = token_request_data.get("amount", "0.00")
        token_resp_data["auth_avs_code"] = "Y"
        token_resp_data["auth_avs_code_raw"] = "Y"
        token_resp_data["auth_code"] = "00000D"
        token_resp_data["auth_cv_result"] = "M"
        token_resp_data["auth_cv_result_raw"] = "M"
        token_resp_data["auth_response"] = "85"
        token_resp_data["auth_time"] = datetime.datetime.utcnow().strftime(
            "%Y-%m-%dT%H:%M:%SZ"
        )
        token_resp_data["decision"] = "ACCEPT"
        token_resp_data["message"] = "Request was processed successfully."
        token_resp_data["payment_token"] = get_random_string(16)
        token_resp_data["reason_code"] = "100"
        token_resp_data["request_token"] = get_random_string(80)
        token_resp_data["transaction_id"] = get_random_string(
            22, allowed_chars="0123456789"
        )
        # Sign and return data
        cs_factories.sign_reply_data(token_resp_data)
        token_resp_data["utf8"] = "✓"
        return token_resp_data

    def check_finished_order(

        self, number, product_id, quantity=1, status=DECISION_ACCEPT, card_last4="1111"