Skip to content

Commit fbe7365

Browse files
committed
Sample code for validate customer profile
Adds sample code for validating a customer profile. Signed-off-by: Srijan Misra <[email protected]>
1 parent 0299374 commit fbe7365

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
validateCustomerPaymentProfile = apicontractsv1.validateCustomerPaymentProfileRequest()
9+
validateCustomerPaymentProfile.merchantAuthentication = merchantAuth
10+
validateCustomerPaymentProfile.customerProfileId = "36731856"
11+
validateCustomerPaymentProfile.customerPaymentProfileId = "33211899"
12+
validateCustomerPaymentProfile.validationMode = "testMode"
13+
14+
validateCustomerPaymentProfileCntrlr = validateCustomerPaymentProfileController(validateCustomerPaymentProfile)
15+
validateCustomerPaymentProfileCntrlr.execute()
16+
17+
response = validateCustomerPaymentProfileCntrlr.getresponse()
18+
19+
if (response.messages.resultCode=="Ok"):
20+
print response.messages.message[0].text
21+
else:
22+
print "ERROR : Validate Customer Payment Profile: Invalid response"
23+
print "response code: %s %s" % {response.messages.message[0].code, response.messages.message[0].text}

0 commit comments

Comments
 (0)