Skip to content

Commit 8bd7955

Browse files
committed
change tabs to spaces and remove unnecessary semicolons
1 parent 18cd050 commit 8bd7955

File tree

56 files changed

+2729
-2729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2729
-2729
lines changed

CustomerProfiles/create-customer-payment-profile.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,42 @@
66
constants = imp.load_source('modulename', 'constants.py')
77

88
def create_customer_payment_profile(customerProfileId):
9-
merchantAuth = apicontractsv1.merchantAuthenticationType()
10-
merchantAuth.name = constants.apiLoginId
11-
merchantAuth.transactionKey = constants.transactionKey
9+
merchantAuth = apicontractsv1.merchantAuthenticationType()
10+
merchantAuth.name = constants.apiLoginId
11+
merchantAuth.transactionKey = constants.transactionKey
1212

13-
creditCard = apicontractsv1.creditCardType()
14-
creditCard.cardNumber = "4111111111111111"
15-
creditCard.expirationDate = "2020-12"
13+
creditCard = apicontractsv1.creditCardType()
14+
creditCard.cardNumber = "4111111111111111"
15+
creditCard.expirationDate = "2020-12"
1616

17-
payment = apicontractsv1.paymentType()
18-
payment.creditCard = creditCard
17+
payment = apicontractsv1.paymentType()
18+
payment.creditCard = creditCard
1919

20-
billTo = apicontractsv1.customerAddressType()
21-
billTo.firstName = "John"
22-
billTo.lastName = "Snow"
20+
billTo = apicontractsv1.customerAddressType()
21+
billTo.firstName = "John"
22+
billTo.lastName = "Snow"
2323

24-
profile = apicontractsv1.customerPaymentProfileType()
25-
profile.payment = payment
26-
profile.billTo = billTo
24+
profile = apicontractsv1.customerPaymentProfileType()
25+
profile.payment = payment
26+
profile.billTo = billTo
2727

28-
createCustomerPaymentProfile = apicontractsv1.createCustomerPaymentProfileRequest()
29-
createCustomerPaymentProfile.merchantAuthentication = merchantAuth
30-
createCustomerPaymentProfile.paymentProfile = profile
31-
print("customerProfileId in create_customer_payment_profile. customerProfileId = %s" %customerProfileId)
32-
createCustomerPaymentProfile.customerProfileId = str(customerProfileId)
28+
createCustomerPaymentProfile = apicontractsv1.createCustomerPaymentProfileRequest()
29+
createCustomerPaymentProfile.merchantAuthentication = merchantAuth
30+
createCustomerPaymentProfile.paymentProfile = profile
31+
print("customerProfileId in create_customer_payment_profile. customerProfileId = %s" %customerProfileId)
32+
createCustomerPaymentProfile.customerProfileId = str(customerProfileId)
3333

34-
controller = createCustomerPaymentProfileController(createCustomerPaymentProfile)
35-
controller.execute()
34+
controller = createCustomerPaymentProfileController(createCustomerPaymentProfile)
35+
controller.execute()
3636

37-
response = controller.getresponse()
37+
response = controller.getresponse()
3838

39-
if (response.messages.resultCode=="Ok"):
40-
print("Successfully created a customer payment profile with id: %s" % response.customerPaymentProfileId)
41-
else:
42-
print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text)
39+
if (response.messages.resultCode=="Ok"):
40+
print("Successfully created a customer payment profile with id: %s" % response.customerPaymentProfileId)
41+
else:
42+
print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text)
4343

44-
return response
44+
return response
4545

4646
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
47-
create_customer_payment_profile(constants.customerProfileId)
47+
create_customer_payment_profile(constants.customerProfileId)

CustomerProfiles/create-customer-profile-from-transaction.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66
constants = imp.load_source('modulename', 'constants.py')
77

88
def create_customer_profile_from_transaction(transactionId):
9-
merchantAuth = apicontractsv1.merchantAuthenticationType()
10-
merchantAuth.name = constants.apiLoginId
11-
merchantAuth.transactionKey = constants.transactionKey
9+
merchantAuth = apicontractsv1.merchantAuthenticationType()
10+
merchantAuth.name = constants.apiLoginId
11+
merchantAuth.transactionKey = constants.transactionKey
1212

13-
profile = apicontractsv1.customerProfileBaseType()
14-
profile.merchantCustomerId = "12332"
15-
profile.description = "This is a sample profile"
16-
profile.email = "john@castleblack.com"
13+
profile = apicontractsv1.customerProfileBaseType()
14+
profile.merchantCustomerId = "12332"
15+
profile.description = "This is a sample profile"
16+
profile.email = "john@castleblack.com"
1717

18-
createCustomerProfileFromTransaction = apicontractsv1.createCustomerProfileFromTransactionRequest()
19-
createCustomerProfileFromTransaction.merchantAuthentication = merchantAuth
20-
createCustomerProfileFromTransaction.transId = transactionId
21-
#You can either specify the customer information in form of customerProfileBaseType object
22-
createCustomerProfileFromTransaction.customer = profile
23-
# OR
24-
# You can just provide the customer Profile ID
25-
# createCustomerProfileFromTransaction.customerProfileId = "123343"
18+
createCustomerProfileFromTransaction = apicontractsv1.createCustomerProfileFromTransactionRequest()
19+
createCustomerProfileFromTransaction.merchantAuthentication = merchantAuth
20+
createCustomerProfileFromTransaction.transId = transactionId
21+
#You can either specify the customer information in form of customerProfileBaseType object
22+
createCustomerProfileFromTransaction.customer = profile
23+
# OR
24+
# You can just provide the customer Profile ID
25+
# createCustomerProfileFromTransaction.customerProfileId = "123343"
2626

27-
controller = createCustomerProfileFromTransactionController(createCustomerProfileFromTransaction)
28-
controller.execute()
27+
controller = createCustomerProfileFromTransactionController(createCustomerProfileFromTransaction)
28+
controller.execute()
2929

30-
response = controller.getresponse()
30+
response = controller.getresponse()
3131

32-
if (response.messages.resultCode=="Ok"):
33-
print("Successfully created a customer profile with id: %s from transaction id: %s" % (response.customerProfileId, createCustomerProfileFromTransaction.transId))
34-
else:
35-
print("Failed to create customer payment profile from transaction %s" % response.messages.message[0]['text'].text)
32+
if (response.messages.resultCode=="Ok"):
33+
print("Successfully created a customer profile with id: %s from transaction id: %s" % (response.customerProfileId, createCustomerProfileFromTransaction.transId))
34+
else:
35+
print("Failed to create customer payment profile from transaction %s" % response.messages.message[0]['text'].text)
3636

37-
return response
37+
return response
3838

3939
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
40-
create_customer_profile_from_transaction(constants.transactionId)
40+
create_customer_profile_from_transaction(constants.transactionId)

CustomerProfiles/create-customer-profile.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88

99
def create_customer_profile():
1010

11-
merchantAuth = apicontractsv1.merchantAuthenticationType()
12-
merchantAuth.name = constants.apiLoginId
13-
merchantAuth.transactionKey = constants.transactionKey
11+
merchantAuth = apicontractsv1.merchantAuthenticationType()
12+
merchantAuth.name = constants.apiLoginId
13+
merchantAuth.transactionKey = constants.transactionKey
1414

1515

16-
createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
17-
createCustomerProfile.merchantAuthentication = merchantAuth
18-
createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)), 'John2 Doe', 'jdoe@mail.com')
16+
createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
17+
createCustomerProfile.merchantAuthentication = merchantAuth
18+
createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)), 'John2 Doe', 'jdoe@mail.com')
1919

20-
controller = createCustomerProfileController(createCustomerProfile)
21-
controller.execute()
20+
controller = createCustomerProfileController(createCustomerProfile)
21+
controller.execute()
2222

23-
response = controller.getresponse()
23+
response = controller.getresponse()
2424

25-
if (response.messages.resultCode=="Ok"):
26-
print("Successfully created a customer profile with id: %s" % response.customerProfileId)
27-
else:
28-
print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text)
25+
if (response.messages.resultCode=="Ok"):
26+
print("Successfully created a customer profile with id: %s" % response.customerProfileId)
27+
else:
28+
print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text)
2929

30-
return response
30+
return response
3131

3232
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
33-
create_customer_profile()
33+
create_customer_profile()

CustomerProfiles/create-customer-shipping-address.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@
77
constants = imp.load_source('modulename', 'constants.py')
88

99
def create_customer_shipping_address(customerProfileId):
10-
# Give merchant details
11-
merchantAuth = apicontractsv1.merchantAuthenticationType()
12-
merchantAuth.name = constants.apiLoginId
13-
merchantAuth.transactionKey = constants.transactionKey
14-
15-
# Give address details
16-
officeAddress = apicontractsv1.customerAddressType();
17-
officeAddress.firstName = "John"
18-
officeAddress.lastName = "Doe"
19-
officeAddress.address = "123 Main St."
20-
officeAddress.city = "Bellevue"
21-
officeAddress.state = "WA"
22-
officeAddress.zip = "98004"
23-
officeAddress.country = "USA"
24-
officeAddress.phoneNumber = "000-000-0000"
25-
26-
# Create shipping address request
27-
shippingAddressRequest = apicontractsv1.createCustomerShippingAddressRequest();
28-
shippingAddressRequest.address = officeAddress
29-
shippingAddressRequest.customerProfileId = customerProfileId
30-
shippingAddressRequest.merchantAuthentication = merchantAuth
31-
32-
# Make an API call
33-
controller = createCustomerShippingAddressController(shippingAddressRequest)
34-
controller.execute()
35-
response = controller.getresponse();
36-
37-
if response.messages.resultCode == "Ok":
38-
print("SUCCESS")
39-
print("Transaction ID : %s " % response.messages.message[0]['text'].text)
40-
print("Customer address id : %s" % response.customerAddressId)
41-
else:
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-
46-
return response
10+
# Give merchant details
11+
merchantAuth = apicontractsv1.merchantAuthenticationType()
12+
merchantAuth.name = constants.apiLoginId
13+
merchantAuth.transactionKey = constants.transactionKey
14+
15+
# Give address details
16+
officeAddress = apicontractsv1.customerAddressType()
17+
officeAddress.firstName = "John"
18+
officeAddress.lastName = "Doe"
19+
officeAddress.address = "123 Main St."
20+
officeAddress.city = "Bellevue"
21+
officeAddress.state = "WA"
22+
officeAddress.zip = "98004"
23+
officeAddress.country = "USA"
24+
officeAddress.phoneNumber = "000-000-0000"
25+
26+
# Create shipping address request
27+
shippingAddressRequest = apicontractsv1.createCustomerShippingAddressRequest()
28+
shippingAddressRequest.address = officeAddress
29+
shippingAddressRequest.customerProfileId = customerProfileId
30+
shippingAddressRequest.merchantAuthentication = merchantAuth
31+
32+
# Make an API call
33+
controller = createCustomerShippingAddressController(shippingAddressRequest)
34+
controller.execute()
35+
response = controller.getresponse()
36+
37+
if response.messages.resultCode == "Ok":
38+
print("SUCCESS")
39+
print("Transaction ID : %s " % response.messages.message[0]['text'].text)
40+
print("Customer address id : %s" % response.customerAddressId)
41+
else:
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+
46+
return response
4747

4848
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
49-
create_customer_shipping_address(constants.customerProfileId)
49+
create_customer_shipping_address(constants.customerProfileId)

CustomerProfiles/delete-customer-payment-profile.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
constants = imp.load_source('modulename', 'constants.py')
77

88
def delete_customer_payment_profile(customerProfileId, customerPaymentProfileId):
9-
merchantAuth = apicontractsv1.merchantAuthenticationType()
10-
merchantAuth.name = constants.apiLoginId
11-
merchantAuth.transactionKey = constants.transactionKey
9+
merchantAuth = apicontractsv1.merchantAuthenticationType()
10+
merchantAuth.name = constants.apiLoginId
11+
merchantAuth.transactionKey = constants.transactionKey
1212

13-
deleteCustomerPaymentProfile = apicontractsv1.deleteCustomerPaymentProfileRequest()
14-
deleteCustomerPaymentProfile.merchantAuthentication = merchantAuth
15-
deleteCustomerPaymentProfile.customerProfileId = customerProfileId
16-
deleteCustomerPaymentProfile.customerPaymentProfileId = customerPaymentProfileId
13+
deleteCustomerPaymentProfile = apicontractsv1.deleteCustomerPaymentProfileRequest()
14+
deleteCustomerPaymentProfile.merchantAuthentication = merchantAuth
15+
deleteCustomerPaymentProfile.customerProfileId = customerProfileId
16+
deleteCustomerPaymentProfile.customerPaymentProfileId = customerPaymentProfileId
1717

18-
controller = deleteCustomerPaymentProfileController(deleteCustomerPaymentProfile)
19-
controller.execute()
18+
controller = deleteCustomerPaymentProfileController(deleteCustomerPaymentProfile)
19+
controller.execute()
2020

21-
response = controller.getresponse()
21+
response = controller.getresponse()
2222

23-
if (response.messages.resultCode=="Ok"):
24-
print("Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId)
25-
else:
26-
print(response.messages.message[0]['text'].text)
27-
print("Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId)
23+
if (response.messages.resultCode=="Ok"):
24+
print("Successfully deleted customer payment profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId)
25+
else:
26+
print(response.messages.message[0]['text'].text)
27+
print("Failed to delete customer paymnet profile with customer profile id %s" % deleteCustomerPaymentProfile.customerProfileId)
2828

29-
return response
29+
return response
3030

3131
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
32-
delete_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)
32+
delete_customer_payment_profile(constants.customerProfileId, constants.customerPaymentProfileId)

CustomerProfiles/delete-customer-profile.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
constants = imp.load_source('modulename', 'constants.py')
77

88
def delete_customer_profile(customerProfileId):
9-
merchantAuth = apicontractsv1.merchantAuthenticationType()
10-
merchantAuth.name = constants.apiLoginId
11-
merchantAuth.transactionKey = constants.transactionKey
9+
merchantAuth = apicontractsv1.merchantAuthenticationType()
10+
merchantAuth.name = constants.apiLoginId
11+
merchantAuth.transactionKey = constants.transactionKey
1212

13-
deleteCustomerProfile = apicontractsv1.deleteCustomerProfileRequest()
14-
deleteCustomerProfile.merchantAuthentication = merchantAuth
15-
deleteCustomerProfile.customerProfileId = customerProfileId
13+
deleteCustomerProfile = apicontractsv1.deleteCustomerProfileRequest()
14+
deleteCustomerProfile.merchantAuthentication = merchantAuth
15+
deleteCustomerProfile.customerProfileId = customerProfileId
1616

17-
controller = deleteCustomerProfileController(deleteCustomerProfile)
18-
controller.execute()
17+
controller = deleteCustomerProfileController(deleteCustomerProfile)
18+
controller.execute()
1919

20-
response = controller.getresponse()
20+
response = controller.getresponse()
2121

22-
if (response.messages.resultCode=="Ok"):
23-
print("Successfully deleted customer with customer profile id %s" % deleteCustomerProfile.customerProfileId)
24-
else:
25-
print(response.messages.message[0]['text'].text)
26-
print("Failed to delete customer profile with customer profile id %s" % deleteCustomerProfile.customerProfileId)
22+
if (response.messages.resultCode=="Ok"):
23+
print("Successfully deleted customer with customer profile id %s" % deleteCustomerProfile.customerProfileId)
24+
else:
25+
print(response.messages.message[0]['text'].text)
26+
print("Failed to delete customer profile with customer profile id %s" % deleteCustomerProfile.customerProfileId)
2727

28-
return response
28+
return response
2929

3030
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
31-
delete_customer_profile(constants.customerProfileId)
31+
delete_customer_profile(constants.customerProfileId)

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