Skip to content

Commit e9e2cc6

Browse files
committed
Sample code: Create customer profile from transaction
Adds sample code to create a customer profile from a transaction id. Signed-off-by: Srijan Misra <srmisra@visa.com>
1 parent 85e595f commit e9e2cc6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
createCustomerProfileFromTransaction = apicontractsv1.createCustomerProfileFromTransactionRequest()
9+
createCustomerProfileFromTransaction.merchantAuthentication = merchantAuth
10+
createCustomerProfileFromTransaction.transId = '2238147175'
11+
12+
createCustomerProfileFromTransactionController = createCustomerProfileFromTransactionController(createCustomerProfileFromTransaction)
13+
createCustomerProfileFromTransactionController.execute()
14+
15+
response = createCustomerProfileFromTransactionController.getresponse()
16+
17+
if (response.messages.resultCode=="Ok"):
18+
print "Successfully created a customer profile with id: %s from transaction id: %s" % {response.customerProfileId, createCustomerProfileFromTransaction.transId}
19+
else:
20+
print "Failed to create customer payment profile from transaction %s" % response.messages.message[0].text

0 commit comments

Comments
 (0)