Skip to content

Commit 05a608d

Browse files
committed
Sample code for create customer profile
Adds sample code to create a customer profile Signed-off-by: Srijan Misra <[email protected]>
1 parent 026c59c commit 05a608d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from authorizenet import apicontractsv1
2+
from authorizenet.apicontrollers import *
3+
import random
4+
5+
merchantAuth = apicontractsv1.merchantAuthenticationType()
6+
merchantAuth.name = '5KP3u95bQpv'
7+
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'
8+
9+
10+
createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
11+
createCustomerProfile.merchantAuthentication = merchantAuth
12+
createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)), 'John2 Doe', '[email protected]')
13+
14+
createCustomerProfileController = createCustomerProfileController(createCustomerProfile)
15+
createCustomerProfileController.execute()
16+
17+
response = createCustomerProfileController.getresponse()
18+
19+
if (response.messages.resultCode=="Ok"):
20+
print "Successfully created a customer profile with id: %s" % response.customerProfileId
21+
else:
22+
print "Failed to create customer payment profile %s" % response.messages.message[0].text

0 commit comments

Comments
 (0)