We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related to Issue #85. Any help is appreciated!
The code I am using:
def create_pay_transaction(amount, form_data): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = config['authnet']['apiLoginId'] merchantAuth.transactionKey = config['authnet']['transactionKey'] refId = "ref {}".format(format_server_time()) opaqueData = apicontractsv1.opaqueDataType() opaqueData.dataDescriptor = form_data['dataDescriptor'] opaqueData.dataValue = form_data['dataValue'] paymentOne = apicontractsv1.paymentType() paymentOne.opaqueData = opaqueData order = apicontractsv1.orderType() order.description = "GUFC Donation" customerData = apicontractsv1.customerDataType() customerData.type = "individual" customerData.firstName = form_data['fName'] customerData.lastName = form_data['lName'] customerData.email = form_data['email'] customerData.phone = form_data['phone'] duplicateWindowSetting = apicontractsv1.settingType() duplicateWindowSetting.settingName = "duplicateWindow" duplicateWindowSetting.settingValue = "600" settings = apicontractsv1.ArrayOfSetting() settings.setting.append(duplicateWindowSetting) transactRequest = apicontractsv1.transactionRequestType() transactRequest.transactionType = "authCaptureTransaction" transactRequest.amount = amount transactRequest.order = order transactRequest.payment = paymentOne transactRequest.customer = customerData transactRequest.transactionSettings = settings createTransReq = apicontractsv1.createTransactionRequest() createTransReq.merchantAuthentication = merchantAuth createTransReq.refId = refId createTransReq.transactionRequest = transactRequest createTransCont = createTransactionController(createTransReq) createTransCont.execute() response = createTransCont.getresponse() if response is not None: if response.messages.resultCode == "Ok": if hasattr(response.transactionResponse, 'messages') == True: print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId) print ('Transaction Response Code: %s' % response.transactionResponse.responseCode) print ('Message Code: %s' % response.transactionResponse.messages.message[0].code) print ('Auth Code: %s' % response.transactionResponse.authCode) print ('Description: %s' % response.transactionResponse.messages.message[0].description) else: print ('Failed Transaction.') if hasattr(response.transactionResponse, 'errors') == True: print ('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) print ('Error Message: %s' % response.transactionResponse.errors.error[0].errorText) # Or, print errors if the API request wasn't successful else: print ('Failed Transaction.') if hasattr(response, 'transactionResponse') == True and hasattr(response.transactionResponse, 'errors') == True: print ('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) print ('Error Message: %s' % response.transactionResponse.errors.error[0].errorText) else: print ('Error Code: %s' % response.messages.message[0]['code'].text) print ('Error Message: %s' % response.messages.message[0]['text'].text) else: print ('Null Response.') return response
The text was updated successfully, but these errors were encountered:
TCS-Dev Dhanashree- Please be informed that our API currently does not support creating a customer profile and Payment Profile using opaque data.
Sorry, something went wrong.
No branches or pull requests
Related to Issue #85. Any help is appreciated!
The code I am using:
The text was updated successfully, but these errors were encountered: