diff --git a/.travis.yml b/.travis.yml index c866897..f5a749f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: python sudo: false +dist: trusty + python: - "2.7" - "3.4" @@ -18,7 +20,8 @@ matrix: # Will have to investigate further. - python: "pypy" - python: "pypy3" - # pypy will just crash due to an incompatibility with lxml. + - python: "3.4" + # pypy and 3.4 will just crash due to an incompatibility with lxml. # Newer versions of pypy seem to crash also, so we probably have to fix with a newer version of lxml install: diff --git a/PaymentTransactions/create-an-accept-payment-transaction.py b/AcceptSuite/create-an-accept-payment-transaction.py similarity index 97% rename from PaymentTransactions/create-an-accept-payment-transaction.py rename to AcceptSuite/create-an-accept-payment-transaction.py index 21ebbca..ee28fd9 100644 --- a/PaymentTransactions/create-an-accept-payment-transaction.py +++ b/AcceptSuite/create-an-accept-payment-transaction.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader import time from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def create_an_accept_payment_transaction(amount): diff --git a/CustomerProfiles/get-accept-customer-profile-page.py b/AcceptSuite/get-accept-customer-profile-page.py similarity index 94% rename from CustomerProfiles/get-accept-customer-profile-page.py rename to AcceptSuite/get-accept-customer-profile-page.py index ee29377..9cb5cbe 100644 --- a/CustomerProfiles/get-accept-customer-profile-page.py +++ b/AcceptSuite/get-accept-customer-profile-page.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_accept_customer_profile_page(customerProfileId): diff --git a/PaymentTransactions/get-an-accept-payment-page.py b/AcceptSuite/get-an-accept-payment-page.py similarity index 94% rename from PaymentTransactions/get-an-accept-payment-page.py rename to AcceptSuite/get-an-accept-payment-page.py index 33bca4f..1caffc9 100644 --- a/PaymentTransactions/get-an-accept-payment-page.py +++ b/AcceptSuite/get-an-accept-payment-page.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_an_accept_payment_page(amount): diff --git a/CustomerProfiles/create-customer-payment-profile.py b/CustomerProfiles/create-customer-payment-profile.py index 5400e5e..0d249e9 100644 --- a/CustomerProfiles/create-customer-payment-profile.py +++ b/CustomerProfiles/create-customer-payment-profile.py @@ -1,9 +1,10 @@ import os, sys -import imp +import random +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def create_customer_payment_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() @@ -12,14 +13,14 @@ def create_customer_payment_profile(customerProfileId): creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" payment = apicontractsv1.paymentType() payment.creditCard = creditCard billTo = apicontractsv1.customerAddressType() - billTo.firstName = "John" - billTo.lastName = "Snow" + billTo.firstName = "John" + str(random.randint(0, 10000)) + billTo.lastName = "Snow" + str(random.randint(0, 10000)) profile = apicontractsv1.customerPaymentProfileType() profile.payment = payment diff --git a/CustomerProfiles/create-customer-profile-from-transaction.py b/CustomerProfiles/create-customer-profile-from-transaction.py index e686fd5..efc6838 100644 --- a/CustomerProfiles/create-customer-profile-from-transaction.py +++ b/CustomerProfiles/create-customer-profile-from-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def create_customer_profile_from_transaction(transactionId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/CustomerProfiles/create-customer-profile.py b/CustomerProfiles/create-customer-profile.py index e2ba834..997f2e2 100644 --- a/CustomerProfiles/create-customer-profile.py +++ b/CustomerProfiles/create-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() import random def create_customer_profile(): diff --git a/CustomerProfiles/create-customer-shipping-address.py b/CustomerProfiles/create-customer-shipping-address.py index 436f286..3fb086f 100644 --- a/CustomerProfiles/create-customer-shipping-address.py +++ b/CustomerProfiles/create-customer-shipping-address.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader # Gives error if an address is already present for the given customer Id from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def create_customer_shipping_address(customerProfileId): # Give merchant details diff --git a/CustomerProfiles/delete-customer-payment-profile.py b/CustomerProfiles/delete-customer-payment-profile.py index 17e539d..a071a7e 100644 --- a/CustomerProfiles/delete-customer-payment-profile.py +++ b/CustomerProfiles/delete-customer-payment-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def delete_customer_payment_profile(customerProfileId, customerPaymentProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/CustomerProfiles/delete-customer-profile.py b/CustomerProfiles/delete-customer-profile.py index 9a21fd4..a4f2a49 100644 --- a/CustomerProfiles/delete-customer-profile.py +++ b/CustomerProfiles/delete-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def delete_customer_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/CustomerProfiles/delete-customer-shipping-address.py b/CustomerProfiles/delete-customer-shipping-address.py index b855981..c0a48eb 100644 --- a/CustomerProfiles/delete-customer-shipping-address.py +++ b/CustomerProfiles/delete-customer-shipping-address.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def delete_customer_shipping_address(customerProfileId, customerProfileShippingId): diff --git a/CustomerProfiles/get-customer-payment-profile-list.py b/CustomerProfiles/get-customer-payment-profile-list.py index 7b3fd74..51d84d6 100644 --- a/CustomerProfiles/get-customer-payment-profile-list.py +++ b/CustomerProfiles/get-customer-payment-profile-list.py @@ -1,12 +1,12 @@ """http://developer.authorize.net/api/reference/#customer-profiles-get-customer-payment-profile-list""" import os import sys -import imp +from importlib.machinery import SourceFileLoader import time from authorizenet import apicontractsv1 from authorizenet.apicontrollers import getCustomerPaymentProfileListController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_customer_payment_profile_list(): diff --git a/CustomerProfiles/get-customer-payment-profile.py b/CustomerProfiles/get-customer-payment-profile.py index 2735fb6..3198fec 100644 --- a/CustomerProfiles/get-customer-payment-profile.py +++ b/CustomerProfiles/get-customer-payment-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_customer_payment_profile(customerProfileId, customerPaymentProfileId): diff --git a/CustomerProfiles/get-customer-profile-ids.py b/CustomerProfiles/get-customer-profile-ids.py index 5cdd915..b889063 100644 --- a/CustomerProfiles/get-customer-profile-ids.py +++ b/CustomerProfiles/get-customer-profile-ids.py @@ -1,11 +1,11 @@ """http://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile-ids""" import os import sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import getCustomerProfileIdsController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_customer_profile_ids(): """get customer profile IDs""" diff --git a/CustomerProfiles/get-customer-profile.py b/CustomerProfiles/get-customer-profile.py index 0ac4205..9bce455 100644 --- a/CustomerProfiles/get-customer-profile.py +++ b/CustomerProfiles/get-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_customer_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/CustomerProfiles/get-customer-shipping-address.py b/CustomerProfiles/get-customer-shipping-address.py index e92402b..43267e4 100644 --- a/CustomerProfiles/get-customer-shipping-address.py +++ b/CustomerProfiles/get-customer-shipping-address.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_customer_shipping_address(customerProfileId, customerAddressId): # Give merchant details diff --git a/CustomerProfiles/update-customer-payment-profile.py b/CustomerProfiles/update-customer-payment-profile.py index 50356a3..41e57d9 100644 --- a/CustomerProfiles/update-customer-payment-profile.py +++ b/CustomerProfiles/update-customer-payment-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def update_customer_payment_profile(customerProfileId, customerPaymentProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() @@ -12,7 +12,7 @@ def update_customer_payment_profile(customerProfileId, customerPaymentProfileId) creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" payment = apicontractsv1.paymentType() payment.creditCard = creditCard diff --git a/CustomerProfiles/update-customer-profile.py b/CustomerProfiles/update-customer-profile.py index 2dc883e..567abda 100644 --- a/CustomerProfiles/update-customer-profile.py +++ b/CustomerProfiles/update-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def update_customer_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/CustomerProfiles/update-customer-shipping-address.py b/CustomerProfiles/update-customer-shipping-address.py index d5aa7fc..fae3438 100644 --- a/CustomerProfiles/update-customer-shipping-address.py +++ b/CustomerProfiles/update-customer-shipping-address.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def update_customer_shipping_address(customerProfileId, customerAddressId): # Give merchant details diff --git a/CustomerProfiles/validate-customer-payment-profile.py b/CustomerProfiles/validate-customer-payment-profile.py index e216e79..a995b88 100644 --- a/CustomerProfiles/validate-customer-payment-profile.py +++ b/CustomerProfiles/validate-customer-payment-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def validate_customer_payment_profile(customerProfileId, customerPaymentProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/FraudManagement/approve-or-decline-held-transaction.py b/FraudManagement/approve-or-decline-held-transaction.py index ce9947e..16ef2c0 100644 --- a/FraudManagement/approve-or-decline-held-transaction.py +++ b/FraudManagement/approve-or-decline-held-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def approve_or_decline_held_transaction(transactionId): diff --git a/FraudManagement/get-held-transaction-list.py b/FraudManagement/get-held-transaction-list.py index 8f6e116..5e0b736 100644 --- a/FraudManagement/get-held-transaction-list.py +++ b/FraudManagement/get-held-transaction-list.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_unsettled_transaction_list(): @@ -27,8 +27,8 @@ def get_unsettled_transaction_list(): for transaction in unsettledTransactionListResponse.transactions.transaction: print('Transaction Id : %s' % transaction.transId) print('Transaction Status : %s' % transaction.transactionStatus) - print('Amount Type : %s' % transaction.accountType) - print('Settle Amount : %s' % transaction.settleAmount) + print('Amount Type : %.2f' % transaction.accountType) + print('Settle Amount : %.2f' % transaction.settleAmount) if unsettledTransactionListResponse.messages: print('Message Code : %s' % unsettledTransactionListResponse.messages.message[0]['code'].text) diff --git a/MobileInAppTransactions/create-an-accept-transaction.py b/MobileInAppTransactions/create-an-accept-transaction.py index ec6d5b0..2495f74 100644 --- a/MobileInAppTransactions/create-an-accept-transaction.py +++ b/MobileInAppTransactions/create-an-accept-transaction.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader import time from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def create_an_accept_transaction(amount): diff --git a/MobileInAppTransactions/create-an-android-pay-transaction.py b/MobileInAppTransactions/create-an-android-pay-transaction.py index c4881cd..96199d7 100644 --- a/MobileInAppTransactions/create-an-android-pay-transaction.py +++ b/MobileInAppTransactions/create-an-android-pay-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def create_an_android_pay_transaction(): diff --git a/MobileInAppTransactions/create-an-apple-pay-transaction.py b/MobileInAppTransactions/create-an-apple-pay-transaction.py index fae7523..4411b8e 100644 --- a/MobileInAppTransactions/create-an-apple-pay-transaction.py +++ b/MobileInAppTransactions/create-an-apple-pay-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def create_an_apple_pay_transaction(): diff --git a/MobileInAppTransactions/create-google-pay-transaction.py b/MobileInAppTransactions/create-google-pay-transaction.py new file mode 100644 index 0000000..8684b57 --- /dev/null +++ b/MobileInAppTransactions/create-google-pay-transaction.py @@ -0,0 +1,70 @@ +import os, sys +from importlib.machinery import SourceFileLoader + +from authorizenet import apicontractsv1 +from authorizenet.apicontrollers import * +constants = SourceFileLoader('modulename', 'constants.py').load_module() +from decimal import * + +def create_google_pay_transaction(): + + merchantAuth = apicontractsv1.merchantAuthenticationType() + merchantAuth.name = constants.apiLoginId + merchantAuth.transactionKey = constants.transactionKey + + opaqueData = apicontractsv1.opaqueDataType() + opaqueData.dataDescriptor = "COMMON.GOOGLE.INAPP.PAYMENT" + opaqueData.dataValue = "1234567890ABCDEF1111AAAA2222BBBB3333CCCC4444DDDD5555EEEE6666FFFF7777888899990000" + + paymentType = apicontractsv1.paymentType() + paymentType.opaqueData = opaqueData + + tax = apicontractsv1.extendedAmountType() + tax.amount = Decimal('15.00') + tax.name = "level2 tax name" + tax.description = "level2 tax" + + transactionrequest = apicontractsv1.transactionRequestType() + transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction + transactionrequest.amount = Decimal('151') + transactionrequest.payment = paymentType + transactionrequest.tax = tax + + request = apicontractsv1.createTransactionRequest() + request.merchantAuthentication = merchantAuth + request.refId = "Sample" + request.transactionRequest = transactionrequest + + controller = createTransactionController(request) + controller.execute() + + response = controller.getresponse() + + if response is not None: + if response.messages.resultCode == "Ok": + if hasattr(response.transactionResponse, 'messages') == True: + print('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId) + print('Transaction Response Code: %s' % response.transactionResponse.responseCode) + print('Message Code: %s' % response.transactionResponse.messages.message[0].code) + print('Description: %s' % response.transactionResponse.messages.message[0].description) + print('AUTH Code : %s' % response.authCode) + else: + print('Failed Transaction.') + if hasattr(response.transactionResponse, 'errors') == True: + print('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) + print('Error message: %s' % response.transactionResponse.errors.error[0].errorText) + else: + print('Failed Transaction.') + if hasattr(response, 'transactionResponse') == True and hasattr(response.transactionResponse, 'errors') == True: + print('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) + print('Error message: %s' % response.transactionResponse.errors.error[0].errorText) + else: + print('Error Code: %s' % response.messages.message[0]['code'].text) + print('Error message: %s' % response.messages.message[0]['text'].text) + else: + print('Null Response.') + + return response + +if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): + create_google_pay_transaction() diff --git a/PayPalExpressCheckout/authorization-and-capture-continued.py b/PayPalExpressCheckout/authorization-and-capture-continued.py index 0c7b08d..84cdde3 100644 --- a/PayPalExpressCheckout/authorization-and-capture-continued.py +++ b/PayPalExpressCheckout/authorization-and-capture-continued.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def authorization_and_capture_continued(refTransId, payerID): diff --git a/PayPalExpressCheckout/authorization-and-capture.py b/PayPalExpressCheckout/authorization-and-capture.py index a0e3f2e..df113fe 100644 --- a/PayPalExpressCheckout/authorization-and-capture.py +++ b/PayPalExpressCheckout/authorization-and-capture.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def authorization_and_capture(amount): diff --git a/PayPalExpressCheckout/authorization-only-continued.py b/PayPalExpressCheckout/authorization-only-continued.py index 7a2f313..e53c1b2 100644 --- a/PayPalExpressCheckout/authorization-only-continued.py +++ b/PayPalExpressCheckout/authorization-only-continued.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def authorization_only_continued(): @@ -14,14 +14,14 @@ def authorization_only_continued(): paypal = apicontractsv1.payPalType() paypal.successUrl = "http://www.merchanteCommerceSite.com/Success/TC25262" paypal.cancelUrl = "http://www.merchanteCommerceSite.com/Success/TC25262" - paypal.payerID = "LM6NCLZ5RAKBY" + paypal.payerID = "586E72QHPGHXS" payment = apicontractsv1.paymentType() payment.payPal = paypal transactionrequest = apicontractsv1.transactionRequestType() transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyContinueTransaction - transactionrequest.refTransId = "2245592542" + transactionrequest.refTransId = "60158280211" transactionrequest.payment = payment request = apicontractsv1.createTransactionRequest() diff --git a/PayPalExpressCheckout/authorization-only.py b/PayPalExpressCheckout/authorization-only.py index 192835d..c89a434 100644 --- a/PayPalExpressCheckout/authorization-only.py +++ b/PayPalExpressCheckout/authorization-only.py @@ -1,9 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader +import random from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def authorization_only(): @@ -19,7 +20,7 @@ def authorization_only(): payment.payPal = paypal transactionrequest = apicontractsv1.transactionRequestType() - transactionrequest.amount = Decimal('55.00') + transactionrequest.amount = Decimal(random.uniform(1, 100)).quantize(Decimal('0.01')) transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyTransaction transactionrequest.payment = payment diff --git a/PayPalExpressCheckout/credit.py b/PayPalExpressCheckout/credit.py index a333aea..a92d23c 100644 --- a/PayPalExpressCheckout/credit.py +++ b/PayPalExpressCheckout/credit.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def credit(): diff --git a/PayPalExpressCheckout/get-details.py b/PayPalExpressCheckout/get-details.py index 659ff03..e5857df 100644 --- a/PayPalExpressCheckout/get-details.py +++ b/PayPalExpressCheckout/get-details.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_details(refTransId): diff --git a/PayPalExpressCheckout/prior-authorization-capture.py b/PayPalExpressCheckout/prior-authorization-capture.py index 38d537f..e8426ed 100644 --- a/PayPalExpressCheckout/prior-authorization-capture.py +++ b/PayPalExpressCheckout/prior-authorization-capture.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def prior_authorization_capture(refTransId): diff --git a/PayPalExpressCheckout/void.py b/PayPalExpressCheckout/void.py index 9961d3c..680a227 100644 --- a/PayPalExpressCheckout/void.py +++ b/PayPalExpressCheckout/void.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def void(refTransId): diff --git a/PaymentTransactions/authorize-credit-card.py b/PaymentTransactions/authorize-credit-card.py index 96f0f70..de6ffd9 100644 --- a/PaymentTransactions/authorize-credit-card.py +++ b/PaymentTransactions/authorize-credit-card.py @@ -2,14 +2,14 @@ Authorize a credit card (without actually charging it) """ -import imp +from importlib.machinery import SourceFileLoader import os import sys from authorizenet import apicontractsv1 from authorizenet.apicontrollers import createTransactionController -CONSTANTS = imp.load_source('modulename', 'constants.py') +CONSTANTS = SourceFileLoader('modulename', 'constants.py').load_module() def authorize_credit_card(amount): @@ -26,7 +26,7 @@ def authorize_credit_card(amount): # Create the payment data for a credit card creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" creditCard.cardCode = "123" # Add the payment data to a paymentType object @@ -148,4 +148,4 @@ def authorize_credit_card(amount): if (os.path.basename(__file__) == os.path.basename(sys.argv[0])): - authorize_credit_card(CONSTANTS.amount) + authorize_credit_card(CONSTANTS.amount + str(100)) diff --git a/PaymentTransactions/capture-funds-authorized-through-another-channel.py b/PaymentTransactions/capture-funds-authorized-through-another-channel.py index e2d6b9b..a20709f 100644 --- a/PaymentTransactions/capture-funds-authorized-through-another-channel.py +++ b/PaymentTransactions/capture-funds-authorized-through-another-channel.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader import random from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def capture_funds_authorized_through_another_channel(): @@ -17,7 +17,7 @@ def capture_funds_authorized_through_another_channel(): creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" payment = apicontractsv1.paymentType() payment.creditCard = creditCard diff --git a/PaymentTransactions/capture-previously-authorized-amount.py b/PaymentTransactions/capture-previously-authorized-amount.py index 0b21ba6..2f8c154 100644 --- a/PaymentTransactions/capture-previously-authorized-amount.py +++ b/PaymentTransactions/capture-previously-authorized-amount.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def capture_previously_authorized_amount(transactionId): diff --git a/PaymentTransactions/charge-credit-card.py b/PaymentTransactions/charge-credit-card.py index 4d57ced..b132d78 100644 --- a/PaymentTransactions/charge-credit-card.py +++ b/PaymentTransactions/charge-credit-card.py @@ -2,14 +2,14 @@ Charge a credit card """ -import imp +from importlib.machinery import SourceFileLoader import os import sys from authorizenet import apicontractsv1 from authorizenet.apicontrollers import createTransactionController -CONSTANTS = imp.load_source('modulename', 'constants.py') +CONSTANTS = SourceFileLoader('modulename', 'constants.py').load_module() def charge_credit_card(amount): @@ -26,7 +26,7 @@ def charge_credit_card(amount): # Create the payment data for a credit card creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" creditCard.cardCode = "123" # Add the payment data to a paymentType object diff --git a/PaymentTransactions/charge-customer-profile.py b/PaymentTransactions/charge-customer-profile.py index a629671..91a4df6 100644 --- a/PaymentTransactions/charge-customer-profile.py +++ b/PaymentTransactions/charge-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def charge_customer_profile(customerProfileId, paymentProfileId, amount): diff --git a/PaymentTransactions/charge-tokenized-credit-card.py b/PaymentTransactions/charge-tokenized-credit-card.py index d931e69..f1054c0 100644 --- a/PaymentTransactions/charge-tokenized-credit-card.py +++ b/PaymentTransactions/charge-tokenized-credit-card.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def charge_tokenized_credit_card(): @@ -13,7 +13,7 @@ def charge_tokenized_credit_card(): creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" # Set the token specific info creditCard.isPaymentToken = True creditCard.cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA=" diff --git a/PaymentTransactions/create-chase-pay-transaction.py b/PaymentTransactions/create-chase-pay-transaction.py new file mode 100644 index 0000000..dbd9c10 --- /dev/null +++ b/PaymentTransactions/create-chase-pay-transaction.py @@ -0,0 +1,71 @@ +import os, sys +from importlib.machinery import SourceFileLoader + +from authorizenet import apicontractsv1 +from authorizenet.apicontrollers import * +from authorizenet.constants import constants +from decimal import * + +def create_chase_pay_transaction(): + merchantAuth = apicontractsv1.merchantAuthenticationType() + merchantAuth.name = constants.apiLoginId + merchantAuth.transactionKey = constants.transactionKey + + creditCard = apicontractsv1.creditCardType() + creditCard.cardNumber = "4111111111111111" + creditCard.expirationDate = "2035-12" + creditCard.cardCode="999" + # Set the token specific info + creditCard.isPaymentToken = True + creditCard.cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA=" + creditCard.tokenRequestorName="CHASE_PAY" + creditCard.tokenRequestorId="12345678901" + creditCard.tokenRequestorEci="07" + + payment = apicontractsv1.paymentType() + payment.creditCard = creditCard + + transactionrequest = apicontractsv1.transactionRequestType() + transactionrequest.transactionType = "authCaptureTransaction" + transactionrequest.amount = Decimal ('1.50') + transactionrequest.payment = payment + + createtransactionrequest = apicontractsv1.createTransactionRequest() + createtransactionrequest.merchantAuthentication = merchantAuth + createtransactionrequest.refId = "MerchantID-0001" + createtransactionrequest.transactionRequest = transactionrequest + + createtransactioncontroller = createTransactionController(createtransactionrequest) + createtransactioncontroller.execute() + + response = createtransactioncontroller.getresponse() + + if response is not None: + if response.messages.resultCode == "Ok": + if hasattr(response.transactionResponse, 'messages') == True: + print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId) + print ('Transaction Response Code: %s' % response.transactionResponse.responseCode) + print ('Message Code: %s' % response.transactionResponse.messages.message[0].code) + print ('Description: %s' % response.transactionResponse.messages.message[0].description) + else: + print ('Failed Transaction.') + if hasattr(response.transactionResponse, 'errors') == True: + print ('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) + print ('Error message: %s' % response.transactionResponse.errors.error[0].errorText) + else: + print ('Failed Transaction.') + if hasattr(response, 'transactionResponse') == True and hasattr(response.transactionResponse, 'errors') == True: + print ('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) + print ('Error message: %s' % response.transactionResponse.errors.error[0].errorText) + else: + print ('Error Code: %s' % response.messages.message[0]['code'].text) + print ('Error message: %s' % response.messages.message[0]['text'].text) + else: + print ('Failed to get response.') + if hasattr(response, 'transactionResponse') == True and hasattr(response.transactionResponse, 'errors') == True: + print ('Error Code: %s' % str(response.transactionResponse.errors.error[0].errorCode)) + print ('Error message: %s' % response.transactionResponse.errors.error[0].errorText) + return response + +if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): + create_chase_pay_transaction() diff --git a/PaymentTransactions/credit-bank-account.py b/PaymentTransactions/credit-bank-account.py index e030050..c3b3373 100644 --- a/PaymentTransactions/credit-bank-account.py +++ b/PaymentTransactions/credit-bank-account.py @@ -2,7 +2,7 @@ Credit a bank account """ -import imp +from importlib.machinery import SourceFileLoader import os import sys import random @@ -10,7 +10,7 @@ from authorizenet import apicontractsv1 from authorizenet.apicontrollers import createTransactionController -CONSTANTS = imp.load_source('modulename', 'constants.py') +CONSTANTS = SourceFileLoader('modulename', 'constants.py').load_module() def credit_bank_account(amount): diff --git a/PaymentTransactions/debit-bank-account.py b/PaymentTransactions/debit-bank-account.py index c246344..bbb5878 100644 --- a/PaymentTransactions/debit-bank-account.py +++ b/PaymentTransactions/debit-bank-account.py @@ -2,7 +2,7 @@ Debit a bank account """ -import imp +from importlib.machinery import SourceFileLoader import os import sys import random @@ -10,7 +10,7 @@ from authorizenet import apicontractsv1 from authorizenet.apicontrollers import createTransactionController -CONSTANTS = imp.load_source('modulename', 'constants.py') +CONSTANTS = SourceFileLoader('modulename', 'constants.py').load_module() def debit_bank_account(amount): @@ -29,7 +29,7 @@ def debit_bank_account(amount): accountType = apicontractsv1.bankAccountTypeEnum bankAccount.accountType = accountType.checking bankAccount.routingNumber = "121042882" - bankAccount.accountNumber = "1234567890" + bankAccount.accountNumber = str(random.randint(10000,999999999999)) bankAccount.nameOnAccount = "John Doe" # Add the payment data to a paymentType object diff --git a/PaymentTransactions/refund-transaction.py b/PaymentTransactions/refund-transaction.py index 0d3f65b..246b3bc 100644 --- a/PaymentTransactions/refund-transaction.py +++ b/PaymentTransactions/refund-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def refund_transaction(refTransId): diff --git a/PaymentTransactions/update-split-tender-group.py b/PaymentTransactions/update-split-tender-group.py index 7883d69..18cadbf 100644 --- a/PaymentTransactions/update-split-tender-group.py +++ b/PaymentTransactions/update-split-tender-group.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def update_split_tender_group(): diff --git a/PaymentTransactions/void-transaction.py b/PaymentTransactions/void-transaction.py index a32705a..6420a99 100644 --- a/PaymentTransactions/void-transaction.py +++ b/PaymentTransactions/void-transaction.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def void_transaction(refTransId): diff --git a/RecurringBilling/cancel-subscription.py b/RecurringBilling/cancel-subscription.py index f627f26..e87f38f 100644 --- a/RecurringBilling/cancel-subscription.py +++ b/RecurringBilling/cancel-subscription.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def cancel_subscription(subscriptionId): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/RecurringBilling/create-subscription-from-customer-profile.py b/RecurringBilling/create-subscription-from-customer-profile.py index d959284..62115d2 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.py +++ b/RecurringBilling/create-subscription-from-customer-profile.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * from datetime import * @@ -18,7 +18,7 @@ def create_subscription_from_customer_profile(amount, days, profileId, paymentPr paymentschedule.interval = apicontractsv1.paymentScheduleTypeInterval() #apicontractsv1.CTD_ANON() #modified by krgupta paymentschedule.interval.length = days paymentschedule.interval.unit = apicontractsv1.ARBSubscriptionUnitEnum.days - paymentschedule.startDate = datetime(2020, 8, 30) + paymentschedule.startDate = datetime(2030, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 diff --git a/RecurringBilling/create-subscription.py b/RecurringBilling/create-subscription.py index bd8ae5d..7b6f3d5 100644 --- a/RecurringBilling/create-subscription.py +++ b/RecurringBilling/create-subscription.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * from datetime import * @@ -18,13 +18,13 @@ def create_subscription(amount, days): paymentschedule.interval = apicontractsv1.paymentScheduleTypeInterval() #apicontractsv1.CTD_ANON() #modified by krgupta paymentschedule.interval.length = days paymentschedule.interval.unit = apicontractsv1.ARBSubscriptionUnitEnum.days - paymentschedule.startDate = datetime(2020, 8, 30) + paymentschedule.startDate = datetime(2030, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 # Giving the credit card info creditcard = apicontractsv1.creditCardType() creditcard.cardNumber = "4111111111111111" - creditcard.expirationDate = "2020-12" + creditcard.expirationDate = "2035-12" payment = apicontractsv1.paymentType() payment.creditCard = creditcard # Setting billing information diff --git a/RecurringBilling/get-list-of-subscriptions.py b/RecurringBilling/get-list-of-subscriptions.py index eb67c6f..b160679 100644 --- a/RecurringBilling/get-list-of-subscriptions.py +++ b/RecurringBilling/get-list-of-subscriptions.py @@ -1,11 +1,11 @@ """http://developer.authorize.net/api/reference/#recurring-billing-get-a-list-of-subscriptions""" import os import sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import ARBGetSubscriptionListController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_list_of_subscriptions(): """get list of subscriptions""" diff --git a/RecurringBilling/get-subscription-status.py b/RecurringBilling/get-subscription-status.py index ac21b8c..86004cb 100644 --- a/RecurringBilling/get-subscription-status.py +++ b/RecurringBilling/get-subscription-status.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_subscription_status(subscriptionId): # Setting the mercahnt details diff --git a/RecurringBilling/get-subscription.py b/RecurringBilling/get-subscription.py index f6ef8e2..fc1a9d3 100644 --- a/RecurringBilling/get-subscription.py +++ b/RecurringBilling/get-subscription.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_subscription(subscriptionId): @@ -15,6 +15,7 @@ def get_subscription(subscriptionId): getSubscription = apicontractsv1.ARBGetSubscriptionRequest() getSubscription.merchantAuthentication = merchantAuth getSubscription.subscriptionId = subscriptionId + getSubscription.includeTransactions = True getSubscriptionController = ARBGetSubscriptionController(getSubscription) getSubscriptionController.execute() @@ -23,10 +24,13 @@ def get_subscription(subscriptionId): if (response.messages.resultCode=="Ok"): print ("Subscription Name : %s" % response.subscription.name) + print ("Subscription Amount: %.2f" % response.subscription.amount) + for transaction in response.subscription.arbTransactions.arbTransaction: + print ("Transaction id: %d" % transaction.transId) else: print ("response code: %s" % response.messages.resultCode) return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): - get_subscription(constants.subscriptionId) \ No newline at end of file + get_subscription(constants.subscriptionId) diff --git a/RecurringBilling/update-subscription.py b/RecurringBilling/update-subscription.py index 3f7ba3a..ddd5d93 100644 --- a/RecurringBilling/update-subscription.py +++ b/RecurringBilling/update-subscription.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def update_subscription(subscriptionId): merchantAuth = apicontractsv1.merchantAuthenticationType() @@ -12,7 +12,7 @@ def update_subscription(subscriptionId): creditcard = apicontractsv1.creditCardType() creditcard.cardNumber = "4111111111111111" - creditcard.expirationDate = "2020-12" + creditcard.expirationDate = "2035-12" payment = apicontractsv1.paymentType() payment.creditCard = creditcard diff --git a/TransactionReporting/get-account-updater-job-details.py b/TransactionReporting/get-account-updater-job-details.py new file mode 100644 index 0000000..1074faa --- /dev/null +++ b/TransactionReporting/get-account-updater-job-details.py @@ -0,0 +1,93 @@ +import os +import sys +from authorizenet import apicontractsv1 +from authorizenet.apicontrollers import getAUJobDetailsController +from authorizenet.constants import constants + +def get_account_updater_job_details(): + merchantAuth = apicontractsv1.merchantAuthenticationType() + merchantAuth.name = constants.apiLoginId + merchantAuth.transactionKey = constants.transactionKey + + paging = apicontractsv1.Paging() + # Paging limit can be up to 1000 for this request + paging.limit = 1000 + paging.offset = 2 + request = apicontractsv1.getAUJobDetailsRequest() + request.merchantAuthentication = merchantAuth + request.paging = paging + request.month = "2018-08" + request.modifiedTypeFilter = "all" + request.refId = "123456" + controller = getAUJobDetailsController(request) + controller.execute() + response = controller.getresponse() + + if response is not None: + if response.messages.resultCode == apicontractsv1.messageTypeEnum.Ok: + + if hasattr(response, 'auDetails'): + print('SUCCESS: Get Account Updater job details for Month :' + request.month) + if response.messages is not None: + print('Message Code: %s' % response.messages.message[0]['code'].text) + print('Message Text: %s' % response.messages.message[0]['text'].text) + print('Total Number In Results: %s' % response.totalNumInResultSet) + print('\n') + + for details in response.auDetails.auDelete: + print('Deleted Profile:') + # auDelete Start + print('Customer Profile ID: %s' % details.customerProfileID) + print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID) + print('First Name: %s' % details.firstName) + print('Last Name: %s' % details.lastName) + print('AU Reason Code: %s' % details.auReasonCode) + print('Reason Description: %s' % details.reasonDescription) + print('Update Time UTC: %s' % details.updateTimeUTC) + print(' ') + # fetching card details: + print('Card Details:') + print('Card Number: %s' % details.creditCard.cardNumber) + print('Card Type: %s' % details.creditCard.cardType) + print('Expiration Date: %s' % details.creditCard.expirationDate) + # auDelete End + print('\n') + + for details in response.auDetails.auUpdate: + + # auUpdate Start + print('Updated Profile:') + print('Customer Profile ID: %s' % details.customerProfileID) + print('Customer Payment Profile ID: %s' % details.customerPaymentProfileID) + print('First Name: %s' % details.firstName) + print('Last Name: %s' % details.lastName) + print('AU Reason Code: %s' % details.auReasonCode) + print('Reason Description: %s' % details.reasonDescription) + print('Update Time UTC: %s' % details.updateTimeUTC) + # fetching Old card details: + print('Old Card details:') + print('old Card Number: %s' % details.oldCreditCard.cardNumber) + print('old Card Type: %s' % details.oldCreditCard.cardType) + print('old Expiration Date: %s' % details.oldCreditCard.expirationDate) + # fetching New card details: + print('Old Card details:') + print('new Card Number: %s' % details.newCreditCard.cardNumber) + print('new Card Type: %s' % details.newCreditCard.cardType) + print('new Expiration Date: %s' % details.newCreditCard.expirationDate) + + else: + print('Failed to get Get Account Updater job details for Month :' + request.month) + print('Message Code: %s' % response.messages.message[0]['code'].text) + print('Message Text: %s' % response.messages.message[0]['text'].text) + + else: + print('Failed to get Get Account Updater job details for Month :' + request.month) + print('Message Code: %s' % response.messages.message[0]['code'].text) + print('Message Text: %s' % response.messages.message[0]['text'].text) + else: + print('No response received') + + +if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): + get_account_updater_job_details() + diff --git a/TransactionReporting/get-batch-statistics.py b/TransactionReporting/get-batch-statistics.py index 99ae6f6..a0432bc 100644 --- a/TransactionReporting/get-batch-statistics.py +++ b/TransactionReporting/get-batch-statistics.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_batch_statistics(): @@ -14,7 +14,7 @@ def get_batch_statistics(): batchStatisticsRequest = apicontractsv1.getBatchStatisticsRequest() batchStatisticsRequest.merchantAuthentication = merchantAuth - batchStatisticsRequest.batchId = "4532808" + batchStatisticsRequest.batchId = "11224814" batchStatisticsController = getBatchStatisticsController(batchStatisticsRequest) @@ -26,14 +26,16 @@ def get_batch_statistics(): if batchStatisticsResponse.messages.resultCode == apicontractsv1.messageTypeEnum.Ok: print('Successfully got batch statistics!') + print('Batch :\n', batchStatisticsResponse) + print('Batch Id : %s' % batchStatisticsResponse.batch.batchId) print('Batch Settlement State : %s' % batchStatisticsResponse.batch.settlementState) print('Batch Payment Method : %s' % batchStatisticsResponse.batch.paymentMethod) for statistic in batchStatisticsResponse.batch.statistics.statistic: print('Account Type : %s' % statistic.accountType) - print('Charge Amount : %s' % statistic.chargeAmount) - print('Refund Amount : %s' % statistic.refundAmount) + print('Charge Amount : %.2f' % statistic.chargeAmount) + print('Refund Amount : %.2f' % statistic.refundAmount) print('Decline Count : %s' % statistic.declineCount) if batchStatisticsResponse.messages is not None: diff --git a/TransactionReporting/get-customer-profile-transaction-list.py b/TransactionReporting/get-customer-profile-transaction-list.py index fb780a7..45c2885 100644 --- a/TransactionReporting/get-customer-profile-transaction-list.py +++ b/TransactionReporting/get-customer-profile-transaction-list.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_customer_profile_transaction_list(customerProfileId): @@ -29,7 +29,7 @@ def get_customer_profile_transaction_list(customerProfileId): print('Transaction Id : %s' % transaction.transId) print('Transaction Status : %s' % transaction.transactionStatus) print('Amount Type : %s' % transaction.accountType) - print('Settle Amount : %s' % transaction.settleAmount) + print('Settle Amount : %.2f' % transaction.settleAmount) if transactionListForCustomerResponse.messages is not None: print('Message Code : %s' % transactionListForCustomerResponse.messages.message[0]['code'].text) diff --git a/TransactionReporting/get-merchant-details.py b/TransactionReporting/get-merchant-details.py index 98b3cb3..489188f 100644 --- a/TransactionReporting/get-merchant-details.py +++ b/TransactionReporting/get-merchant-details.py @@ -1,10 +1,10 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader import random from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_merchant_details(): diff --git a/TransactionReporting/get-settled-batch-list.py b/TransactionReporting/get-settled-batch-list.py index 3e9f92e..0d57f17 100644 --- a/TransactionReporting/get-settled-batch-list.py +++ b/TransactionReporting/get-settled-batch-list.py @@ -1,12 +1,12 @@ """http://developer.authorize.net/api/reference/index.html#transaction-reporting-get-settled-batch-list""" import os import sys -import imp +from importlib.machinery import SourceFileLoader from datetime import datetime, timedelta from authorizenet import apicontractsv1 from authorizenet.apicontrollers import getSettledBatchListController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_settled_batch_list(): """get settled batch list""" diff --git a/TransactionReporting/get-transaction-details.py b/TransactionReporting/get-transaction-details.py index b2ccd11..b52f5ad 100644 --- a/TransactionReporting/get-transaction-details.py +++ b/TransactionReporting/get-transaction-details.py @@ -1,9 +1,9 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * def get_transaction_details(transId): @@ -28,8 +28,8 @@ def get_transaction_details(transId): print('Transaction Id : %s' % transactionDetailsResponse.transaction.transId) print('Transaction Type : %s' % transactionDetailsResponse.transaction.transactionType) print('Transaction Status : %s' % transactionDetailsResponse.transaction.transactionStatus) - print('Auth Amount : %s' % transactionDetailsResponse.transaction.authAmount) - print('Settle Amount : %s' % transactionDetailsResponse.transaction.settleAmount) + print('Auth Amount : %.2f' % transactionDetailsResponse.transaction.authAmount) + print('Settle Amount : %.2f' % transactionDetailsResponse.transaction.settleAmount) if hasattr(transactionDetailsResponse.transaction, 'tax') == True: print('Tax : %s' % transactionDetailsResponse.transaction.tax.amount) if hasattr(transactionDetailsResponse.transaction, 'profile'): diff --git a/TransactionReporting/get-transaction-list.py b/TransactionReporting/get-transaction-list.py index 7f7ad01..aa2ee7b 100644 --- a/TransactionReporting/get-transaction-list.py +++ b/TransactionReporting/get-transaction-list.py @@ -1,11 +1,11 @@ """http://developer.authorize.net/api/reference/index.html#transaction-reporting-get-transaction-list""" import os import sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import getTransactionListController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_transaction_list(): """get transaction list for a specific batch""" diff --git a/TransactionReporting/get-unsettled-transaction-list.py b/TransactionReporting/get-unsettled-transaction-list.py index dbd706c..804387a 100644 --- a/TransactionReporting/get-unsettled-transaction-list.py +++ b/TransactionReporting/get-unsettled-transaction-list.py @@ -1,11 +1,11 @@ """http://developer.authorize.net/api/reference/index.html#transaction-reporting-get-unsettled-transaction-list""" import os import sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import getUnsettledTransactionListController -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() def get_unsettled_transaction_list(): """get unsettled transaction list""" diff --git a/VisaCheckout/create-visa-checkout-transaction.py b/VisaCheckout/create-visa-src-transaction.py similarity index 96% rename from VisaCheckout/create-visa-checkout-transaction.py rename to VisaCheckout/create-visa-src-transaction.py index cfccee0..8d8b08a 100644 --- a/VisaCheckout/create-visa-checkout-transaction.py +++ b/VisaCheckout/create-visa-src-transaction.py @@ -1,12 +1,12 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() from decimal import * -def create_visa_checkout_transaction(): +def create_visa_src_transaction(): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId @@ -60,4 +60,4 @@ def create_visa_checkout_transaction(): return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): - create_visa_checkout_transaction() + create_visa_src_transaction() diff --git a/VisaCheckout/decrypt-visa-checkout-data.py b/VisaCheckout/decrypt-visa-src-data.py similarity index 95% rename from VisaCheckout/decrypt-visa-checkout-data.py rename to VisaCheckout/decrypt-visa-src-data.py index fc6b213..65714f5 100644 --- a/VisaCheckout/decrypt-visa-checkout-data.py +++ b/VisaCheckout/decrypt-visa-src-data.py @@ -1,11 +1,11 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * -constants = imp.load_source('modulename', 'constants.py') +constants = SourceFileLoader('modulename', 'constants.py').load_module() -def decrypt_visa_checkout_data(): +def decrypt_visa_src_data(): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId merchantAuth.transactionKey = constants.transactionKey @@ -38,4 +38,4 @@ def decrypt_visa_checkout_data(): return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): - decrypt_visa_checkout_data() + decrypt_visa_src_data() diff --git a/constants.py b/constants.py index 04d5179..7d30f85 100644 --- a/constants.py +++ b/constants.py @@ -1,10 +1,10 @@ apiLoginId = "5KP3u95bQpv" transactionKey = "346HZ32z3fP4hTG2" -transactionId = "2245440957" +transactionId = "60163892435" payerId = "LM6NCLZ5RAKBY" -customerProfileId = "123212" -customerPaymentProfileId = "2132322" -customerProfileShippingId = "123132" +customerProfileId = "1929820324" +customerPaymentProfileId = "1841987457" +customerProfileShippingId = "901056173" amount = "12.23" -subscriptionId = "123234" +subscriptionId = "326280" days = 34 diff --git a/list_of_sample_codes.txt b/list_of_sample_codes.txt index 120e3cd..cc4d833 100644 --- a/list_of_sample_codes.txt +++ b/list_of_sample_codes.txt @@ -27,8 +27,8 @@ update_split_tender_group 1 0 void_transaction 1 0 authorization_and_capture_continued 1 1 authorization_and_capture 1 1 -authorization_only_continued 1 1 -authorization_only 1 0 +authorization_only_continued 1 0 +authorization_only 1 1 credit 1 0 get_details 1 0 prior_authorization_capture 1 0 @@ -47,11 +47,11 @@ get_batch_statistics 1 1 get_settled_batch_list 1 1 get_transaction_details 1 0 get_transaction_list 1 1 -get_transaction_list_for_customer 1 1 +get_transaction_list_for_customer 1 0 get_unsettled_transaction_list 1 0 -create_visa_checkout_transaction 1 0 -decrypt_visa_checkout_data 1 0 -get_customer_profile_ids 1 1 +create_visa_src_transaction 1 0 +decrypt_visa_src_data 1 0 +get_customer_profile_ids 1 0 get_customer_payment_profile_list 1 1 get_merchant_details 0 1 update_held_transaction 0 0 diff --git a/sha512/compute-transhash-sha512 b/sha512/compute-transhash-sha512 new file mode 100644 index 0000000..af2a95c --- /dev/null +++ b/sha512/compute-transhash-sha512 @@ -0,0 +1,29 @@ +# This is a program to compute TransHash for a given Transaction +# Neccessary paramters :- SignatureKey,ApiLoginId, TransId for the Transaction,Amount Transacted +# For more details regarding implementation please visit For more details please visit https://developer.authorize.net/support/hash_upgrade/?utm_campaign=19Q2%20MD5%20Hash%20EOL%20Partner&utm_medium=email&utm_source=Eloqua for implementation details. + + +import hashlib +import hmac + +#SignatureKey is obtained from MINT interface +signatureKey="14B9609FFE2378449B3C0886046DD3B0F20DF12DEB758E48B5FFE1B5875615F0D2A50F7DDB1EAC417EBF76A1FAC374079793650AA493CE127601CB0960938E82"; +transId="60115446835"; +apiLogin = "5T9cRn9FK"; +amount = "10.00"; +textToHash="^"+apiLogin+"^"+transId+"^"+amount+"^"; + + +def calculate_TransHashSha512(signatureKey,textToHash): + if(not signatureKey or signatureKey ==''): + raise Exception('Signature key cannot be null or empty') + if(not textToHash or textToHash ==''): + raise Exception('Signature key cannot be null or empty') + if(len(signatureKey)%2!=0 or len(signatureKey)<2): + raise Exception("Parameter cannot be odd or less than 2 characters"); + sign=hmac.new(signatureKey.decode("hex"), textToHash, hashlib.sha512).hexdigest().upper() + return sign + +transHashSha512=calculate_TransHashSha512(signatureKey,textToHash) +print(transHashSha512) + diff --git a/test-runner.py b/test-runner.py index 443d3a3..64279a0 100644 --- a/test-runner.py +++ b/test-runner.py @@ -1,6 +1,6 @@ import unittest import sys -import imp +from importlib.machinery import SourceFileLoader import random from authorizenet import apicontractsv1 import pyxb @@ -20,32 +20,32 @@ def getDay(self): def create_an_apple_pay_transaction(self): print("create_an_apple_pay_transaction") - modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-apple-pay-transaction.py') + modl = SourceFileLoader('modulename', 'MobileInappTransactions/create-an-apple-pay-transaction.py').load_module() return modl.create_an_apple_pay_transaction() def create_an_accept_transaction(self): print("create_an_accept_transaction") - modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-accept-transaction.py') + modl = SourceFileLoader('modulename', 'MobileInappTransactions/create-an-accept-transaction.py').load_module() return modl.create_an_accept_transaction() def create_an_android_pay_transaction(self): print("create_an_android_pay_transaction") - modl = imp.load_source('modulename', 'MobileInappTransactions/create-an-android-pay-transaction.py') + modl = SourceFileLoader('modulename', 'MobileInappTransactions/create-an-android-pay-transaction.py').load_module() return modl.create_an_android_pay_transaction() def create_customer_payment_profile(self): print("create_customer_payment_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(str(response.customerProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(str(response.customerProfileId)) return response @@ -54,26 +54,26 @@ def create_customer_profile_from_transaction(self): print("create_customer_profile_from_transaction") #Create transaction - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() response = modl.authorize_credit_card(self.getAmount()) #create customer payment profile for above transaction - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile-from-transaction.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile-from-transaction.py').load_module() response = modl.create_customer_profile_from_transaction(str(response.transactionResponse.transId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(str(response.customerProfileId)) return response def create_customer_profile(self): print("create_customer_profile") - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(str(response.customerProfileId)) return response @@ -82,14 +82,14 @@ def create_customer_shipping_address(self): print("create_customer_shipping_address") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-shipping-address.py').load_module() response = modl.create_customer_shipping_address(str(response.customerProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(str(response.customerProfileId)) return response @@ -98,19 +98,19 @@ def delete_customer_payment_profile(self): print("delete_customer_payment_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(str(response.customerProfileId)) - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-payment-profile.py').load_module() response = modl.delete_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -120,28 +120,28 @@ def delete_customer_profile(self): print("delete_customer_profile") #Create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() return modl.delete_customer_profile(str(response.customerProfileId)) def delete_customer_shipping_address(self): print("delete_customer_shipping_address") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-shipping-address.py').load_module() response = modl.create_customer_shipping_address(customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-shipping-address.py').load_module() response = modl.delete_customer_shipping_address(customerProfileId, str(response.customerAddressId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -150,46 +150,46 @@ def get_customer_payment_profile(self): print("get_customer_payment_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-customer-payment-profile.py').load_module() response = modl.get_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response def get_customer_payment_profile_list(self): print("get_customer_payment_profile_list") - modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-payment-profile-list.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-customer-payment-profile-list.py').load_module() return modl.get_customer_payment_profile_list() def get_customer_profile_ids(self): print("get_customer_profile_ids") - modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-profile-ids.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-customer-profile-ids.py').load_module() return modl.get_customer_profile_ids() def get_customer_profile(self): print("get_customer_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-customer-profile.py').load_module() response = modl.get_customer_profile(customerProfileId) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -198,18 +198,18 @@ def get_customer_shipping_address(self): print("get_customer_shipping_address") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-shipping-address.py').load_module() response = modl.create_customer_shipping_address(customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/get-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-customer-shipping-address.py').load_module() response = modl.get_customer_shipping_address(customerProfileId, str(response.customerAddressId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -218,15 +218,15 @@ def get_hosted_profile_page(self): print("get_hosted_profile_page") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/get-hosted-profile-page.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/get-hosted-profile-page.py').load_module() response = modl.get_hosted_profile_page(customerProfileId) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -235,20 +235,20 @@ def update_customer_payment_profile(self): print("update_customer_payment_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(customerProfileId) if hasattr(response, 'customerProfileId') == True: - modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/update-customer-payment-profile.py').load_module() response = modl.update_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -257,15 +257,15 @@ def update_customer_profile(self): print("update_customer_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/update-customer-profile.py').load_module() response = modl.update_customer_profile(customerProfileId) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -274,18 +274,18 @@ def update_customer_shipping_address(self): print("update_customer_shipping_address") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-shipping-address.py').load_module() response = modl.create_customer_shipping_address(customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/update-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/update-customer-shipping-address.py').load_module() response = modl.update_customer_shipping_address(customerProfileId, str(response.customerAddressId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response @@ -295,175 +295,175 @@ def validate_customer_payment_profile(self): print("validate_customer_payment_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(customerProfileId) - modl = imp.load_source('modulename', 'CustomerProfiles/validate-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/validate-customer-payment-profile.py').load_module() response = modl.validate_customer_payment_profile(customerProfileId, str(response.customerPaymentProfileId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response def authorize_credit_card(self): print("authorize_credit_card") - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() return modl.authorize_credit_card(self.getAmount()) def capture_funds_authorized_through_another_channel(self): print("capture_funds_authorized_through_another_channel") - modl = imp.load_source('modulename', 'PaymentTransactions/capture-funds-authorized-through-another-channel.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/capture-funds-authorized-through-another-channel.py').load_module() return modl.capture_funds_authorized_through_another_channel() def capture_previously_authorized_amount(self): print("capture_previously_authorized_amount") - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() response = modl.authorize_credit_card(self.getAmount()) - modl = imp.load_source('modulename', 'PaymentTransactions/capture-previously-authorized-amount.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/capture-previously-authorized-amount.py').load_module() return modl.capture_previously_authorized_amount(response.transactionResponse.transId) def charge_credit_card(self): print("charge_credit_card") - modl = imp.load_source('modulename', 'PaymentTransactions/charge-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/charge-credit-card.py').load_module() return modl.charge_credit_card(self.getAmount()) def charge_customer_profile(self): print("charge_customer_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() response = modl.create_customer_profile() customerProfileId = str(response.customerProfileId) #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() response = modl.create_customer_payment_profile(customerProfileId) - modl = imp.load_source('modulename', 'PaymentTransactions/charge-customer-profile.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/charge-customer-profile.py').load_module() response = modl.charge_customer_profile(customerProfileId, str(response.customerPaymentProfileId), self.getAmount()) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(customerProfileId) return response def charge_tokenized_credit_card(self): print("charge_tokenized_credit_card") - modl = imp.load_source('modulename', 'PaymentTransactions/charge-tokenized-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/charge-tokenized-credit-card.py').load_module() return modl.charge_tokenized_credit_card() def credit_bank_account(self): print("credit_bank_account") - modl = imp.load_source('modulename', 'PaymentTransactions/credit-bank-account.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/credit-bank-account.py').load_module() return modl.credit_bank_account() def debit_bank_account(self): print("debit_bank_account") - modl = imp.load_source('modulename', 'PaymentTransactions/debit-bank-account.py') - return modl.debit_bank_account() + modl = SourceFileLoader('modulename', 'PaymentTransactions/debit-bank-account.py').load_module() + return modl.debit_bank_account(str(round(random.random()*100, 2))) def refund_transaction(self): print("refund_transaction") - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() response = modl.authorize_credit_card(self.getAmount()) - modl = imp.load_source('modulename', 'PaymentTransactions/refund-transaction.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/refund-transaction.py').load_module() return modl.refund_transaction(response.transactionResponse.transId) def update_split_tender_group(self): print("update_split_tender_group") - modl = imp.load_source('modulename', 'PaymentTransactions/update-split-tender-group.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/update-split-tender-group.py').load_module() return modl.update_split_tender_group() def void_transaction(self): print("void_transaction") - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() response = modl.authorize_credit_card(self.getAmount()) - modl = imp.load_source('modulename', 'PaymentTransactions/void-transaction.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/void-transaction.py').load_module() return modl.void_transaction(response.transactionResponse.transId) def authorization_and_capture_continued(self): print("authorization_and_capture_continued") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture.py').load_module() response = modl.authorization_and_capture(self.getAmount()) - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture-continued.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture-continued.py').load_module() return modl.authorization_and_capture_continued(str(response.transactionResponse.transId), "6ZSCSYG33VP8Q") def authorization_and_capture(self): print("authorization_and_capture") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture.py').load_module() return modl.authorization_and_capture(self.getAmount()) def authorization_only_continued(self): print("authorization_only_continued") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-only-continued.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-only-continued.py').load_module() return modl.authorization_only_continued() def authorization_only(self): print("authorization_only") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-only.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-only.py').load_module() return modl.authorization_only() def credit(self): print("credit") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/credit.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/credit.py').load_module() return modl.credit() def get_details(self): print("get_details") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture.py').load_module() response = modl.authorization_and_capture(self.getAmount()) - modl = imp.load_source('modulename', 'PayPalExpressCheckout/get-details.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/get-details.py').load_module() return modl.get_details(str(response.transactionResponse.transId)) def prior_authorization_capture(self): print("prior_authorization_capture") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture.py').load_module() response = modl.authorization_and_capture(self.getAmount()) - modl = imp.load_source('modulename', 'PayPalExpressCheckout/prior-authorization-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/prior-authorization-capture.py').load_module() return modl.prior_authorization_capture(str(response.transactionResponse.transId)) def void(self): print("void") - modl = imp.load_source('modulename', 'PayPalExpressCheckout/authorization-and-capture.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/authorization-and-capture.py').load_module() response = modl.authorization_and_capture(self.getAmount()) - modl = imp.load_source('modulename', 'PayPalExpressCheckout/void.py') + modl = SourceFileLoader('modulename', 'PayPalExpressCheckout/void.py').load_module() return modl.void(str(response.transactionResponse.transId)) def cancel_subscription(self): print("cancel_subscription") - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription.py').load_module() response = modl.create_subscription(self.getAmount(), self.getDay()) - modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/cancel-subscription.py').load_module() return modl.cancel_subscription(response.subscriptionId) def create_subscription(self): print("create_subscription") - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription.py').load_module() return modl.create_subscription(self.getAmount(), self.getDay()) @@ -471,29 +471,29 @@ def create_subscription_from_customer_profile(self): print("create_subscription_from_customer_profile") #create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-profile.py').load_module() profileResponse = modl.create_customer_profile() #create customer payment profile for that above profile - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-payment-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-payment-profile.py').load_module() paymentProfileResponse = modl.create_customer_payment_profile(str(profileResponse.customerProfileId)) #Create customer shipping address - modl = imp.load_source('modulename', 'CustomerProfiles/create-customer-shipping-address.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/create-customer-shipping-address.py').load_module() shippingResponse = modl.create_customer_shipping_address(str(profileResponse.customerProfileId)) time.sleep(10) #Create subscripiton from customer profile - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription-from-customer-profile.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription-from-customer-profile.py').load_module() response = modl.create_subscription_from_customer_profile(self.getAmount(), self.getDay(), str(profileResponse.customerProfileId), str(paymentProfileResponse.customerPaymentProfileId), str(shippingResponse.customerAddressId)) #Cancel subscription - modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/cancel-subscription.py').load_module() modl.cancel_subscription(str(response.subscriptionId)) #delete newly create customer profile - modl = imp.load_source('modulename', 'CustomerProfiles/delete-customer-profile.py') + modl = SourceFileLoader('modulename', 'CustomerProfiles/delete-customer-profile.py').load_module() modl.delete_customer_profile(str(profileResponse.customerProfileId)) return response @@ -501,20 +501,20 @@ def create_subscription_from_customer_profile(self): def get_list_of_subscriptions(self): print("get_list_of_subscriptions") - modl = imp.load_source('modulename', 'RecurringBilling/get-list-of-subscriptions.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/get-list-of-subscriptions.py').load_module() return modl.get_list_of_subscriptions() def get_subscription_status(self): print("get_subscription_status") - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription.py').load_module() response = modl.create_subscription(self.getAmount(), self.getDay()) subscriptionId = response.subscriptionId - modl = imp.load_source('modulename', 'RecurringBilling/get-subscription-status.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/get-subscription-status.py').load_module() response = modl.get_subscription_status(subscriptionId) - modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/cancel-subscription.py').load_module() modl.cancel_subscription(subscriptionId) return response @@ -522,14 +522,14 @@ def get_subscription_status(self): def get_subscription(self): print("get_subscription") - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription.py').load_module() response = modl.create_subscription(self.getAmount(), self.getDay()) subscriptionId = str(response.subscriptionId) - modl = imp.load_source('modulename', 'RecurringBilling/get-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/get-subscription.py').load_module() response = modl.get_subscription(subscriptionId) - modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/cancel-subscription.py').load_module() modl.cancel_subscription(subscriptionId) return response @@ -537,71 +537,77 @@ def get_subscription(self): def update_subscription(self): print("update_subscription") - modl = imp.load_source('modulename', 'RecurringBilling/create-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/create-subscription.py').load_module() response = modl.create_subscription(self.getAmount(), self.getDay()) subscriptionId = str(response.subscriptionId) - modl = imp.load_source('modulename', 'RecurringBilling/update-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/update-subscription.py').load_module() response = modl.update_subscription(subscriptionId) - modl = imp.load_source('modulename', 'RecurringBilling/cancel-subscription.py') + modl = SourceFileLoader('modulename', 'RecurringBilling/cancel-subscription.py').load_module() modl.cancel_subscription(subscriptionId) return response def get_batch_statistics(self): print("get_batch_statistics") - modl = imp.load_source('modulename', 'TransactionReporting/get-batch-statistics.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-batch-statistics.py').load_module() return modl.get_batch_statistics() def get_settled_batch_list(self): print("get_settled_batch_list") - modl = imp.load_source('modulename', 'TransactionReporting/get-settled-batch-list.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-settled-batch-list.py').load_module() return modl.get_settled_batch_list() def get_transaction_details(self): print("get_transaction_details") - modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/authorize-credit-card.py').load_module() response = modl.authorize_credit_card(self.getAmount()) - modl = imp.load_source('modulename', 'TransactionReporting/get-transaction-details.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-transaction-details.py').load_module() return modl.get_transaction_details(response.transactionResponse.transId) def get_transaction_list(self): print("get_transaction_list") - modl = imp.load_source('modulename', 'TransactionReporting/get-transaction-list.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-transaction-list.py').load_module() return modl.get_transaction_list() def get_unsettled_transaction_list(self): print("get_unsettled_transaction_list") - modl = imp.load_source('modulename', 'TransactionReporting/get-unsettled-transaction-list.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-unsettled-transaction-list.py').load_module() return modl.get_unsettled_transaction_list() - def create_visa_checkout_transaction(self): - print("create_visa_checkout_transaction") - modl = imp.load_source('modulename', 'VisaCheckout/create-visa-checkout-transaction.py') - return modl.create_visa_checkout_transaction() + def create_visa_src_transaction(self): + print("create_visa_src_transaction") + modl = SourceFileLoader('modulename', 'VisaCheckout/create-visa-checkout-transaction.py').load_module() + return modl.create_visa_src_transaction() - def decrypt_visa_checkout_data(self): - print("decrypt_visa_checkout_data") - modl = imp.load_source('modulename', 'VisaCheckout/decrypt-visa-checkout-data.py') - return modl.decrypt_visa_checkout_data() + def decrypt_visa_src_data(self): + print("decrypt_visa_src_data") + modl = SourceFileLoader('modulename', 'VisaCheckout/decrypt-visa-checkout-data.py').load_module() + return modl.decrypt_visa_src_data() def get_merchant_details(self): print("get_merchant_details") - modl = imp.load_source('modulename', 'TransactionReporting/get-merchant-details.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-merchant-details.py').load_module() return modl.get_merchant_details() def get_an_accept_payment_page(self): print("get_an_accept_payment_page") - modl = imp.load_source('modulename', 'PaymentTransactions/get-an-accept-payment-page.py') + modl = SourceFileLoader('modulename', 'AcceptSuite/get-an-accept-payment-page.py').load_module() return modl.get_an_accept_payment_page(self.getAmount()) def update_held_transaction(self): print("update_held_transaction") - modl = imp.load_source('modulename', 'PaymentTransactions/update-held-transaction.py') + modl = SourceFileLoader('modulename', 'PaymentTransactions/update-held-transaction.py').load_module() return modl.update_held_transaction("12345") + # added new method + def get_account_updater_job_details(self): + print("get_account_updater_job_details") + + modl = SourceFileLoader('modulename', 'TransactionReporting/get-account-updater-job-details.py').load_module() + return modl.get_account_updater_job_details() def validate_response(self, response): if(response is None): 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