From 5ff0a6ee984f8ce67f3edf6091f0f632c306524d Mon Sep 17 00:00:00 2001 From: saikatbasu01 Date: Mon, 13 Aug 2018 17:48:49 +0530 Subject: [PATCH 01/28] Added randomization for account number in debit-bank-account sample code --- PaymentTransactions/debit-bank-account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PaymentTransactions/debit-bank-account.py b/PaymentTransactions/debit-bank-account.py index c246344..1bd5f64 100644 --- a/PaymentTransactions/debit-bank-account.py +++ b/PaymentTransactions/debit-bank-account.py @@ -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 From 749013c47c57112dbb9b464ec623c58bdd56e56f Mon Sep 17 00:00:00 2001 From: khaaldrogo <35258595+khaaldrogo@users.noreply.github.com> Date: Thu, 27 Sep 2018 22:03:11 +0000 Subject: [PATCH 02/28] Added transactions in request/response --- RecurringBilling/get-subscription.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RecurringBilling/get-subscription.py b/RecurringBilling/get-subscription.py index f6ef8e2..2b98151 100644 --- a/RecurringBilling/get-subscription.py +++ b/RecurringBilling/get-subscription.py @@ -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: %s" % 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) From 613fb276cd95d13a20c05fb920eaf5ae70345cee Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Tue, 16 Oct 2018 10:35:54 +0530 Subject: [PATCH 03/28] October 18 Release of API Reference --- .../create-an-accept-payment-transaction.py | 0 .../get-accept-customer-profile-page.py | 0 .../get-an-accept-payment-page.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {PaymentTransactions => AcceptSuite}/create-an-accept-payment-transaction.py (100%) rename {CustomerProfiles => AcceptSuite}/get-accept-customer-profile-page.py (100%) rename {PaymentTransactions => AcceptSuite}/get-an-accept-payment-page.py (100%) diff --git a/PaymentTransactions/create-an-accept-payment-transaction.py b/AcceptSuite/create-an-accept-payment-transaction.py similarity index 100% rename from PaymentTransactions/create-an-accept-payment-transaction.py rename to AcceptSuite/create-an-accept-payment-transaction.py diff --git a/CustomerProfiles/get-accept-customer-profile-page.py b/AcceptSuite/get-accept-customer-profile-page.py similarity index 100% rename from CustomerProfiles/get-accept-customer-profile-page.py rename to AcceptSuite/get-accept-customer-profile-page.py diff --git a/PaymentTransactions/get-an-accept-payment-page.py b/AcceptSuite/get-an-accept-payment-page.py similarity index 100% rename from PaymentTransactions/get-an-accept-payment-page.py rename to AcceptSuite/get-an-accept-payment-page.py From c3f4ee967ef76bddbb7bd2e9d7c654785f6e429a Mon Sep 17 00:00:00 2001 From: dinsahu <41061575+dinsahu@users.noreply.github.com> Date: Tue, 20 Nov 2018 17:45:15 +0530 Subject: [PATCH 04/28] PR1992_getaujobdetails_sample code_python Added new class GetAccountUpdaterJobDetails. --- .../get-account-updater-job-details.py | 93 +++++++++++++++++++ test-runner.py | 6 ++ 2 files changed, 99 insertions(+) create mode 100644 TransactionReporting/get-account-updater-job-details.py 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/test-runner.py b/test-runner.py index 443d3a3..7ac7e2f 100644 --- a/test-runner.py +++ b/test-runner.py @@ -602,6 +602,12 @@ def update_held_transaction(self): print("update_held_transaction") modl = imp.load_source('modulename', 'PaymentTransactions/update-held-transaction.py') return modl.update_held_transaction("12345") + # added new method + def get_account_updater_job_details(self): + print("get_account_updater_job_details") + + modl = imp.load_source('modulename', 'TransactionReporting/get-account-updater-job-details.py') + return modl.get_account_updater_job_details() def validate_response(self, response): if(response is None): From 535be0d4030b3651b6ce0b0c31eae2ea224d6f9e Mon Sep 17 00:00:00 2001 From: sudhirkumar2018 <36911383+sudhirkumar2018@users.noreply.github.com> Date: Tue, 11 Dec 2018 13:15:20 +0530 Subject: [PATCH 05/28] Create create-a-chase-pay-transaction.py added saple code for chase pay transaction --- .../create-a-chase-pay-transaction.py | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 PaymentTransactions/create-a-chase-pay-transaction.py diff --git a/PaymentTransactions/create-a-chase-pay-transaction.py b/PaymentTransactions/create-a-chase-pay-transaction.py new file mode 100644 index 0000000..7640555 --- /dev/null +++ b/PaymentTransactions/create-a-chase-pay-transaction.py @@ -0,0 +1,71 @@ +import os, sys +import imp + +from authorizenet import apicontractsv1 +from authorizenet.apicontrollers import * +from authorizenet.constants import constants +from decimal import * + +def create_a_chase_pay_transaction(): + merchantAuth = apicontractsv1.merchantAuthenticationType() + merchantAuth.name = constants.apiLoginId + merchantAuth.transactionKey = constants.transactionKey + + creditCard = apicontractsv1.creditCardType() + creditCard.cardNumber = "4111111111111111" + creditCard.expirationDate = "2020-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.5') + 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_a_chase_pay_transaction() From d45f9d8aa6a2b24049ca672e680151a6f9b970ec Mon Sep 17 00:00:00 2001 From: sudhirkumar2018 <36911383+sudhirkumar2018@users.noreply.github.com> Date: Tue, 11 Dec 2018 17:14:20 +0530 Subject: [PATCH 06/28] Update create-a-chase-pay-transaction.py added two digits after decimal --- PaymentTransactions/create-a-chase-pay-transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PaymentTransactions/create-a-chase-pay-transaction.py b/PaymentTransactions/create-a-chase-pay-transaction.py index 7640555..c35688c 100644 --- a/PaymentTransactions/create-a-chase-pay-transaction.py +++ b/PaymentTransactions/create-a-chase-pay-transaction.py @@ -27,7 +27,7 @@ def create_a_chase_pay_transaction(): transactionrequest = apicontractsv1.transactionRequestType() transactionrequest.transactionType = "authCaptureTransaction" - transactionrequest.amount = Decimal ('1.5') + transactionrequest.amount = Decimal ('1.50') transactionrequest.payment = payment createtransactionrequest = apicontractsv1.createTransactionRequest() From e6e33ba21409f9b9e15179c9a8c93f958bc124fc Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Thu, 13 Dec 2018 13:47:48 +0530 Subject: [PATCH 07/28] + Fixing the name of the file --- ...ase-pay-transaction.py => create-chase-pay-transaction.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename PaymentTransactions/{create-a-chase-pay-transaction.py => create-chase-pay-transaction.py} (97%) diff --git a/PaymentTransactions/create-a-chase-pay-transaction.py b/PaymentTransactions/create-chase-pay-transaction.py similarity index 97% rename from PaymentTransactions/create-a-chase-pay-transaction.py rename to PaymentTransactions/create-chase-pay-transaction.py index c35688c..48f44c8 100644 --- a/PaymentTransactions/create-a-chase-pay-transaction.py +++ b/PaymentTransactions/create-chase-pay-transaction.py @@ -6,7 +6,7 @@ from authorizenet.constants import constants from decimal import * -def create_a_chase_pay_transaction(): +def create_chase_pay_transaction(): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId merchantAuth.transactionKey = constants.transactionKey @@ -68,4 +68,4 @@ def create_a_chase_pay_transaction(): return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): - create_a_chase_pay_transaction() + create_chase_pay_transaction() From f55e4624cc34221340f5f57f9e35079cfaa9d408 Mon Sep 17 00:00:00 2001 From: KarthikeyanKumar Date: Thu, 7 Feb 2019 17:30:18 +0530 Subject: [PATCH 08/28] Create compute-transhash-sha512 --- sha512/compute-transhash-sha512 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sha512/compute-transhash-sha512 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) + From e7a2f0db47c8540750ad477b287bd340f345c4fb Mon Sep 17 00:00:00 2001 From: Anjali Nauhwar Date: Tue, 26 Mar 2019 20:36:47 +0530 Subject: [PATCH 09/28] added %.2f where amount is printed --- FraudManagement/get-held-transaction-list.py | 4 ++-- RecurringBilling/get-subscription.py | 2 +- TransactionReporting/get-batch-statistics.py | 4 ++-- TransactionReporting/get-customer-profile-transaction-list.py | 2 +- TransactionReporting/get-transaction-details.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/FraudManagement/get-held-transaction-list.py b/FraudManagement/get-held-transaction-list.py index 8f6e116..99a1876 100644 --- a/FraudManagement/get-held-transaction-list.py +++ b/FraudManagement/get-held-transaction-list.py @@ -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/RecurringBilling/get-subscription.py b/RecurringBilling/get-subscription.py index 2b98151..90682e7 100644 --- a/RecurringBilling/get-subscription.py +++ b/RecurringBilling/get-subscription.py @@ -24,7 +24,7 @@ def get_subscription(subscriptionId): if (response.messages.resultCode=="Ok"): print ("Subscription Name : %s" % response.subscription.name) - print ("Subscription Amount: %s" % response.subscription.amount) + print ("Subscription Amount: %.2f" % response.subscription.amount) for transaction in response.subscription.arbTransactions.arbTransaction: print "Transaction id: %d" % transaction.transId else: diff --git a/TransactionReporting/get-batch-statistics.py b/TransactionReporting/get-batch-statistics.py index 99ae6f6..0227195 100644 --- a/TransactionReporting/get-batch-statistics.py +++ b/TransactionReporting/get-batch-statistics.py @@ -32,8 +32,8 @@ def get_batch_statistics(): 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..415f74a 100644 --- a/TransactionReporting/get-customer-profile-transaction-list.py +++ b/TransactionReporting/get-customer-profile-transaction-list.py @@ -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-transaction-details.py b/TransactionReporting/get-transaction-details.py index b2ccd11..073c264 100644 --- a/TransactionReporting/get-transaction-details.py +++ b/TransactionReporting/get-transaction-details.py @@ -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'): From 6bcafddb5c1d9ce3823d0c9f174273a27fda1018 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Tue, 16 Apr 2019 10:45:11 +0530 Subject: [PATCH 10/28] Updating folder location of file --- test-runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-runner.py b/test-runner.py index 7ac7e2f..da36558 100644 --- a/test-runner.py +++ b/test-runner.py @@ -595,7 +595,7 @@ def get_merchant_details(self): 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 = imp.load_source('modulename', 'AcceptSuite/get-an-accept-payment-page.py') return modl.get_an_accept_payment_page(self.getAmount()) def update_held_transaction(self): From 421641fc17f3d56a3d972646a1be380e09d7c441 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Thu, 1 Aug 2019 15:13:11 +0530 Subject: [PATCH 11/28] Update .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c866897..9b19bda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: python sudo: false +dist: trusty + python: - "2.7" - "3.4" From 9b3eefd60017732dc21019067c3e5bb1425c0d70 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Thu, 1 Aug 2019 15:21:15 +0530 Subject: [PATCH 12/28] Update .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b19bda..f5a749f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,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: From 8562a840b9e9822960821ddbb3da94e176f1b073 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 4 Mar 2020 14:53:44 +0530 Subject: [PATCH 13/28] + Renamed Visa Checkout to Visa SRC + Blocking GetCustomerProfileIds call as response exceeds log limit --- ...transaction.py => create-visa-src-transaction.py} | 4 ++-- ...isa-checkout-data.py => decrypt-visa-src-data.py} | 4 ++-- list_of_sample_codes.txt | 6 +++--- test-runner.py | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) rename VisaCheckout/{create-visa-checkout-transaction.py => create-visa-src-transaction.py} (98%) rename VisaCheckout/{decrypt-visa-checkout-data.py => decrypt-visa-src-data.py} (98%) diff --git a/VisaCheckout/create-visa-checkout-transaction.py b/VisaCheckout/create-visa-src-transaction.py similarity index 98% rename from VisaCheckout/create-visa-checkout-transaction.py rename to VisaCheckout/create-visa-src-transaction.py index cfccee0..0ef447b 100644 --- a/VisaCheckout/create-visa-checkout-transaction.py +++ b/VisaCheckout/create-visa-src-transaction.py @@ -6,7 +6,7 @@ constants = imp.load_source('modulename', 'constants.py') 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 98% rename from VisaCheckout/decrypt-visa-checkout-data.py rename to VisaCheckout/decrypt-visa-src-data.py index fc6b213..da86341 100644 --- a/VisaCheckout/decrypt-visa-checkout-data.py +++ b/VisaCheckout/decrypt-visa-src-data.py @@ -5,7 +5,7 @@ from authorizenet.apicontrollers import * constants = imp.load_source('modulename', 'constants.py') -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/list_of_sample_codes.txt b/list_of_sample_codes.txt index 120e3cd..7c6de8d 100644 --- a/list_of_sample_codes.txt +++ b/list_of_sample_codes.txt @@ -49,9 +49,9 @@ get_transaction_details 1 0 get_transaction_list 1 1 get_transaction_list_for_customer 1 1 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/test-runner.py b/test-runner.py index 443d3a3..5f2a5b3 100644 --- a/test-runner.py +++ b/test-runner.py @@ -578,15 +578,15 @@ def get_unsettled_transaction_list(self): modl = imp.load_source('modulename', 'TransactionReporting/get-unsettled-transaction-list.py') return modl.get_unsettled_transaction_list() - def create_visa_checkout_transaction(self): - print("create_visa_checkout_transaction") + def create_visa_src_transaction(self): + print("create_visa_src_transaction") modl = imp.load_source('modulename', 'VisaCheckout/create-visa-checkout-transaction.py') - return modl.create_visa_checkout_transaction() + return modl.create_visa_src_transaction() - def decrypt_visa_checkout_data(self): - print("decrypt_visa_checkout_data") + def decrypt_visa_src_data(self): + print("decrypt_visa_src_data") modl = imp.load_source('modulename', 'VisaCheckout/decrypt-visa-checkout-data.py') - return modl.decrypt_visa_checkout_data() + return modl.decrypt_visa_src_data() def get_merchant_details(self): print("get_merchant_details") From a37b2d69e46cbb5509a17bcea7ab04b5d414d253 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 16:43:28 +0530 Subject: [PATCH 14/28] Updated data --- PayPalExpressCheckout/authorization-only-continued.py | 4 ++-- .../create-subscription-from-customer-profile.py | 2 +- RecurringBilling/create-subscription.py | 2 +- RecurringBilling/get-subscription.py | 2 +- TransactionReporting/get-batch-statistics.py | 4 +++- constants.py | 8 ++++---- list_of_sample_codes.txt | 6 +++--- test-runner.py | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/PayPalExpressCheckout/authorization-only-continued.py b/PayPalExpressCheckout/authorization-only-continued.py index 7a2f313..c584080 100644 --- a/PayPalExpressCheckout/authorization-only-continued.py +++ b/PayPalExpressCheckout/authorization-only-continued.py @@ -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/RecurringBilling/create-subscription-from-customer-profile.py b/RecurringBilling/create-subscription-from-customer-profile.py index d959284..77b4802 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.py +++ b/RecurringBilling/create-subscription-from-customer-profile.py @@ -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(2020, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 diff --git a/RecurringBilling/create-subscription.py b/RecurringBilling/create-subscription.py index bd8ae5d..73f82d1 100644 --- a/RecurringBilling/create-subscription.py +++ b/RecurringBilling/create-subscription.py @@ -18,7 +18,7 @@ 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(2020, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 # Giving the credit card info diff --git a/RecurringBilling/get-subscription.py b/RecurringBilling/get-subscription.py index 90682e7..ceb0ca5 100644 --- a/RecurringBilling/get-subscription.py +++ b/RecurringBilling/get-subscription.py @@ -26,7 +26,7 @@ def get_subscription(subscriptionId): 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 + print ("Transaction id: %d" % transaction.transId) else: print ("response code: %s" % response.messages.resultCode) diff --git a/TransactionReporting/get-batch-statistics.py b/TransactionReporting/get-batch-statistics.py index 0227195..d0a9060 100644 --- a/TransactionReporting/get-batch-statistics.py +++ b/TransactionReporting/get-batch-statistics.py @@ -14,7 +14,7 @@ def get_batch_statistics(): batchStatisticsRequest = apicontractsv1.getBatchStatisticsRequest() batchStatisticsRequest.merchantAuthentication = merchantAuth - batchStatisticsRequest.batchId = "4532808" + batchStatisticsRequest.batchId = "11224814" batchStatisticsController = getBatchStatisticsController(batchStatisticsRequest) @@ -26,6 +26,8 @@ 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) diff --git a/constants.py b/constants.py index 04d5179..6b8ccd3 100644 --- a/constants.py +++ b/constants.py @@ -1,10 +1,10 @@ apiLoginId = "5KP3u95bQpv" transactionKey = "346HZ32z3fP4hTG2" -transactionId = "2245440957" +transactionId = "60158278077" payerId = "LM6NCLZ5RAKBY" -customerProfileId = "123212" -customerPaymentProfileId = "2132322" -customerProfileShippingId = "123132" +customerProfileId = "1929165137" +customerPaymentProfileId = "1841396700" +customerProfileShippingId = "900509021" amount = "12.23" subscriptionId = "123234" days = 34 diff --git a/list_of_sample_codes.txt b/list_of_sample_codes.txt index 7c6de8d..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,7 +47,7 @@ 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_src_transaction 1 0 decrypt_visa_src_data 1 0 diff --git a/test-runner.py b/test-runner.py index 4eaaa58..b72b892 100644 --- a/test-runner.py +++ b/test-runner.py @@ -370,7 +370,7 @@ def credit_bank_account(self): def debit_bank_account(self): print("debit_bank_account") modl = imp.load_source('modulename', 'PaymentTransactions/debit-bank-account.py') - return modl.debit_bank_account() + return modl.debit_bank_account(str(round(random.random()*100, 2))) def refund_transaction(self): print("refund_transaction") From 6c54873163353d65aec38b6fd857c7297c6975f6 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 17:39:49 +0530 Subject: [PATCH 15/28] Updated data --- constants.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/constants.py b/constants.py index 6b8ccd3..7d30f85 100644 --- a/constants.py +++ b/constants.py @@ -1,10 +1,10 @@ apiLoginId = "5KP3u95bQpv" transactionKey = "346HZ32z3fP4hTG2" -transactionId = "60158278077" +transactionId = "60163892435" payerId = "LM6NCLZ5RAKBY" -customerProfileId = "1929165137" -customerPaymentProfileId = "1841396700" -customerProfileShippingId = "900509021" +customerProfileId = "1929820324" +customerPaymentProfileId = "1841987457" +customerProfileShippingId = "901056173" amount = "12.23" -subscriptionId = "123234" +subscriptionId = "326280" days = 34 From 1a4ea81d43a7c2a715c35f935b01661ac21bc8d1 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 17:44:41 +0530 Subject: [PATCH 16/28] Updated dates --- CustomerProfiles/create-customer-payment-profile.py | 2 +- CustomerProfiles/update-customer-payment-profile.py | 2 +- PaymentTransactions/authorize-credit-card.py | 2 +- .../capture-funds-authorized-through-another-channel.py | 2 +- PaymentTransactions/charge-credit-card.py | 2 +- PaymentTransactions/charge-tokenized-credit-card.py | 2 +- PaymentTransactions/create-chase-pay-transaction.py | 2 +- RecurringBilling/create-subscription.py | 2 +- RecurringBilling/update-subscription.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CustomerProfiles/create-customer-payment-profile.py b/CustomerProfiles/create-customer-payment-profile.py index 5400e5e..bcbe6af 100644 --- a/CustomerProfiles/create-customer-payment-profile.py +++ b/CustomerProfiles/create-customer-payment-profile.py @@ -12,7 +12,7 @@ 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 diff --git a/CustomerProfiles/update-customer-payment-profile.py b/CustomerProfiles/update-customer-payment-profile.py index 50356a3..6ffdbd7 100644 --- a/CustomerProfiles/update-customer-payment-profile.py +++ b/CustomerProfiles/update-customer-payment-profile.py @@ -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/PaymentTransactions/authorize-credit-card.py b/PaymentTransactions/authorize-credit-card.py index 96f0f70..4a88e6a 100644 --- a/PaymentTransactions/authorize-credit-card.py +++ b/PaymentTransactions/authorize-credit-card.py @@ -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 diff --git a/PaymentTransactions/capture-funds-authorized-through-another-channel.py b/PaymentTransactions/capture-funds-authorized-through-another-channel.py index e2d6b9b..bef1584 100644 --- a/PaymentTransactions/capture-funds-authorized-through-another-channel.py +++ b/PaymentTransactions/capture-funds-authorized-through-another-channel.py @@ -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/charge-credit-card.py b/PaymentTransactions/charge-credit-card.py index 4d57ced..4569e8c 100644 --- a/PaymentTransactions/charge-credit-card.py +++ b/PaymentTransactions/charge-credit-card.py @@ -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-tokenized-credit-card.py b/PaymentTransactions/charge-tokenized-credit-card.py index d931e69..70b7513 100644 --- a/PaymentTransactions/charge-tokenized-credit-card.py +++ b/PaymentTransactions/charge-tokenized-credit-card.py @@ -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 index 48f44c8..4e06e87 100644 --- a/PaymentTransactions/create-chase-pay-transaction.py +++ b/PaymentTransactions/create-chase-pay-transaction.py @@ -13,7 +13,7 @@ def create_chase_pay_transaction(): creditCard = apicontractsv1.creditCardType() creditCard.cardNumber = "4111111111111111" - creditCard.expirationDate = "2020-12" + creditCard.expirationDate = "2035-12" creditCard.cardCode="999" # Set the token specific info creditCard.isPaymentToken = True diff --git a/RecurringBilling/create-subscription.py b/RecurringBilling/create-subscription.py index 73f82d1..a030fb1 100644 --- a/RecurringBilling/create-subscription.py +++ b/RecurringBilling/create-subscription.py @@ -24,7 +24,7 @@ def create_subscription(amount, days): # 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/update-subscription.py b/RecurringBilling/update-subscription.py index 3f7ba3a..c7af26c 100644 --- a/RecurringBilling/update-subscription.py +++ b/RecurringBilling/update-subscription.py @@ -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 From 4b4f601f9c81c7a9f1ab625056b71b3130373899 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 17:46:20 +0530 Subject: [PATCH 17/28] Updated dates --- RecurringBilling/create-subscription-from-customer-profile.py | 2 +- RecurringBilling/create-subscription.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RecurringBilling/create-subscription-from-customer-profile.py b/RecurringBilling/create-subscription-from-customer-profile.py index 77b4802..1a02922 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.py +++ b/RecurringBilling/create-subscription-from-customer-profile.py @@ -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, 12, 30) + paymentschedule.startDate = datetime(2021, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 diff --git a/RecurringBilling/create-subscription.py b/RecurringBilling/create-subscription.py index a030fb1..6a66189 100644 --- a/RecurringBilling/create-subscription.py +++ b/RecurringBilling/create-subscription.py @@ -18,7 +18,7 @@ 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, 12, 30) + paymentschedule.startDate = datetime(2021, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 # Giving the credit card info From 812d011e85432d724fcc2c8e94a2e9ebea475b95 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 17:50:26 +0530 Subject: [PATCH 18/28] Modified amount --- PaymentTransactions/authorize-credit-card.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PaymentTransactions/authorize-credit-card.py b/PaymentTransactions/authorize-credit-card.py index 4a88e6a..49ef0e6 100644 --- a/PaymentTransactions/authorize-credit-card.py +++ b/PaymentTransactions/authorize-credit-card.py @@ -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 + 100) From f85ceb673fd441f51275028f83633d3ba4cfe979 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 17:56:43 +0530 Subject: [PATCH 19/28] Modified amount --- PayPalExpressCheckout/authorization-only.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PayPalExpressCheckout/authorization-only.py b/PayPalExpressCheckout/authorization-only.py index 192835d..33320d4 100644 --- a/PayPalExpressCheckout/authorization-only.py +++ b/PayPalExpressCheckout/authorization-only.py @@ -19,7 +19,7 @@ def authorization_only(): payment.payPal = paypal transactionrequest = apicontractsv1.transactionRequestType() - transactionrequest.amount = Decimal('55.00') + transactionrequest.amount = Decimal('53.00') transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyTransaction transactionrequest.payment = payment From ab8d9c19d08febcf31630479937b61adaf9c0295 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 18:04:03 +0530 Subject: [PATCH 20/28] Randomizing amount --- PayPalExpressCheckout/authorization-only.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PayPalExpressCheckout/authorization-only.py b/PayPalExpressCheckout/authorization-only.py index 33320d4..448b7e1 100644 --- a/PayPalExpressCheckout/authorization-only.py +++ b/PayPalExpressCheckout/authorization-only.py @@ -1,5 +1,6 @@ import os, sys import imp +import random from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * @@ -19,7 +20,7 @@ def authorization_only(): payment.payPal = paypal transactionrequest = apicontractsv1.transactionRequestType() - transactionrequest.amount = Decimal('53.00') + transactionrequest.amount = Decimal(round(random.uniform(0, 100), 2)) transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyTransaction transactionrequest.payment = payment From 2273f3da748e053fa358ef48b03cc752b516a482 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Wed, 10 Mar 2021 18:30:01 +0530 Subject: [PATCH 21/28] Corrected random amount --- PayPalExpressCheckout/authorization-only.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PayPalExpressCheckout/authorization-only.py b/PayPalExpressCheckout/authorization-only.py index 448b7e1..4e3bcb7 100644 --- a/PayPalExpressCheckout/authorization-only.py +++ b/PayPalExpressCheckout/authorization-only.py @@ -20,7 +20,7 @@ def authorization_only(): payment.payPal = paypal transactionrequest = apicontractsv1.transactionRequestType() - transactionrequest.amount = Decimal(round(random.uniform(0, 100), 2)) + transactionrequest.amount = Decimal(random.uniform(1, 100)).quantize(Decimal('0.01')) transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authOnlyTransaction transactionrequest.payment = payment From 0d0d1767de36b58a077c385e90283ec137508b08 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Date: Wed, 19 Jul 2023 22:22:14 +0530 Subject: [PATCH 22/28] Added CreateGooglePayTransaction --- .../create-google-pay-transaction.py | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 MobileInAppTransactions/create-google-pay-transaction.py diff --git a/MobileInAppTransactions/create-google-pay-transaction.py b/MobileInAppTransactions/create-google-pay-transaction.py new file mode 100644 index 0000000..b20486f --- /dev/null +++ b/MobileInAppTransactions/create-google-pay-transaction.py @@ -0,0 +1,75 @@ +import os, sys +import imp + +from authorizenet import apicontractsv1 +from authorizenet.apicontrollers import * +constants = imp.load_source('modulename', 'constants.py') +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 + + lineItem = apicontractsv1.lineItemType() + lineItem.itemId = "1" + lineItem.name = "vase" + lineItem.description = "Cannes logo" + lineItem.quantity = 18 + lineItem.unitPrice = 45.00 + + lineItemsArray = apicontractsv1.ArrayOfLineItem() + print(lineItemsArray) + # lineItemArray.lineItem + + # transactionrequest = apicontractsv1.transactionRequestType() + # transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction + # transactionrequest.amount = Decimal('151') + # transactionrequest.payment = paymentType + + # 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() From 1b7eeb30bea72d210ec910991f0af61bef308739 Mon Sep 17 00:00:00 2001 From: Gaidin Daishan Date: Wed, 19 Jul 2023 23:33:52 +0530 Subject: [PATCH 23/28] Added CreateGooglePayTransaction --- .../create-google-pay-transaction.py | 85 +++++++++---------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/MobileInAppTransactions/create-google-pay-transaction.py b/MobileInAppTransactions/create-google-pay-transaction.py index b20486f..19d5284 100644 --- a/MobileInAppTransactions/create-google-pay-transaction.py +++ b/MobileInAppTransactions/create-google-pay-transaction.py @@ -19,57 +19,52 @@ def create_google_pay_transaction(): paymentType = apicontractsv1.paymentType() paymentType.opaqueData = opaqueData - lineItem = apicontractsv1.lineItemType() - lineItem.itemId = "1" - lineItem.name = "vase" - lineItem.description = "Cannes logo" - lineItem.quantity = 18 - lineItem.unitPrice = 45.00 + tax = apicontractsv1.extendedAmountType() + tax.amount = Decimal('15.00') + tax.name = "level2 tax name" + tax.description = "level2 tax" - lineItemsArray = apicontractsv1.ArrayOfLineItem() - print(lineItemsArray) - # lineItemArray.lineItem + transactionrequest = apicontractsv1.transactionRequestType() + transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction + transactionrequest.amount = Decimal('151') + transactionrequest.payment = paymentType + transactionrequest.tax = tax - # transactionrequest = apicontractsv1.transactionRequestType() - # transactionrequest.transactionType = apicontractsv1.transactionTypeEnum.authCaptureTransaction - # transactionrequest.amount = Decimal('151') - # transactionrequest.payment = paymentType + request = apicontractsv1.createTransactionRequest() + request.merchantAuthentication = merchantAuth + request.refId = "Sample" + request.transactionRequest = transactionrequest - # request = apicontractsv1.createTransactionRequest() - # request.merchantAuthentication = merchantAuth - # request.refId = "Sample" - # request.transactionRequest = transactionrequest + controller = createTransactionController(request) + controller.execute() - # controller = createTransactionController(request) - # controller.execute() + response = controller.getresponse() - # 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.') - # 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 + return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): create_google_pay_transaction() From 279ef381f17f207d2f2b31ac01412b8c79caefc5 Mon Sep 17 00:00:00 2001 From: Gaidin Daishan Date: Thu, 22 Feb 2024 18:49:37 +0530 Subject: [PATCH 24/28] Updated dates used in requests --- PaymentTransactions/authorize-credit-card.py | 2 +- RecurringBilling/create-subscription-from-customer-profile.py | 2 +- RecurringBilling/create-subscription.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PaymentTransactions/authorize-credit-card.py b/PaymentTransactions/authorize-credit-card.py index 49ef0e6..e62248a 100644 --- a/PaymentTransactions/authorize-credit-card.py +++ b/PaymentTransactions/authorize-credit-card.py @@ -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 + 100) + authorize_credit_card(CONSTANTS.amount + str(100)) diff --git a/RecurringBilling/create-subscription-from-customer-profile.py b/RecurringBilling/create-subscription-from-customer-profile.py index 1a02922..ae466a5 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.py +++ b/RecurringBilling/create-subscription-from-customer-profile.py @@ -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(2021, 12, 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 6a66189..b5364c9 100644 --- a/RecurringBilling/create-subscription.py +++ b/RecurringBilling/create-subscription.py @@ -18,7 +18,7 @@ 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(2021, 12, 30) + paymentschedule.startDate = datetime(2030, 12, 30) paymentschedule.totalOccurrences = 12 paymentschedule.trialOccurrences = 1 # Giving the credit card info From c04f965efc5de463be2cfc3e658c6a9ecffcf99c Mon Sep 17 00:00:00 2001 From: gnongsie Date: Tue, 9 Jul 2024 13:31:36 +0530 Subject: [PATCH 25/28] Changes to handle deprecation of imp module. Switched to importlib. --- .../create-an-accept-payment-transaction.py | 4 +- .../get-accept-customer-profile-page.py | 4 +- AcceptSuite/get-an-accept-payment-page.py | 4 +- .../create-customer-payment-profile.py | 4 +- ...reate-customer-profile-from-transaction.py | 4 +- CustomerProfiles/create-customer-profile.py | 4 +- .../create-customer-shipping-address.py | 4 +- .../delete-customer-payment-profile.py | 4 +- CustomerProfiles/delete-customer-profile.py | 4 +- .../delete-customer-shipping-address.py | 4 +- .../get-customer-payment-profile-list.py | 4 +- .../get-customer-payment-profile.py | 4 +- CustomerProfiles/get-customer-profile-ids.py | 4 +- CustomerProfiles/get-customer-profile.py | 4 +- .../get-customer-shipping-address.py | 4 +- .../update-customer-payment-profile.py | 4 +- CustomerProfiles/update-customer-profile.py | 4 +- .../update-customer-shipping-address.py | 4 +- .../validate-customer-payment-profile.py | 4 +- .../approve-or-decline-held-transaction.py | 4 +- FraudManagement/get-held-transaction-list.py | 4 +- .../create-an-accept-transaction.py | 4 +- .../create-an-android-pay-transaction.py | 4 +- .../create-an-apple-pay-transaction.py | 4 +- .../create-google-pay-transaction.py | 4 +- .../authorization-and-capture-continued.py | 4 +- .../authorization-and-capture.py | 4 +- .../authorization-only-continued.py | 4 +- PayPalExpressCheckout/authorization-only.py | 4 +- PayPalExpressCheckout/credit.py | 4 +- PayPalExpressCheckout/get-details.py | 4 +- .../prior-authorization-capture.py | 4 +- PayPalExpressCheckout/void.py | 4 +- PaymentTransactions/authorize-credit-card.py | 4 +- ...unds-authorized-through-another-channel.py | 4 +- .../capture-previously-authorized-amount.py | 4 +- PaymentTransactions/charge-credit-card.py | 4 +- .../charge-customer-profile.py | 4 +- .../charge-tokenized-credit-card.py | 4 +- .../create-chase-pay-transaction.py | 2 +- PaymentTransactions/credit-bank-account.py | 4 +- PaymentTransactions/debit-bank-account.py | 4 +- PaymentTransactions/refund-transaction.py | 4 +- .../update-split-tender-group.py | 4 +- PaymentTransactions/void-transaction.py | 4 +- RecurringBilling/cancel-subscription.py | 4 +- ...eate-subscription-from-customer-profile.py | 4 +- RecurringBilling/create-subscription.py | 4 +- RecurringBilling/get-list-of-subscriptions.py | 4 +- RecurringBilling/get-subscription-status.py | 4 +- RecurringBilling/get-subscription.py | 4 +- RecurringBilling/update-subscription.py | 4 +- TransactionReporting/get-batch-statistics.py | 4 +- .../get-customer-profile-transaction-list.py | 4 +- TransactionReporting/get-merchant-details.py | 4 +- .../get-settled-batch-list.py | 4 +- .../get-transaction-details.py | 4 +- TransactionReporting/get-transaction-list.py | 4 +- .../get-unsettled-transaction-list.py | 4 +- VisaCheckout/create-visa-src-transaction.py | 4 +- VisaCheckout/decrypt-visa-src-data.py | 4 +- test-runner.py | 232 +++++++++--------- 62 files changed, 237 insertions(+), 237 deletions(-) diff --git a/AcceptSuite/create-an-accept-payment-transaction.py b/AcceptSuite/create-an-accept-payment-transaction.py index 21ebbca..ee28fd9 100644 --- a/AcceptSuite/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/AcceptSuite/get-accept-customer-profile-page.py b/AcceptSuite/get-accept-customer-profile-page.py index ee29377..9cb5cbe 100644 --- a/AcceptSuite/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/AcceptSuite/get-an-accept-payment-page.py b/AcceptSuite/get-an-accept-payment-page.py index 33bca4f..1caffc9 100644 --- a/AcceptSuite/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 bcbe6af..0dc2ef9 100644 --- a/CustomerProfiles/create-customer-payment-profile.py +++ b/CustomerProfiles/create-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 create_customer_payment_profile(customerProfileId): merchantAuth = apicontractsv1.merchantAuthenticationType() 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 6ffdbd7..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() 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 99a1876..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(): 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 index 19d5284..8684b57 100644 --- a/MobileInAppTransactions/create-google-pay-transaction.py +++ b/MobileInAppTransactions/create-google-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_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 c584080..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(): diff --git a/PayPalExpressCheckout/authorization-only.py b/PayPalExpressCheckout/authorization-only.py index 4e3bcb7..c89a434 100644 --- a/PayPalExpressCheckout/authorization-only.py +++ b/PayPalExpressCheckout/authorization-only.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 authorization_only(): 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 e62248a..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): diff --git a/PaymentTransactions/capture-funds-authorized-through-another-channel.py b/PaymentTransactions/capture-funds-authorized-through-another-channel.py index bef1584..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(): 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 4569e8c..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): 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 70b7513..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(): diff --git a/PaymentTransactions/create-chase-pay-transaction.py b/PaymentTransactions/create-chase-pay-transaction.py index 4e06e87..dbd9c10 100644 --- a/PaymentTransactions/create-chase-pay-transaction.py +++ b/PaymentTransactions/create-chase-pay-transaction.py @@ -1,5 +1,5 @@ import os, sys -import imp +from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * 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 1bd5f64..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): 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 ae466a5..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 * diff --git a/RecurringBilling/create-subscription.py b/RecurringBilling/create-subscription.py index b5364c9..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 * 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 ceb0ca5..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): diff --git a/RecurringBilling/update-subscription.py b/RecurringBilling/update-subscription.py index c7af26c..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() diff --git a/TransactionReporting/get-batch-statistics.py b/TransactionReporting/get-batch-statistics.py index d0a9060..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(): diff --git a/TransactionReporting/get-customer-profile-transaction-list.py b/TransactionReporting/get-customer-profile-transaction-list.py index 415f74a..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): 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 073c264..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): 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-src-transaction.py b/VisaCheckout/create-visa-src-transaction.py index 0ef447b..8d8b08a 100644 --- a/VisaCheckout/create-visa-src-transaction.py +++ b/VisaCheckout/create-visa-src-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_visa_src_transaction(): diff --git a/VisaCheckout/decrypt-visa-src-data.py b/VisaCheckout/decrypt-visa-src-data.py index da86341..65714f5 100644 --- a/VisaCheckout/decrypt-visa-src-data.py +++ b/VisaCheckout/decrypt-visa-src-data.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 decrypt_visa_src_data(): merchantAuth = apicontractsv1.merchantAuthenticationType() diff --git a/test-runner.py b/test-runner.py index b72b892..f14f8c2 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') + 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,76 +537,76 @@ 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_src_transaction(self): print("create_visa_src_transaction") - modl = imp.load_source('modulename', 'VisaCheckout/create-visa-checkout-transaction.py') + modl = SourceFileLoader('modulename', 'VisaCheckout/create-visa-checkout-transaction.py').load_module() return modl.create_visa_src_transaction() def decrypt_visa_src_data(self): print("decrypt_visa_src_data") - modl = imp.load_source('modulename', 'VisaCheckout/decrypt-visa-checkout-data.py') + 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', 'AcceptSuite/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 = imp.load_source('modulename', 'TransactionReporting/get-account-updater-job-details.py') + modl = SourceFileLoader('modulename', 'TransactionReporting/get-account-updater-job-details.py').load_module() return modl.get_account_updater_job_details() def validate_response(self, response): From 0807f70a8c25071bbf5a1b5d009d899ea91f3d56 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Wed, 10 Jul 2024 12:28:30 +0530 Subject: [PATCH 26/28] Fixed error --- test-runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-runner.py b/test-runner.py index f14f8c2..64279a0 100644 --- a/test-runner.py +++ b/test-runner.py @@ -30,7 +30,7 @@ def create_an_accept_transaction(self): def create_an_android_pay_transaction(self): print("create_an_android_pay_transaction") - modl = SourceFileLoader('modulename', 'MobileInappTransactions/create-an-android-pay-transaction.py').load_module(). + 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): From 152ce8e2276e8b2c313dbd33d16adf8b15b8aa33 Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Thu, 19 Sep 2024 21:46:01 +0530 Subject: [PATCH 27/28] Update create-customer-payment-profile.py --- CustomerProfiles/create-customer-payment-profile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CustomerProfiles/create-customer-payment-profile.py b/CustomerProfiles/create-customer-payment-profile.py index 0dc2ef9..e144fff 100644 --- a/CustomerProfiles/create-customer-payment-profile.py +++ b/CustomerProfiles/create-customer-payment-profile.py @@ -1,4 +1,5 @@ import os, sys +import random from importlib.machinery import SourceFileLoader from authorizenet import apicontractsv1 @@ -18,8 +19,8 @@ def create_customer_payment_profile(customerProfileId): payment.creditCard = creditCard billTo = apicontractsv1.customerAddressType() - billTo.firstName = "John" - billTo.lastName = "Snow" + billTo.firstName = "John" + random.randint(0, 10000) + billTo.lastName = "Snow" + random.randint(0, 10000) profile = apicontractsv1.customerPaymentProfileType() profile.payment = payment From f5cfd2d496cbe88183e044ac6b4128b57a006d4b Mon Sep 17 00:00:00 2001 From: Gabriel Broadwin Nongsiej Date: Thu, 19 Sep 2024 21:50:50 +0530 Subject: [PATCH 28/28] Update create-customer-payment-profile.py --- CustomerProfiles/create-customer-payment-profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CustomerProfiles/create-customer-payment-profile.py b/CustomerProfiles/create-customer-payment-profile.py index e144fff..0d249e9 100644 --- a/CustomerProfiles/create-customer-payment-profile.py +++ b/CustomerProfiles/create-customer-payment-profile.py @@ -19,8 +19,8 @@ def create_customer_payment_profile(customerProfileId): payment.creditCard = creditCard billTo = apicontractsv1.customerAddressType() - billTo.firstName = "John" + random.randint(0, 10000) - billTo.lastName = "Snow" + random.randint(0, 10000) + billTo.firstName = "John" + str(random.randint(0, 10000)) + billTo.lastName = "Snow" + str(random.randint(0, 10000)) profile = apicontractsv1.customerPaymentProfileType() profile.payment = payment 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