Skip to content

Commit 7a9808d

Browse files
author
krgupta
committed
uncommented get_customer_payment_profile
1 parent 5d6a1f8 commit 7a9808d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

CustomerProfiles/get-customer-payment-profile.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ def get_customer_payment_profile(customerProfileId, customerPaymentProfileId):
2323

2424
if (response.messages.resultCode=="Ok"):
2525
print "Successfully retrieved a payment profile with profile id %s and customer id %s" % (getCustomerPaymentProfile.customerProfileId, getCustomerPaymentProfile.customerProfileId)
26-
'''
27-
if response.paymentProfile.subscriptionIds:
28-
print "list of subscriptionid:"
29-
for subscriptionid in response.paymentProfile.subscriptionIds.subscriptionId:
30-
print subscriptionid
31-
else: #added by krgupta
32-
print "no subscription" #added by krgupta
33-
'''
26+
if hasattr(response, 'paymentProfile') == True:
27+
if hasattr(response.paymentProfile, 'subscriptionIds') == True:
28+
if hasattr(response.subscriptionIds, 'subscriptionId') == True:
29+
print "list of subscriptionid:"
30+
for subscriptionid in response.paymentProfile.subscriptionIds.subscriptionId:
31+
print subscriptionid
3432
else:
3533
print "response code: %s" % response.messages.resultCode
3634
print "Failed to get payment profile information with id %s" % getCustomerPaymentProfile.customerPaymentProfileId

0 commit comments

Comments
 (0)