Skip to content

Update response messages to use indexes and not properties. #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ApplePayTransactions/create-an-apple-pay-transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def create_an_apple_pay_transaction():

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
print "AUTH Code : %s" % response.authCode
print "Transaction ID : %s" % response.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

Expand Down
8 changes: 4 additions & 4 deletions CustomerProfiles/create-customer-payment-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def create_customer_payment_profile(customerProfileId):
billTo = apicontractsv1.customerAddressType()
billTo.firstName = "John"
billTo.lastName = "Snow"

profile = apicontractsv1.customerPaymentProfileType()
profile.payment = payment
profile.billTo = billTo

createCustomerPaymentProfile = apicontractsv1.createCustomerPaymentProfileRequest()
createCustomerPaymentProfile.merchantAuthentication = merchantAuth
createCustomerPaymentProfile.paymentProfile = profile
Expand All @@ -39,9 +39,9 @@ def create_customer_payment_profile(customerProfileId):
if (response.messages.resultCode=="Ok"):
print "Successfully created a customer payment profile with id: %s" % response.customerPaymentProfileId
else:
print "Failed to create customer payment profile %s" % response.messages.message[0].text
print "Failed to create customer payment profile %s" % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
create_customer_payment_profile(constants.customerProfileId)
create_customer_payment_profile(constants.customerProfileId)
10 changes: 5 additions & 5 deletions CustomerProfiles/create-customer-profile-from-transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def create_customer_profile_from_transaction(transactionId):
createCustomerProfileFromTransaction.transId = transactionId
#You can either specify the customer information in form of customerProfileBaseType object
createCustomerProfileFromTransaction.customer = profile
# OR
# OR
# You can just provide the customer Profile ID
# createCustomerProfileFromTransaction.customerProfileId = "123343"
# createCustomerProfileFromTransaction.customerProfileId = "123343"

controller = createCustomerProfileFromTransactionController(createCustomerProfileFromTransaction)
controller.execute()

Expand All @@ -32,9 +32,9 @@ def create_customer_profile_from_transaction(transactionId):
if (response.messages.resultCode=="Ok"):
print "Successfully created a customer profile with id: %s from transaction id: %s" % (response.customerProfileId, createCustomerProfileFromTransaction.transId)
else:
print "Failed to create customer payment profile from transaction %s" % response.messages.message[0].text
print "Failed to create customer payment profile from transaction %s" % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
create_customer_profile_from_transaction(constants.transactionId)
create_customer_profile_from_transaction(constants.transactionId)
2 changes: 1 addition & 1 deletion CustomerProfiles/create-customer-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_customer_profile():
if (response.messages.resultCode=="Ok"):
print "Successfully created a customer profile with id: %s" % response.customerProfileId
else:
print "Failed to create customer payment profile %s" % response.messages.message[0].text
print "Failed to create customer payment profile %s" % response.messages.message[0]['text'].text

return response

Expand Down
8 changes: 4 additions & 4 deletions CustomerProfiles/create-customer-shipping-address.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def create_customer_shipping_address(customerProfileId):

if response.messages.resultCode == "Ok":
print "SUCCESS"
print "Transaction ID : %s " % response.messages.message[0].text
print "Transaction ID : %s " % response.messages.message[0]['text'].text
print "Customer address id : %s" % response.customerAddressId
else:
print "ERROR"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
create_customer_shipping_address(constants.customerProfileId)
create_customer_shipping_address(constants.customerProfileId)
2 changes: 1 addition & 1 deletion CustomerProfiles/delete-customer-payment-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def delete_customer_payment_profile(customerProfileId, customerPaymentProfileId)
if (response.messages.resultCode=="Ok"):
print "Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId
else:
print response.messages.message[0].text
print response.messages.message[0]['text'].text
print "Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId

return response
Expand Down
2 changes: 1 addition & 1 deletion CustomerProfiles/delete-customer-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def delete_customer_profile(customerProfileId):
if (response.messages.resultCode=="Ok"):
print "Successfully deleted customer with customer profile id %s" % deleteCustomerProfile.customerProfileId
else:
print response.messages.message[0].text
print response.messages.message[0]['text'].text
print "Failed to delete customer profile with customer profile id %s" % deleteCustomerProfile.customerProfileId

return response
Expand Down
8 changes: 4 additions & 4 deletions CustomerProfiles/delete-customer-shipping-address.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def delete_customer_shipping_address(customerProfileId, customerProfileShippingI

if response.messages.resultCode == "Ok":
print "SUCCESS"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text
else:
print "ERROR"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text

return response

Expand Down
8 changes: 4 additions & 4 deletions CustomerProfiles/get-customer-shipping-address.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ def get_customer_shipping_address(customerProfileId, customerAddressId):
print response.address.country
if not hasattr(response, 'subscriptionIds'):
print ("no subscriptionIds attr in response")
else:
else:
if hasattr(response, 'subscriptionIds') == True:
if hasattr(response.subscriptionIds, 'subscriptionId') == True:
print "list of subscriptionid:"
for subscriptionid in (response.subscriptionIds.subscriptionId):
print subscriptionid
else:
print "ERROR"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
get_customer_shipping_address(constants.customerProfileId, constants.customerProfileShippingId)
get_customer_shipping_address(constants.customerProfileId, constants.customerProfileShippingId)
8 changes: 4 additions & 4 deletions CustomerProfiles/get-hosted-profile-page.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def get_hosted_profile_page(customerProfileId):
print('Token : %s' % profilePageResponse.token)

if profilePageResponse.messages:
print('Message Code : %s' % profilePageResponse.messages.message[0].code)
print('Message Text : %s' % profilePageResponse.messages.message[0].text)
print('Message Code : %s' % profilePageResponse.messages.message[0]['code'].text)
print('Message Text : %s' % profilePageResponse.messages.message[0]['text'].text)
else:
if profilePageResponse.messages:
print('Failed to get batch statistics.\nCode:%s \nText:%s' % (profilePageResponse.messages.message[0].code,profilePageResponse.messages.message[0].text))
print('Failed to get batch statistics.\nCode:%s \nText:%s' % (profilePageResponse.messages.message[0]['code'].text,profilePageResponse.messages.message[0]['text'].text))

return profilePageResponse

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
get_hosted_profile_page(constants.customerProfileId)
get_hosted_profile_page(constants.customerProfileId)
4 changes: 2 additions & 2 deletions CustomerProfiles/update-customer-payment-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def update_customer_payment_profile(customerProfileId, customerPaymentProfileId)
if (response.messages.resultCode=="Ok"):
print "Successfully updated customer payment profile with id %s" % updateCustomerPaymentProfile.paymentProfile.customerPaymentProfileId
else:
print response.messages.message[0].text
print response.messages.message[0]['text'].text
print "Failed to update customer with customer payment profile id %s" % updateCustomerPaymentProfile.paymentProfile.customerPaymentProfileId

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
update_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)
update_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)
4 changes: 2 additions & 2 deletions CustomerProfiles/update-customer-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def update_customer_profile(customerProfileId):
if (response.messages.resultCode=="Ok"):
print "Successfully updated customer with customer profile id %s" % updateCustomerProfile.profile.customerProfileId
else:
print response.messages.message[0].text
print response.messages.message[0]['text'].text
print "Failed to update customer profile with customer profile id %s" % updateCustomerProfile.profile.customerProfileId

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
update_customer_profile(constants.customerProfileId)
update_customer_profile(constants.customerProfileId)
10 changes: 5 additions & 5 deletions CustomerProfiles/update-customer-shipping-address.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def update_customer_shipping_address(customerProfileId, customerAddressId):

if response.messages.resultCode == "Ok":
print "SUCCESS"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text
else:
print "ERROR"
print "Message code : %s " % response.messages.message[0].code
print "Message text : %s " % response.messages.message[0].text
print "Message code : %s " % response.messages.message[0]['code'].text
print "Message text : %s " % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
update_customer_shipping_address(constants.customerProfileId, constants.customerProfileShippingId)
update_customer_shipping_address(constants.customerProfileId, constants.customerProfileShippingId)
6 changes: 3 additions & 3 deletions CustomerProfiles/validate-customer-payment-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def validate_customer_payment_profile(customerProfileId, customerPaymentProfileI
response = validateCustomerPaymentProfileCntrlr.getresponse()

if (response.messages.resultCode=="Ok"):
print response.messages.message[0].text
print response.messages.message[0]['text'].text
else:
print "ERROR : Validate Customer Payment Profile: Invalid response"
print "response code: %s %s" % {response.messages.message[0].code, response.messages.message[0].text}
print "response code: %s %s" % {response.messages.message[0]['code'].text, response.messages.message[0]['text'].text}

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
validate_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)
validate_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)
10 changes: 5 additions & 5 deletions PaymentTransactions/charge-tokenized-credit-card.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ def charge_tokenized_credit_card():

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
print "Transaction ID : %s" % response.transactionResponse.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
charge_tokenized_credit_card()
charge_tokenized_credit_card()
4 changes: 2 additions & 2 deletions PaymentTransactions/credit-bank-account.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def credit_bank_account():
print response.transactionResponse.messages.message[0].description
else:
print "response code: %s" % response.messages.resultCode
print response.messages.message[0].text
print response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
credit_bank_account()
credit_bank_account()
6 changes: 3 additions & 3 deletions PaymentTransactions/refund-transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def refund_transaction(refTransId):
print "Transaction ID : %s" % response.transactionResponse.transId
else:
print "response code: %s" % response.messages.resultCode
print "Message code: %s" % response.messages.message[0].code
print "Message text: %s" % response.messages.message[0].text
print "Message code: %s" % response.messages.message[0]['code'].text
print "Message text: %s" % response.messages.message[0]['text'].text
print "Transaction Error Code: %s" % response.transactionResponse.errors.error[0].errorCode
print "Transaction Error Text: %s" % response.transactionResponse.errors.error[0].errorText

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
refund_transaction(constants.transactionId)
refund_transaction(constants.transactionId)
6 changes: 3 additions & 3 deletions PaymentTransactions/update-split-tender-group.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def update_split_tender_group():


if (response.messages.resultCode=="Ok"):
print response.messages.message[0].text
print response.messages.message[0]['text'].text
else:
print "response code: %s" % response.messages.resultCode
print response.messages.message[0].text
print response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
update_split_tender_group()
update_split_tender_group()
8 changes: 4 additions & 4 deletions PaypalExpressCheckout/authorization-and-capture-continue.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ def authorization_and_capture_continue(refTransId, payerID):

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
if (response.transactionResponse.responseCode == "1" ):
print "Description : %s " % response.transactionResponse.messages.message[0].description
print "Payer Id : %s " % response.transactionResponse.secureAcceptance.PayerID
print "Transaction ID : %s " % response.transactionResponse.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

Expand Down
8 changes: 4 additions & 4 deletions PaypalExpressCheckout/authorization-and-capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def authorization_and_capture(amount):

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
print "Secure acceptance URL : %s " % response.transactionResponse.secureAcceptance.SecureAcceptanceUrl
print "Transaction ID : %s " % response.transactionResponse.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

Expand Down
10 changes: 5 additions & 5 deletions PaypalExpressCheckout/authorization-only-continued.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ def authorization_only_continued():

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
if (response.transactionResponse.responseCode == "1" ):
print "Description : %s " % response.transactionResponse.messages.message[0].description
print "Payer Id : %s " % response.transactionResponse.secureAcceptance.PayerID
print "Transaction ID : %s " % response.transactionResponse.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]):
authorization_only_continued()
authorization_only_continued()
8 changes: 4 additions & 4 deletions PaypalExpressCheckout/authorization-only.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def authorization_only():

if (response.messages.resultCode=="Ok"):
print "SUCCESS"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text
print "Secure acceptance URL : %s " % response.transactionResponse.secureAcceptance.SecureAcceptanceUrl
print "Transaction ID : %s " % response.transactionResponse.transId
else:
print "ERROR"
print "Message Code : %s" % response.messages.message[0].code
print "Message text : %s" % response.messages.message[0].text
print "Message Code : %s" % response.messages.message[0]['code'].text
print "Message text : %s" % response.messages.message[0]['text'].text

return response

Expand Down
Loading
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