Skip to content

Commit a3729da

Browse files
committed
Sample code for update customer profile
Adds sample code to update a customer profile. Signed-off-by: Srijan Misra <srmisra@visa.com>
1 parent 6cd6476 commit a3729da

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from authorizenet import apicontractsv1
2+
from authorizenet.apicontrollers import *
3+
4+
merchantAuth = apicontractsv1.merchantAuthenticationType()
5+
merchantAuth.name = '5KP3u95bQpv'
6+
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'
7+
8+
updateCustomerProfile = apicontractsv1.updateCustomerProfileRequest()
9+
updateCustomerProfile.merchantAuthentication = merchantAuth
10+
updateCustomerProfile.profile = apicontractsv1.customerProfileExType()
11+
12+
updateCustomerProfile.profile.customerProfileId = "36152115"
13+
updateCustomerProfile.profile.merchantCustomerId = "mycustomer"
14+
updateCustomerProfile.profile.description = "john doe"
15+
updateCustomerProfile.profile.email = "email@email.com"
16+
17+
updateCustomerProfileController = updateCustomerProfileController(updateCustomerProfile)
18+
updateCustomerProfileController.execute()
19+
20+
response = updateCustomerProfileController.getresponse()
21+
22+
if (response.messages.resultCode=="Ok"):
23+
print "Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId
24+
else:
25+
print response.messages.message[0].text
26+
print "Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId

0 commit comments

Comments
 (0)