| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,17 +35,17 @@ def create_an_apple_pay_transaction(): | |||
| 35 | 35 | response = controller.getresponse() | |
| 36 | 36 | ||
| 37 | 37 | if (response.messages.resultCode=="Ok"): | |
| 38 | - print "SUCCESS" | ||
| 39 | - print "Message Code : %s" % response.messages.message[0].code | ||
| 40 | - print "Message text : %s" % response.messages.message[0].text | ||
| 41 | - print "AUTH Code : %s" % response.authCode | ||
| 42 | - print "Transaction ID : %s" % response.transId | ||
| 38 | + print("SUCCESS") | ||
| 39 | + print("Message Code : %s" % response.messages.message[0]['code'].text) | ||
| 40 | + print("Message text : %s" % response.messages.message[0]['text'].text) | ||
| 41 | + print("AUTH Code : %s" % response.authCode) | ||
| 42 | + print("Transaction ID : %s" % response.transId) | ||
| 43 | 43 | else: | |
| 44 | - print "ERROR" | ||
| 45 | - print "Message Code : %s" % response.messages.message[0].code | ||
| 46 | - print "Message text : %s" % response.messages.message[0].text | ||
| 44 | + print("ERROR") | ||
| 45 | + print("Message Code : %s" % response.messages.message[0]['code'].text) | ||
| 46 | + print("Message text : %s" % response.messages.message[0]['text'].text) | ||
| 47 | 47 | ||
| 48 | 48 | return response | |
| 49 | 49 | ||
| 50 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 50 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 51 | 51 | create_an_apple_pay_transaction() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,11 +20,11 @@ def create_customer_payment_profile(customerProfileId): | |||
| 20 | 20 | billTo = apicontractsv1.customerAddressType() | |
| 21 | 21 | billTo.firstName = "John" | |
| 22 | 22 | billTo.lastName = "Snow" | |
| 23 | - | ||
| 23 | + | ||
| 24 | 24 | profile = apicontractsv1.customerPaymentProfileType() | |
| 25 | 25 | profile.payment = payment | |
| 26 | 26 | profile.billTo = billTo | |
| 27 | - | ||
| 27 | + | ||
| 28 | 28 | createCustomerPaymentProfile = apicontractsv1.createCustomerPaymentProfileRequest() | |
| 29 | 29 | createCustomerPaymentProfile.merchantAuthentication = merchantAuth | |
| 30 | 30 | createCustomerPaymentProfile.paymentProfile = profile | |
@@ -37,11 +37,11 @@ def create_customer_payment_profile(customerProfileId): | |||
| 37 | 37 | response = controller.getresponse() | |
| 38 | 38 | ||
| 39 | 39 | if (response.messages.resultCode=="Ok"): | |
| 40 | - print "Successfully created a customer payment profile with id: %s" % response.customerPaymentProfileId | ||
| 40 | + print("Successfully created a customer payment profile with id: %s" % response.customerPaymentProfileId) | ||
| 41 | 41 | else: | |
| 42 | - print "Failed to create customer payment profile %s" % response.messages.message[0].text | ||
| 42 | + print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text) | ||
| 43 | 43 | ||
| 44 | 44 | return response | |
| 45 | 45 | ||
| 46 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 47 | - create_customer_payment_profile(constants.customerProfileId) | ||
| 46 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 47 | + create_customer_payment_profile(constants.customerProfileId) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,21 +20,21 @@ def create_customer_profile_from_transaction(transactionId): | |||
| 20 | 20 | createCustomerProfileFromTransaction.transId = transactionId | |
| 21 | 21 | #You can either specify the customer information in form of customerProfileBaseType object | |
| 22 | 22 | createCustomerProfileFromTransaction.customer = profile | |
| 23 | - # OR | ||
| 23 | + # OR | ||
| 24 | 24 | # You can just provide the customer Profile ID | |
| 25 | - # createCustomerProfileFromTransaction.customerProfileId = "123343" | ||
| 26 | - | ||
| 25 | + # createCustomerProfileFromTransaction.customerProfileId = "123343" | ||
| 26 | + | ||
| 27 | 27 | controller = createCustomerProfileFromTransactionController(createCustomerProfileFromTransaction) | |
| 28 | 28 | controller.execute() | |
| 29 | 29 | ||
| 30 | 30 | response = controller.getresponse() | |
| 31 | 31 | ||
| 32 | 32 | if (response.messages.resultCode=="Ok"): | |
| 33 | - print "Successfully created a customer profile with id: %s from transaction id: %s" % (response.customerProfileId, createCustomerProfileFromTransaction.transId) | ||
| 33 | + print("Successfully created a customer profile with id: %s from transaction id: %s" % (response.customerProfileId, createCustomerProfileFromTransaction.transId)) | ||
| 34 | 34 | else: | |
| 35 | - print "Failed to create customer payment profile from transaction %s" % response.messages.message[0].text | ||
| 35 | + print("Failed to create customer payment profile from transaction %s" % response.messages.message[0]['text'].text) | ||
| 36 | 36 | ||
| 37 | 37 | return response | |
| 38 | 38 | ||
| 39 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 40 | - create_customer_profile_from_transaction(constants.transactionId) | ||
| 39 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 40 | + create_customer_profile_from_transaction(constants.transactionId) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,11 +23,11 @@ def create_customer_profile(): | |||
| 23 | 23 | response = controller.getresponse() | |
| 24 | 24 | ||
| 25 | 25 | if (response.messages.resultCode=="Ok"): | |
| 26 | - print "Successfully created a customer profile with id: %s" % response.customerProfileId | ||
| 26 | + print("Successfully created a customer profile with id: %s" % response.customerProfileId) | ||
| 27 | 27 | else: | |
| 28 | - print "Failed to create customer payment profile %s" % response.messages.message[0].text | ||
| 28 | + print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text) | ||
| 29 | 29 | ||
| 30 | 30 | return response | |
| 31 | 31 | ||
| 32 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 32 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 33 | 33 | create_customer_profile() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,15 +35,15 @@ def create_customer_shipping_address(customerProfileId): | |||
| 35 | 35 | response = controller.getresponse(); | |
| 36 | 36 | ||
| 37 | 37 | if response.messages.resultCode == "Ok": | |
| 38 | - print "SUCCESS" | ||
| 39 | - print "Transaction ID : %s " % response.messages.message[0].text | ||
| 40 | - print "Customer address id : %s" % response.customerAddressId | ||
| 38 | + print("SUCCESS") | ||
| 39 | + print("Transaction ID : %s " % response.messages.message[0]['text'].text) | ||
| 40 | + print("Customer address id : %s" % response.customerAddressId) | ||
| 41 | 41 | else: | |
| 42 | - print "ERROR" | ||
| 43 | - print "Message code : %s " % response.messages.message[0].code | ||
| 44 | - print "Message text : %s " % response.messages.message[0].text | ||
| 42 | + print("ERROR") | ||
| 43 | + print("Message code : %s " % response.messages.message[0]['code'].text) | ||
| 44 | + print("Message text : %s " % response.messages.message[0]['text'].text) | ||
| 45 | 45 | ||
| 46 | 46 | return response | |
| 47 | 47 | ||
| 48 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 49 | - create_customer_shipping_address(constants.customerProfileId) | ||
| 48 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 49 | + create_customer_shipping_address(constants.customerProfileId) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,12 +21,12 @@ def delete_customer_payment_profile(customerProfileId, customerPaymentProfileId) | |||
| 21 | 21 | response = controller.getresponse() | |
| 22 | 22 | ||
| 23 | 23 | if (response.messages.resultCode=="Ok"): | |
| 24 | - print "Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId | ||
| 24 | + print("Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId) | ||
| 25 | 25 | else: | |
| 26 | - print response.messages.message[0].text | ||
| 27 | - print "Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId | ||
| 26 | + print(response.messages.message[0]['text'].text) | ||
| 27 | + print("Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId) | ||
| 28 | 28 | ||
| 29 | 29 | return response | |
| 30 | 30 | ||
| 31 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 31 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 32 | 32 | delete_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,12 +20,12 @@ def delete_customer_profile(customerProfileId): | |||
| 20 | 20 | response = controller.getresponse() | |
| 21 | 21 | ||
| 22 | 22 | if (response.messages.resultCode=="Ok"): | |
| 23 | - print "Successfully deleted customer with customer profile id %s" % deleteCustomerProfile.customerProfileId | ||
| 23 | + print("Successfully deleted customer with customer profile id %s" % deleteCustomerProfile.customerProfileId) | ||
| 24 | 24 | else: | |
| 25 | - print response.messages.message[0].text | ||
| 26 | - print "Failed to delete customer profile with customer profile id %s" % deleteCustomerProfile.customerProfileId | ||
| 25 | + print(response.messages.message[0]['text'].text) | ||
| 26 | + print("Failed to delete customer profile with customer profile id %s" % deleteCustomerProfile.customerProfileId) | ||
| 27 | 27 | ||
| 28 | 28 | return response | |
| 29 | 29 | ||
| 30 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 30 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 31 | 31 | delete_customer_profile(constants.customerProfileId) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,15 +24,15 @@ def delete_customer_shipping_address(customerProfileId, customerProfileShippingI | |||
| 24 | 24 | response = deleteShippingAddressController.getresponse() | |
| 25 | 25 | ||
| 26 | 26 | if response.messages.resultCode == "Ok": | |
| 27 | - print "SUCCESS" | ||
| 28 | - print "Message code : %s " % response.messages.message[0].code | ||
| 29 | - print "Message text : %s " % response.messages.message[0].text | ||
| 27 | + print("SUCCESS") | ||
| 28 | + print("Message code : %s " % response.messages.message[0]['code'].text) | ||
| 29 | + print("Message text : %s " % response.messages.message[0]['text'].text) | ||
| 30 | 30 | else: | |
| 31 | - print "ERROR" | ||
| 32 | - print "Message code : %s " % response.messages.message[0].code | ||
| 33 | - print "Message text : %s " % response.messages.message[0].text | ||
| 31 | + print("ERROR") | ||
| 32 | + print("Message code : %s " % response.messages.message[0]['code'].text) | ||
| 33 | + print("Message text : %s " % response.messages.message[0]['text'].text) | ||
| 34 | 34 | ||
| 35 | 35 | return response | |
| 36 | 36 | ||
| 37 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 37 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 38 | 38 | delete_customer_shipping_address(constants.customerProfileId, constants.customerProfileShippingId) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,18 +22,18 @@ def get_customer_payment_profile(customerProfileId, customerPaymentProfileId): | |||
| 22 | 22 | response = controller.getresponse() | |
| 23 | 23 | ||
| 24 | 24 | if (response.messages.resultCode=="Ok"): | |
| 25 | - print "Successfully retrieved a payment profile with profile id %s and customer id %s" % (getCustomerPaymentProfile.customerProfileId, getCustomerPaymentProfile.customerProfileId) | ||
| 25 | + print("Successfully retrieved a payment profile with profile id %s and customer id %s" % (getCustomerPaymentProfile.customerProfileId, getCustomerPaymentProfile.customerProfileId)) | ||
| 26 | 26 | if hasattr(response, 'paymentProfile') == True: | |
| 27 | 27 | if hasattr(response.paymentProfile, 'subscriptionIds') == True: | |
| 28 | 28 | if hasattr(response.paymentProfile.subscriptionIds, 'subscriptionId') == True: | |
| 29 | - print "list of subscriptionid:" | ||
| 29 | + print("list of subscriptionid:") | ||
| 30 | 30 | for subscriptionid in response.paymentProfile.subscriptionIds.subscriptionId: | |
| 31 | - print subscriptionid | ||
| 31 | + print(subscriptionid) | ||
| 32 | 32 | else: | |
| 33 | - print "response code: %s" % response.messages.resultCode | ||
| 34 | - print "Failed to get payment profile information with id %s" % getCustomerPaymentProfile.customerPaymentProfileId | ||
| 33 | + print("response code: %s" % response.messages.resultCode) | ||
| 34 | + print("Failed to get payment profile information with id %s" % getCustomerPaymentProfile.customerPaymentProfileId) | ||
| 35 | 35 | ||
| 36 | 36 | return response | |
| 37 | 37 | ||
| 38 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 38 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 39 | 39 | get_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,13 +19,13 @@ def get_customer_profile_ids(): | |||
| 19 | 19 | response = controller.getresponse() | |
| 20 | 20 | ||
| 21 | 21 | if (response.messages.resultCode=="Ok"): | |
| 22 | - print "Successfully retrieved customer ids:" | ||
| 22 | + print("Successfully retrieved customer ids:") | ||
| 23 | 23 | for identity in response.ids.numericString: | |
| 24 | - print identity | ||
| 24 | + print(identity) | ||
| 25 | 25 | else: | |
| 26 | - print "response code: %s" % response.messages.resultCode | ||
| 26 | + print("response code: %s" % response.messages.resultCode) | ||
| 27 | 27 | ||
| 28 | 28 | return response | |
| 29 | 29 | ||
| 30 | - if(os.path.basename(__file__) == sys.argv[0].split('/')[-1]): | ||
| 30 | + if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): | ||
| 31 | 31 | get_customer_profile_ids() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments