def update_customer_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId merchantAuth.transactionKey = constants.transactionKey updateCustomerProfile = apicontractsv1.updateCustomerProfileRequest() updateCustomerProfile.merchantAuthentication = merchantAuth updateCustomerProfile.profile = apicontractsv1.customerProfileExType() updateCustomerProfile.profile.customerProfileId = customerProfileId updateCustomerProfile.profile.merchantCustomerId = "mycustomer" updateCustomerProfile.profile.description = "john doe" updateCustomerProfile.profile.email = "*****@*****.**" controller = updateCustomerProfileController(updateCustomerProfile) controller.execute() response = controller.getresponse() if (response.messages.resultCode=="Ok"): print "Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId else: print response.messages.message[0]['text'].text print "Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId return response
def update_customer_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId merchantAuth.transactionKey = constants.transactionKey updateCustomerProfile = apicontractsv1.updateCustomerProfileRequest() updateCustomerProfile.merchantAuthentication = merchantAuth updateCustomerProfile.profile = apicontractsv1.customerProfileExType() updateCustomerProfile.profile.customerProfileId = customerProfileId updateCustomerProfile.profile.merchantCustomerId = "mycustomer" updateCustomerProfile.profile.description = "john doe" updateCustomerProfile.profile.email = "*****@*****.**" controller = updateCustomerProfileController(updateCustomerProfile) controller.execute() response = controller.getresponse() if (response.messages.resultCode == "Ok"): print("Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId) else: print(response.messages.message[0]['text'].text) print("Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId) return response
from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = '5KP3u95bQpv' merchantAuth.transactionKey = '4Ktq966gC55GAX7S' updateCustomerProfile = apicontractsv1.updateCustomerProfileRequest() updateCustomerProfile.merchantAuthentication = merchantAuth updateCustomerProfile.profile = apicontractsv1.customerProfileExType() updateCustomerProfile.profile.customerProfileId = "36152115" updateCustomerProfile.profile.merchantCustomerId = "mycustomer" updateCustomerProfile.profile.description = "john doe" updateCustomerProfile.profile.email = "*****@*****.**" updateCustomerProfileController = updateCustomerProfileController( updateCustomerProfile) updateCustomerProfileController.execute() response = updateCustomerProfileController.getresponse() if (response.messages.resultCode == "Ok"): print "Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId else: print response.messages.message[0].text print "Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId
from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = '5KP3u95bQpv' merchantAuth.transactionKey = '4Ktq966gC55GAX7S' updateCustomerProfile = apicontractsv1.updateCustomerProfileRequest() updateCustomerProfile.merchantAuthentication = merchantAuth updateCustomerProfile.profile = apicontractsv1.customerProfileExType() updateCustomerProfile.profile.customerProfileId = "36152115" updateCustomerProfile.profile.merchantCustomerId = "mycustomer" updateCustomerProfile.profile.description = "john doe" updateCustomerProfile.profile.email = "*****@*****.**" updateCustomerProfileController = updateCustomerProfileController(updateCustomerProfile) updateCustomerProfileController.execute() response = updateCustomerProfileController.getresponse() if (response.messages.resultCode=="Ok"): print "Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId else: print response.messages.message[0].text print "Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId