I am trying to change from sandbox to production with Python and I keep getting this error.
Error Code: E00007
Error message: User authentication failed due to invalid authentication values.
My code was working correctly in the sandbox environment, but once I switched my apiLoginId and transactionKey to the production version, I am no longer able to make payments. These credentials are correct (which is the only issue offered by Authorize.net here: https://developer.authorize.net/api/reference/responseCodes.html?code=e00007).
I am wondering if the ...
Here is my code:
import imp
import os
import sys
import importlib
from authorizenet.constants import constants
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import createTransactionController
from .constants import MY_CONSTANTS #contains my apiLoginId and transactionKey
def charge_credit_card(amount, number, first_name, last_name, expire_month, expire_year, cvv_number, product_name, description, product_pk, user_pk, user_email):
# Create a merchantAuthenticationType object with authentication details
# retrieved from the constants file
merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = MY_CONSTANTS['apiLoginId']
merchantAuth.transactionKey = MY_CONSTANTS['transactionKey']
.........
# Assemble the complete transaction request
createtransactionrequest = apicontractsv1.createTransactionRequest()
createtransactionrequest.merchantAuthentication = merchantAuth
createtransactionrequest.refId = "MerchantID-0001"
createtransactionrequest.transactionRequest = transactionrequest
# Create the controller
createtransactioncontroller = createTransactionController(
createtransactionrequest)
createtransactioncontroller.setenvironment(settings.PRODUCTION)
createtransactioncontroller.execute()
I am having the same error as https://stackoverflow.com/questions/56741738/how-to-pass-the-production-variable-to-authorize-net-ap...
Could someone please tell me where the url goes or whatever is wrong with my code?