Source code for terminusgps.authorizenet.auth
from authorizenet.apicontractsv1 import merchantAuthenticationType
from authorizenet.constants import constants
from django.conf import settings
[docs]
def get_merchant_auth() -> merchantAuthenticationType:
return merchantAuthenticationType(
name=str(settings.MERCHANT_AUTH_LOGIN_ID),
transactionKey=str(settings.MERCHANT_AUTH_TRANSACTION_KEY),
)
[docs]
def get_environment() -> str:
return constants.SANDBOX if settings.DEBUG else constants.PRODUCTION
[docs]
def get_validation_mode() -> str:
return "testMode" if settings.DEBUG else "liveMode"