Skip to content

Commit 85e595f

Browse files
committed
Sample code to delete customer payment profile
Adds sample code to delete customer payment profile. Signed-off-by: Srijan Misra <[email protected]>
1 parent 6bb7230 commit 85e595f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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+
deleteCustomerPaymentProfile = apicontractsv1.deleteCustomerPaymentProfileRequest()
9+
deleteCustomerPaymentProfile.merchantAuthentication = merchantAuth
10+
deleteCustomerPaymentProfile.customerProfileId = "10000"
11+
deleteCustomerPaymentProfile.customerPaymentProfileId = "20000"
12+
13+
deleteCustomerPaymentProfileController = deleteCustomerPaymentProfileController(deleteCustomerPaymentProfile)
14+
deleteCustomerPaymentProfileController.execute()
15+
16+
response = deleteCustomerPaymentProfileController.getresponse()
17+
18+
if (response.messages.resultCode=="Ok"):
19+
print "Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId
20+
else:
21+
print response.messages.message[0].text
22+
print "Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId

0 commit comments

Comments
 (0)