Skip to content

Commit 66a5173

Browse files
author
srathod
committed
- Printing subscriptionids in get-customer-profile, get-customer-payment-profile and get-customer-shipping-address.
- Updated update-subscription sample code for updating customer profile.
1 parent 7ef404f commit 66a5173

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

CustomerProfiles/get-customer-payment-profile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ 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
2631
else:
2732
print "response code: %s" % response.messages.resultCode
2833
print "Failed to get payment profile information with id %s" % getCustomerPaymentProfile.customerPaymentProfileId

CustomerProfiles/get-customer-profile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def get_customer_profile(customerProfileId):
2828
print "Last Name %s" % ship.lastName
2929
print "Address %s" % ship.address
3030
print "Customer Address ID %s" % ship.customerAddressId
31+
32+
if response.subscriptionIds:
33+
print "list of subscriptionid:"
34+
for subscriptionid in response.subscriptionIds.subscriptionId:
35+
print subscriptionid
3136
else:
3237
print "response code: %s" % response.messages.resultCode
3338
print "Failed to get customer profile information with id %s" % getCustomerProfile.customerProfileId

CustomerProfiles/get-customer-shipping-address.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ def get_customer_shipping_address(customerProfileId, customerAddressId):
3131
print response.address.state
3232
print response.address.zip
3333
print response.address.country
34+
35+
if response.subscriptionIds:
36+
print "list of subscriptionid:"
37+
for subscriptionid in response.subscriptionIds.subscriptionId:
38+
print subscriptionid
3439
else:
3540
print "ERROR"
3641
print "Message code : %s " % response.messages.message[0].code

RecurringBilling/update-subscription.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ def update_subscription(subscriptionId):
1717
payment = apicontractsv1.paymentType()
1818
payment.creditCard = creditcard
1919

20+
#set profile information
21+
profile = apicontractsv1.customerProfileIdType()
22+
profile.customerProfileId = "121212";
23+
profile.customerPaymentProfileId = "131313";
24+
profile.customerAddressId = "141414";
25+
2026
subscription = apicontractsv1.ARBSubscriptionType()
2127
subscription.payment = payment
28+
#to update customer profile information
29+
#subscription.profile = profile
2230

2331
request = apicontractsv1.ARBUpdateSubscriptionRequest()
2432
request.merchantAuthentication = merchantAuth

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy