Skip to content

Commit 0299374

Browse files
committed
Sample code to get customer payment profile
Adds a sample code to retrieve customer payment profile. Signed-off-by: Srijan Misra <[email protected]>
1 parent 05a608d commit 0299374

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+
4+
merchantAuth = apicontractsv1.merchantAuthenticationType()
5+
merchantAuth.name = '5KP3u95bQpv'
6+
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'
7+
8+
getCustomerPaymentProfile = apicontractsv1.getCustomerPaymentProfileRequest()
9+
getCustomerPaymentProfile.merchantAuthentication = merchantAuth
10+
getCustomerPaymentProfile.customerProfileId = "36731856"
11+
getCustomerPaymentProfile.customerPaymentProfileId = "33211899"
12+
13+
getCustomerPaymentProfileController = getCustomerPaymentProfileController(getCustomerPaymentProfile)
14+
getCustomerPaymentProfileController.execute()
15+
16+
response = getCustomerPaymentProfileController.getresponse()
17+
18+
if (response.messages.resultCode=="Ok"):
19+
print "Successfully retrieved a payment profile with profile id %s and customer id %s" % (getCustomerPaymentProfile.customerProfileId, getCustomerPaymentProfile.customerProfileId)
20+
else:
21+
print "response code: %s" % response.messages.resultCode
22+
print "Failed to get payment profile information with id %s" % getCustomerPaymentProfile.customerPaymentProfileId

0 commit comments

Comments
 (0)