diff --git a/setup.py b/setup.py
index 51cee81b..1450e689 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-REQUIRES = ["urllib3", "six", "certifi", "DateTime", "Naked", "PyJWT", "PyNaCl", "PyYAML",
+REQUIRES = ["pycryptodome","urllib3", "six", "certifi", "DateTime", "Naked", "PyJWT", "PyNaCl", "PyYAML",
"asn1crypto",
"bcrypt",
"certifi",
@@ -38,7 +38,6 @@
"pyOpenSSL",
"pyasn1",
"pycparser",
- "pycryptodome",
"pycryptodomex",
"pypi",
"python-mimeparse",
diff --git a/test/cybersource-rest-qa-python/.idea/cybersource-rest-qa-python.iml b/test/cybersource-rest-qa-python/.idea/cybersource-rest-qa-python.iml
new file mode 100644
index 00000000..787c1db0
--- /dev/null
+++ b/test/cybersource-rest-qa-python/.idea/cybersource-rest-qa-python.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/.idea/misc.xml b/test/cybersource-rest-qa-python/.idea/misc.xml
new file mode 100644
index 00000000..6667b22a
--- /dev/null
+++ b/test/cybersource-rest-qa-python/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/.idea/modules.xml b/test/cybersource-rest-qa-python/.idea/modules.xml
new file mode 100644
index 00000000..8fdd22c2
--- /dev/null
+++ b/test/cybersource-rest-qa-python/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/.idea/workspace.xml b/test/cybersource-rest-qa-python/.idea/workspace.xml
new file mode 100644
index 00000000..70fbaca0
--- /dev/null
+++ b/test/cybersource-rest-qa-python/.idea/workspace.xml
@@ -0,0 +1,751 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ message
+ GetUser
+ 0
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1544098561378
+
+
+ 1544098561378
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/data/__init__.py b/test/cybersource-rest-qa-python/data/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/cybersource-rest-qa-python/data/input_configuration.py b/test/cybersource-rest-qa-python/data/input_configuration.py
new file mode 100644
index 00000000..3e661d6c
--- /dev/null
+++ b/test/cybersource-rest-qa-python/data/input_configuration.py
@@ -0,0 +1,52 @@
+import os
+from CyberSource.configuration import Configuration
+
+class InputConfiguration:
+ def __init__(self):
+ self.authentication_type ="http_signature"
+ self.merchantid = "testrest"
+ self.run_environment = "CyberSource.Environment.SANDBOX"
+ self.request_json_path = ""
+ # JWT PARAMETERS
+ self.key_alias = "testrest"
+ self.key_pass = "testrest"
+ self.key_file_name = "testrest"
+ self.keys_directory = os.path.join(os.getcwd(), "resources")
+ # HTTP PARAMETERS
+ self.merchant_keyid = "08c94330-f618-42a3-b09d-e1e43be5efda"
+ self.merchant_secretkey = "yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE="
+ # CONNECTION TIMEOUT PARAMETER
+ self.timeout = 1000
+ # LOG PARAMETERS
+ self.enable_log = True
+ self.log_file_name = "cybs"
+ self.log_maximum_size = 10487560
+ self.log_directory = os.path.join(os.getcwd(), "Logs")
+ # PROXY PARAMETERS
+ #self.proxy_address = "userproxy.com"
+ #self.proxy_port = ""
+
+ # Assigning the configuration properties in the configuration dictionary
+ def get_configuration(self):
+ configuration_dictionary = ({})
+ configuration_dictionary["authentication_type"] = self.authentication_type
+ configuration_dictionary["merchantid"] = self.merchantid
+ configuration_dictionary["run_environment"] = self.run_environment
+ configuration_dictionary["request_json_path"] = self.request_json_path
+ configuration_dictionary["key_alias"] = self.key_alias
+ configuration_dictionary["key_password"] = self.key_pass
+ configuration_dictionary["key_file_name"] = self.key_file_name
+ configuration_dictionary["keys_directory"] = self.keys_directory
+ configuration_dictionary["merchant_keyid"] = self.merchant_keyid
+ configuration_dictionary["merchant_secretkey"] = self.merchant_secretkey
+ configuration_dictionary["enable_log"] = self.enable_log
+ configuration_dictionary["timeout"] = self.timeout
+ configuration_dictionary["log_file_name"] = self.log_file_name
+ configuration_dictionary["log_maximum_size"] = self.log_maximum_size
+ configuration_dictionary["log_directory"] = self.log_directory
+ #configuration_dictionary["proxy_address"] = self.proxy_address
+ #configuration_dictionary["proxy_port"] = self.proxy_port
+
+ return configuration_dictionary
+
+
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/driver/driver.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/driver/driver.csv
new file mode 100644
index 00000000..4e121eae
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/driver/driver.csv
@@ -0,0 +1,44 @@
+dirName,fileName,flag
+qa_scripts/flex/coreservices,generate_key,0
+qa_scripts/flex/coreservices,tokenize_card,0
+qa_scripts/flex,keygeneration_noenc,0
+qa_scripts/payments/coreservices,process_payment,0
+qa_scripts/payments/coreservices,process_credit,0
+qa_scripts/payments/coreservices,process_authorization_reversal,0
+qa_scripts/payments/coreservices,refund_capture,0
+qa_scripts/payments/coreservices,capture_payment,0
+qa_scripts/payments/coreservices,refund_payment,0
+qa_scripts/payments/coreservices,void_credit,0
+qa_scripts/payments/coreservices,void_capture,0
+qa_scripts/payments/coreservices,void_payment,0
+qa_scripts/payments/coreservices,void_refund,0
+qa_scripts/payouts/coreservices,process_payout,0
+qa_scripts/secure_file_share/coreservices,download_file_with_file_identifier,0
+qa_scripts/secure_file_share/coreservices,get_list_of_files,0
+qa_scripts/transaction_batches/coreservices,get_individual_batch_file,0
+qa_scripts/transaction_batches/coreservices,get_list_of_batch_files,0
+qa_scripts/transaction_details/coreservices,retrieve_transaction,0
+qa_scripts/transaction_search/coreservices,create_search_request,0
+qa_scripts/transaction_search/coreservices,get_search_results,0
+qa_scripts/tms/coreservices,create_instrument_identifier,0
+qa_scripts/tms/coreservices,create_payment_instrument,0
+qa_scripts/tms/coreservices,delete_instrument_identifier,0
+qa_scripts/tms/coreservices,delete_payment_instrument,0
+qa_scripts/tms/coreservices,retrieve_all_payment_instruments,0
+qa_scripts/tms/coreservices,retrieve_instrument_identifier,0
+qa_scripts/tms/coreservices,retrieve_payment_instrument,0
+qa_scripts/tms/coreservices,update_instrument_identifier,0
+qa_scripts/tms/coreservices,update_payment_instrument,0
+qa_scripts/reporting/coreservices,create_adhoc_report,0
+qa_scripts/reporting/coreservices,create_report_subscription_for_report_name_by_organization,0
+qa_scripts/reporting/coreservices,delete_subscription_of_report_name_by_organization,0
+qa_scripts/reporting/coreservices,download_report,0
+qa_scripts/reporting/coreservices,get_all_subscriptions,0
+qa_scripts/reporting/coreservices,get_notification_of_changes,0
+qa_scripts/reporting/coreservices,get_purchase_and_refund_details,0
+qa_scripts/reporting/coreservices,get_report_based_on_reportid,0
+qa_scripts/reporting/coreservices,get_report_definition,0
+qa_scripts/reporting/coreservices,get_reporting_resource_information,0
+qa_scripts/reporting/coreservices,get_subscription_for_report_name,0
+qa_scripts/reporting/coreservices,retrieve_available_reports,0
+qa_scripts/user_management/coreservices,get_user_information,0
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/generate_key.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/generate_key.csv
new file mode 100644
index 00000000..397607ca
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/generate_key.csv
@@ -0,0 +1,3 @@
+testCaseId,encryptionType,message
+GenKey_01,RsaOaep256,Success
+GenKey_02,PqaPabc255,Fails due to invalid encryptionType
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/tokenize_card.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/tokenize_card.csv
new file mode 100644
index 00000000..bb28c194
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/coreservices/tokenize_card.csv
@@ -0,0 +1,3 @@
+testCaseId,keyId,message
+TokC_01,07NfqdlpwanURKk1leYobJihXZjFgoWB,Success
+TokC_02,0023154mudgshfyrtdgfj456fhdggdg1,Fails due to invalid keyId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/keygeneration_noenc.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/keygeneration_noenc.csv
new file mode 100644
index 00000000..632b8fe4
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/flex/keygeneration_noenc.csv
@@ -0,0 +1,3 @@
+testCaseId,encryptionType,message
+KeyGenNE_01,None,Success
+KeyGenNE_02,SDMP,Fails due to invalid encryptionType
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/__init__.py b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/capture_payment.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/capture_payment.csv
new file mode 100644
index 00000000..225e9433
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/capture_payment.csv
@@ -0,0 +1,4 @@
+testCaseId,paymentId,amount,status,message
+CACap_01,5496229809156367203003,102.21,Success
+CACap_02,5468704195526582203006,102,Fails due to mismatch amount
+CACap_03,1234567898765432123344,102.21,Fails due to invalid paymentId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_authorization_reversal.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_authorization_reversal.csv
new file mode 100644
index 00000000..3d47dd39
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_authorization_reversal.csv
@@ -0,0 +1,4 @@
+testCaseId,paymentId,amount,message
+CARev_01,5496226547916364303003,102.21,Success
+CARev_02,5495391892066857803005,102,Fails due to mismatch amount
+CARev_03,1234567899874561231790,102.21,Fails due to invalid paymentId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_credit.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_credit.csv
new file mode 100644
index 00000000..cdec118f
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_credit.csv
@@ -0,0 +1,4 @@
+testCaseId,amount,message
+CACre_01,102.21,Success
+CACre_02,100,Fails due to mismatch amount
+CACre_03,GHTR25,Fails due to invalid amount
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_payment.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_payment.csv
new file mode 100644
index 00000000..1d581167
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/process_payment.csv
@@ -0,0 +1,4 @@
+testCaseId,amount,message
+CPAP_01,102.21,Success
+CPAP_02,102,Fails due to mismatch amount
+CPAP_03,GTR4,Fails due to invalid amount
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_capture.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_capture.csv
new file mode 100644
index 00000000..7b417e4b
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_capture.csv
@@ -0,0 +1,4 @@
+testCaseId,captureId,amount,message
+RAC_01,5496230272276367603003,102.21,Success
+RAC_02,5495384547406854803005,102,Fails due to mismatch amount
+RAC_03,1234567898745632145698,BSL8,Fails due to invalid captureId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_payment.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_payment.csv
new file mode 100644
index 00000000..184f13cb
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/refund_payment.csv
@@ -0,0 +1,4 @@
+testCaseId,paymentId,amount,message
+RAP_01,5496234069506311403005,102.21,Success
+RAP_02,5403902362156600403006,102,Fails due to mismatch amount
+RAP_03,1234567890123456789123,102.21,Fails due to invalid paymentId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_capture.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_capture.csv
new file mode 100644
index 00000000..4ec0838d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_capture.csv
@@ -0,0 +1,3 @@
+testCaseId,captureId,status,message
+VAC_01,5496230272276367603003,VOIDED,Success
+VAC_02,8964213433846812344644,VOIDED,Fails due to invalid captureId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_credit.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_credit.csv
new file mode 100644
index 00000000..869e2016
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_credit.csv
@@ -0,0 +1,3 @@
+testCaseId,creditId,status,message
+VAC_01,5496226568506308803002,,VOIDED,Success
+VAC_02,8964213433846812344644,VOIDED,Fails due to invalid creditId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_payment.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_payment.csv
new file mode 100644
index 00000000..b656da1c
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_payment.csv
@@ -0,0 +1,3 @@
+testCaseId,paymentId,status,message
+VAP_01,5496234069506311403005,VOIDED,Success
+VAP_02,8964213433846812344644,VOIDED,Fails due to invalid paymentId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_refund.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_refund.csv
new file mode 100644
index 00000000..f9045209
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payments/coreservices/void_refund.csv
@@ -0,0 +1,3 @@
+testCaseId,refundId,status,message
+VAR_01,5496235192926336903004,VOIDED,Success
+VAR_02,8964213433846812344644,VOIDED,Fails due to invalid refundId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/payouts/coreservices/process_payout.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payouts/coreservices/process_payout.csv
new file mode 100644
index 00000000..dbd47c19
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/payouts/coreservices/process_payout.csv
@@ -0,0 +1,3 @@
+testCaseId,cleintRefInfoCode,businessAppId,amount,message
+CPPay_01,33557799,FD,100.00,Success
+CPPay_02,67859,MD,DGH25,Fails due to invalid amount
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_adhoc_report.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_adhoc_report.csv
new file mode 100644
index 00000000..e6d209b5
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_adhoc_report.csv
@@ -0,0 +1,3 @@
+testCaseId,reportDefName,repName,reportSTime,reportETime,message
+CAdR_01,TransactionRequestClass,testrest_v213,2018-09-01T12:00:00+05:00,2018-09-02T12:00:00+05:00,Success
+CAdR_02,TransactionRequ,testrest_v2,2018-09-01T12:00:00+05:00,2018-09-02T12:00:00+05:00,fails due to invalid reportDefinitionName
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_report_subscription_for_report_name_by_organization.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_report_subscription_for_report_name_by_organization.csv
new file mode 100644
index 00000000..f3a98b47
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/create_report_subscription_for_report_name_by_organization.csv
@@ -0,0 +1,3 @@
+testCaseId,reportDefName,repName,repFrequency,message
+CRSFRNO_01,TransactionRequestClass,testrest_subcription_v9,DAILY,Success
+CRSFRNO_02,TransactionRes,subscriptionAutomation2,DAILY,Fails due to invalid reportDefinitionName
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/delete_subscription_of_report_name_by_organization.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/delete_subscription_of_report_name_by_organization.csv
new file mode 100644
index 00000000..3e0b1673
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/delete_subscription_of_report_name_by_organization.csv
@@ -0,0 +1,3 @@
+testCaseId,repName,message
+DSRNO_01,testrest_subcription_v9,Success
+DSRNO_02,ghsrrawasbhfhcb,Fails due to invalid reportName
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/download_report.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/download_report.csv
new file mode 100644
index 00000000..0c14e16b
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/download_report.csv
@@ -0,0 +1,4 @@
+testCaseId,orgId,repName,repDate,message
+DR_01,testrest,testrest_v2,2018-09-02,Success
+DR_02,testrest,testre,2018-09-02,Fails due to invalid reportName
+DR_03,testrest,testrest_v2,2018-08-02,Fails due to invalid reportDate
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_all_subscriptions.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_all_subscriptions.csv
new file mode 100644
index 00000000..1a9ccf41
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_all_subscriptions.csv
@@ -0,0 +1,2 @@
+testCaseId,,message
+GAS_01,Success
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_notification_of_changes.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_notification_of_changes.csv
new file mode 100644
index 00000000..41b1cc2a
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_notification_of_changes.csv
@@ -0,0 +1,4 @@
+testCaseId,sTime,eTime,message
+GNOC_01,2018-09-01T12:00:00-05:00,2018-09-30T12:00:00-05:00,Success
+GNOC_02,2018-01T12:00-05,2018-09-30T12:00:00-05:00,Fails due to invalid startTime
+GNOC_03,2018-09-01T12:00:00-05:00,2018-30T12:00-05,Fails due to invalid endTime
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_purchase_and_refund_details.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_purchase_and_refund_details.csv
new file mode 100644
index 00000000..169a562d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_purchase_and_refund_details.csv
@@ -0,0 +1,5 @@
+testCaseId,sTime,eTime,orgId,message
+GPARD_01,2018-05-01T12:00:00-05:00,2018-05-30T12:00:00-05:00,uday_wf,Success
+GPARD_02,2018-01T12:00-05,2018-05-30T12:00:00-05:00,uday_wf,Fails due to invalid startTime
+GPARD_03,2018-05-01T12:00:00-05:00,2018-30T12:00-05,uday_wf,Fails due to invalid endTime
+GPARD_04,2018-05-01T12:00:00-05:00,2018-05-30T12:00:00-05:00,udapaa,Fails due to invalid organizationId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_based_on_reportid.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_based_on_reportid.csv
new file mode 100644
index 00000000..c1407d09
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_based_on_reportid.csv
@@ -0,0 +1,4 @@
+testCaseId,orgId,repId,message
+GRBRI_01,testrest,79642c43-2368-0cd5-e053-a2588e0a7b3c,Success
+GRBRI_02,testrest,79642c43-2368-0cd5-e053-a2588e0a,Fails due to invalid reportId
+GRBRI_03,bkalama,79642c43-2368-0cd5-e053-a2588e0a7b3c,Fails due to invalid organizationId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_definition.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_definition.csv
new file mode 100644
index 00000000..ba00ca88
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_report_definition.csv
@@ -0,0 +1,3 @@
+testCaseId,reportDefName,message
+GRD_01,SubscriptionDetailClass,Success
+GRD_02,SubscDetail,Fails due to invalid reportDefinitionName
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_reporting_resource_information.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_reporting_resource_information.csv
new file mode 100644
index 00000000..f09027c5
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_reporting_resource_information.csv
@@ -0,0 +1,3 @@
+testCaseId,orgId,message
+GRRI_01,testrest,Success
+GRRI_02,bplkmdghd,Fails due to invalid organizationId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_subscription_for_report_name.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_subscription_for_report_name.csv
new file mode 100644
index 00000000..b706c9ab
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/get_subscription_for_report_name.csv
@@ -0,0 +1,3 @@
+testCaseId,repName,message
+GSFRN_01,testrest_subcription_v213,Success
+GSFRN_02,bplkmdgsd,Fails due to invalid reportName
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/retrieve_available_reports.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/retrieve_available_reports.csv
new file mode 100644
index 00000000..9ce40c63
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/reporting/coreservices/retrieve_available_reports.csv
@@ -0,0 +1,5 @@
+testCaseId,sTime,eTime,tQueryType,message
+RAR_01,2018-10-02T00:00:00.0Z,2018-10-30T23:59:59.0Z,executedTime,Success
+RAR_02,2018-09-01T00:00:00.0Z,2018-09-05T23:59:59.0Z,reportsTime,Fails due to invalid timeQueryType
+RAR_03,2018-09-01T00:00:,2018-09-05T23:59:59.0Z,executedTime,Fails due to invalid startTime
+RAR_04,2018-09-01T00:00:00.0Z,2018-09-05T23:59,executedTime,Fails due to invalid endTime
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/download_file_with_file_identifier.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/download_file_with_file_identifier.csv
new file mode 100644
index 00000000..0c674ee0
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/download_file_with_file_identifier.csv
@@ -0,0 +1,3 @@
+testCaseId,organizationId,fileId,message
+DFWFI_01,testrest,VFJSUmVwb3J0LTc4NTVkMTNmLTkzOTgtNTExMy1lMDUzLWEyNTg4ZTBhNzE5Mi5jc3YtMjAxOC0xMC0yMA==,Success
+DFWFI_02,testrest,VFJSUmVwb3J0LTc4NTVkMTNmLTkzOTgtNTExMy1lMDUzLWEyNTg4ZTBhNzE5Mi5jc3YtMjAxOC0,Fails due to invalid fieldId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/get_list_of_files.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/get_list_of_files.csv
new file mode 100644
index 00000000..ae5fb2c2
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/secure_file_share/coreservices/get_list_of_files.csv
@@ -0,0 +1,3 @@
+testCaseId,organizationId,startDate,endDate,message
+GLF_01,testrest,2018-10-20,2018-10-30,Success
+GLF_02,test,2018-10-20,2018-10-30,Success
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/test_report/testresults.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/test_report/testresults.csv
new file mode 100644
index 00000000..4369f149
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/test_report/testresults.csv
@@ -0,0 +1,195 @@
+TestCaseId,APIName,Status,Message,TimeStamp
+GenKey_01,GenerateKey,Passed:200-07smvL6jBuQGZpPAauXR9OG2tMTVK4CI ,Success,2019-02-26 12:35:32.055382
+GenKey_02,GenerateKey,Failed:400,One or more validation errors occurred,2019-02-26 12:35:32.271561
+TokC_01,TokenizedCard,Failed:400,VALIDATION_ERROR,2019-02-26 12:35:32.456488
+TokC_02,TokenizedCard,Failed:400,VALIDATION_ERROR,2019-02-26 12:35:32.625261
+KeyGenNE_01,KeyGenerationNoEnc,Passed:200-077wDBt22iaH5HjcLPRdaRMJUXrSeRkW ,Success,2019-02-26 12:35:32.840958
+KeyGenNE_02,KeyGenerationNoEnc,Failed:400,VALIDATION_ERROR,2019-02-26 12:35:33.041538
+CPAP_01,ProcessPayment,Passed:201-5511647332676852603002 ,Success,2019-02-26 12:35:33.688874
+CPAP_02,ProcessPayment,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 12:35:34.397260
+CPAP_03,ProcessPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:34.982668
+CACre_01,ProcessCredit,Passed:201-5511647351856375103006 ,Success,2019-02-26 12:35:35.557773
+CACre_02,ProcessCredit,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 12:35:36.124709
+CACre_03,ProcessCredit,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:36.675448
+CARev_01,ProcessAuthorizationReversal,Failed:400,Decline - The transaction has already been settled or reversed.,2019-02-26 12:35:37.277735
+CARev_02,ProcessAuthorizationReversal,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:37.832170
+CARev_03,ProcessAuthorizationReversal,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:48.394666
+RAC_01,RefundCapture,Failed:400,Decline - You requested a credit for a capture that was previously voided.,2019-02-26 12:35:48.964815
+RAC_02,RefundCapture,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 12:35:49.627874
+RAC_03,RefundCapture,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:50.182086
+CACap_01,CapturePayment,Passed:201-5511647503826853003002 ,Success,2019-02-26 12:35:50.783091
+CACap_02,CapturePayment,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 12:35:51.384358
+CACap_03,CapturePayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:35:51.916256
+RAP_01,RefundPayment,Failed:400,Decline - You requested a credit for a capture that was previously voided.,2019-02-26 12:35:52.501546
+RAP_02,RefundCapture,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 12:35:53.287188
+RAP_03,RefundPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:03.871370
+VAC_01,VoidCredit,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 12:36:04.540485
+VAC_02,VoidCredit,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:15.121656
+VAC_01,VoidCapture,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 12:36:15.685021
+VAC_02,VoidCapture,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:26.295169
+VAP_01,VoidPayment,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 12:36:27.040284
+VAP_02,VoidPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:37.726935
+VAR_01,VoidRefund,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 12:36:38.280472
+VAR_02,VoidRefund,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:48.887149
+CPPay_01,ProcessPayout,Passed:201-5511648090616303903005 ,Success,2019-02-26 12:36:49.565650
+CPPay_02,ProcessPayout,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 12:36:50.204264
+DFWFI_01,DownloadFileWithFileIdentifier,Passed:200-VFJSUmVwb3J0LTc4NTVkMTNmLTkzOTgtNTExMy1lMDUzLWEyNTg4ZTBhNzE5Mi5jc3YtMjAxOC0xMC0yMA== ,Success,2019-02-26 12:36:51.838466
+DFWFI_02,DownloadFileWithFileIdentifier,Failed:400,Fails due to invalid fieldId,2019-02-26 12:36:52.392152
+GLF_01,GetListOfFiles,Passed:200-testrest ,Success,2019-02-26 12:36:53.356466
+GLF_02,GetListOfFiles,Failed:403,Merchant - Unauthorised access to Reseller/Account,2019-02-26 12:36:53.926119
+GIBF_01,GetIndividualBatchFile,Passed:200-Owcyk6pl ,Success,2019-02-26 12:36:54.195718
+GIBF_02,GetIndividualBatchFile,Failed:404,The requested resource does not exist,2019-02-26 12:36:54.427555
+GLOF_01,GetListOfBatchFile,Passed:200,Success,2019-02-26 12:36:54.674487
+GLOF_02,GetListOfBatchFile,Failed:400,Field validation errors-Fails due to invalid startDate.,2019-02-26 12:36:54.912476
+GLOF_03,GetListOfBatchFile,Failed:400,Field validation errors-Fails due to invalid endDate.,2019-02-26 12:36:55.143902
+RT_01,RetrieveTransaction,Passed:200-5408386919326811103004 ,Success,2019-02-26 12:36:55.444739
+RT_02,RetrieveTransaction,Failed:404,The requested resource does not exist,2019-02-26 12:36:55.698694
+CrSR_01,CreateSearchRequest,Passed:201,Success,2019-02-26 12:36:56.579113
+CrSR_02,CreateSearchRequest,Failed:400,Incorrectly formatted query string,2019-02-26 12:36:56.816472
+GetSR_01,GetSearchResults,Failed:400,search Id not fount.,2019-02-26 12:36:57.048027
+GetSR_02,GetSearchResults,Failed:400,search Id not fount.,2019-02-26 12:36:57.279115
+CInstIden_01,CreateInstrumentIdentifier,Passed:200-7020000000001328765,Success,2019-02-26 12:36:57.532432
+CInstIden_02,CreateInstrumentIdentifier,Failed:400,Invalid header values,2019-02-26 12:36:57.748635
+CPIns_01,CreatePaymentsInstrument,Passed:201-82C7ADA91E652D9DE05340588D0AD6A6,Success,2019-02-26 12:36:58.002591
+CPIns_02,CreatePaymentsInstrument,Failed:400,Invalid header values,2019-02-26 12:36:58.202762
+RemInsIden_01,DeleteInstrumentIdentifier,Failed:410,Token not available,2019-02-26 12:36:58.418976
+RemInsIden_02,DeleteInstrumentIdentifier,Failed:404,Token not found,2019-02-26 12:36:58.650491
+RemPIns_01,DeletePaymentInstrument,Failed:410,Token not available,2019-02-26 12:36:58.866691
+RemPIns_02,DeletePaymentInstrument,Failed:404,Token not found,2019-02-26 12:36:59.082604
+RAPIdenGInsIden_01,RetrieveAllPaymentIdentifiers,Failed:410,Token not available,2019-02-26 12:36:59.312121
+RAPIdenGInsIden_02,RetrieveAllPaymentIdentifiers,Failed:404,Token not found,2019-02-26 12:36:59.512263
+RInsIden_01,RetrieveInstrumentIdentifier,Failed:410,Token not available,2019-02-26 12:36:59.744094
+RInsIden_02,RetrieveInstrumentIdentifier,Failed:404,Token not found,2019-02-26 12:36:59.944661
+RPIden_01,RetrievePaymentInstrument,Passed:200-819A80F076FCC30BE05340588D0AA493,Success,2019-02-26 12:37:00.213898
+RPIden_02,RetrievePaymentInstrument,Failed:404,Token not found,2019-02-26 12:37:00.430099
+UpdInsIden_01,UpdateInstrumentIdentifier,Passed:200-7020000000001328765,Success,2019-02-26 12:37:00.713782
+UpdPIden_01,UpdatePaymentInstrument,Passed:200-819A80F076F5C30BE05340588D0AA493,Success,2019-02-26 12:37:00.946833
+CAdR_01,CreateAdhocReport,Failed:400,Field validation errors:Success,2019-02-26 12:37:01.763728
+CAdR_02,CreateAdhocReport,Failed:400,Field validation errors:fails due to invalid reportDefinitionName,2019-02-26 12:37:02.265159
+CRSFRNO_01,CreateReportSubscriptionForReportNameByOrganization,Passed:201,Success,2019-02-26 12:37:03.219564
+CRSFRNO_02,CreateReportSubscriptionForReportNameByOrganization,Failed:400,Field validation errors:Fails due to invalid reportDefinitionName,2019-02-26 12:37:03.720663
+DSRNO_01,DeleteSubscriptionOfReportNameByOrganization,Passed:200,Success,2019-02-26 12:37:04.227333
+DSRNO_02,DeleteSubscriptionOfReportNameByOrganization,Failed:404,Requested subscription does not exist.:Fails due to invalid reportName,2019-02-26 12:37:04.705875
+DR_01,DownloadReport,Passed:200-testrest ,Success,2019-02-26 12:37:05.660746
+DR_02,DownloadReport,Failed:404,Fails due to invalid reportName,2019-02-26 12:37:06.261913
+DR_03,DownloadReport,Failed:404,Fails due to invalid reportDate,2019-02-26 12:37:06.831617
+GAS_01,GetAllSubscriptions,Passed:200,Success,2019-02-26 12:37:07.648482
+GNOC_01,GetNotificationOfChanges,Failed:404,No results found for the given dates,2019-02-26 12:37:08.350146
+GNOC_02,GetNotificationOfChanges,Failed:400,Field validation errors,2019-02-26 12:37:08.835103
+GNOC_03,GetNotificationOfChanges,Failed:400,Field validation errors,2019-02-26 12:37:09.313309
+GPARD_01,GetPurchaseAndRefundDetails,Failed:404,No Purchase and Refunds found.,2019-02-26 12:37:09.813787
+GPARD_02,GetPurchaseAndRefundDetails,Failed:400,Field validation errors,2019-02-26 12:37:10.298769
+GPARD_03,GetPurchaseAndRefundDetails,Failed:400,Field validation errors,2019-02-26 12:37:10.767971
+GPARD_04,GetPurchaseAndRefundDetails,Failed:404,No Purchase and Refunds found.,2019-02-26 12:37:11.238425
+GRBRI_01,GetReportBasedOnReportId,Passed:200:79642c43-2368-0cd5-e053-a2588e0a7b3c,Success,2019-02-26 12:37:11.770003
+GRBRI_02,GetReportBasedOnReportId,Failed:404,Fails due to invalid reportId,2019-02-26 12:37:12.261132
+GRBRI_03,GetReportBasedOnReportId,Failed:400,Fails due to invalid organizationId,2019-02-26 12:37:12.729140
+GRD_01,GetReportDefinition,Passed:200,Success,2019-02-26 12:37:13.283196
+GRD_02,GetReportDefinition,Failed:404,Fails due to invalid reportDefinitionName,2019-02-26 12:37:13.753354
+GRRI_01,GetReportingResourceInformation,Passed:200,Success,2019-02-26 12:37:14.284694
+GRRI_02,GetReportingResourceInformation,Failed:400,Invalid Merchant,2019-02-26 12:37:14.753782
+GSFRN_01,GetSubscriptionForReportName,Failed:404,Requested subscription does not exist.:Success,2019-02-26 12:37:15.232311
+GSFRN_02,GetSubscriptionForReportName,Failed:404,Requested subscription does not exist.:Fails due to invalid reportName,2019-02-26 12:37:15.702066
+RAR_01,RetrieveAvailableReports,Passed:200,Success,2019-02-26 12:37:17.314248
+RAR_02,RetrieveAvailableReports,Failed:400,Field validation errors:Fails due to invalid timeQueryType,2019-02-26 12:37:17.830219
+RAR_03,RetrieveAvailableReports,Failed:500,Error encountered while processing request:Fails due to invalid startTime,2019-02-26 12:37:18.311740
+RAR_04,RetrieveAvailableReports,Failed:500,Error encountered while processing request:Fails due to invalid endTime,2019-02-26 12:37:18.797115
+GUI_01,GetUserInformation,Passed:200-testrest ,Success,2019-02-26 12:37:19.113228
+GUI_02,GetUserInformation,Failed:401,Fail due to invalid organizationId,2019-02-26 12:37:19.360380
+GenKey_01,GenerateKey,Failed:502,API Gateway Authentication issue,2019-02-26 15:01:57.239394
+GenKey_02,GenerateKey,Failed:502,API Gateway Authentication issue,2019-02-26 15:01:57.455585
+TokC_01,TokenizedCard,Failed:400,VALIDATION_ERROR,2019-02-26 15:01:57.624897
+TokC_02,TokenizedCard,Failed:400,VALIDATION_ERROR,2019-02-26 15:01:57.810320
+KeyGenNE_01,KeyGenerationNoEnc,Failed:502,API_GATEWAY_ERROR,2019-02-26 15:01:58.026278
+KeyGenNE_02,KeyGenerationNoEnc,Failed:502,API_GATEWAY_ERROR,2019-02-26 15:01:58.257988
+CPAP_01,ProcessPayment,Passed:201-5511735185316983503001 ,Success,2019-02-26 15:01:58.907710
+CPAP_02,ProcessPayment,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 15:01:59.589213
+CPAP_03,ProcessPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:00.220059
+CACre_01,ProcessCredit,Passed:201-5511735204736956303003 ,Success,2019-02-26 15:02:00.846453
+CACre_02,ProcessCredit,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 15:02:01.468999
+CACre_03,ProcessCredit,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:02.072449
+CARev_01,ProcessAuthorizationReversal,Failed:400,Decline - The transaction has already been settled or reversed.,2019-02-26 15:02:02.693965
+CARev_02,ProcessAuthorizationReversal,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:03.280011
+CARev_03,ProcessAuthorizationReversal,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:13.870286
+RAC_01,RefundCapture,Failed:400,Decline - You requested a credit for a capture that was previously voided.,2019-02-26 15:02:14.450818
+RAC_02,RefundCapture,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 15:02:15.001818
+RAC_03,RefundCapture,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:15.608417
+CACap_01,CapturePayment,Passed:201-5511735358286372003005 ,Success,2019-02-26 15:02:16.275991
+CACap_02,CapturePayment,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 15:02:16.903950
+CACap_03,CapturePayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:17.482961
+RAP_01,RefundPayment,Failed:400,Decline - You requested a credit for a capture that was previously voided.,2019-02-26 15:02:18.040526
+RAP_02,RefundCapture,Assertion Failed: 201,Fails due to mismatch amount,2019-02-26 15:02:18.840870
+RAP_03,RefundPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:29.434787
+VAC_01,VoidCredit,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 15:02:30.087906
+VAC_02,VoidCredit,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:40.739068
+VAC_01,VoidCapture,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 15:02:41.486661
+VAC_02,VoidCapture,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:02:52.079060
+VAP_01,VoidPayment,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 15:02:52.626921
+VAP_02,VoidPayment,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:03:03.350274
+VAR_01,VoidRefund,Failed:400,|Decline - The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided.|,2019-02-26 15:03:04.084234
+VAR_02,VoidRefund,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:03:14.700265
+CPPay_01,ProcessPayout,Passed:201-5511735948976372603005 ,Success,2019-02-26 15:03:15.410468
+CPPay_02,ProcessPayout,Failed:400,Declined - One or more fields in the request contains invalid data,2019-02-26 15:03:15.943532
+DFWFI_01,DownloadFileWithFileIdentifier,Passed:200-VFJSUmVwb3J0LTc4NTVkMTNmLTkzOTgtNTExMy1lMDUzLWEyNTg4ZTBhNzE5Mi5jc3YtMjAxOC0xMC0yMA== ,Success,2019-02-26 15:03:16.559208
+DFWFI_02,DownloadFileWithFileIdentifier,Failed:400,Fails due to invalid fieldId,2019-02-26 15:03:17.146477
+GLF_01,GetListOfFiles,Passed:200-testrest ,Success,2019-02-26 15:03:18.120167
+GLF_02,GetListOfFiles,Failed:403,Merchant - Unauthorised access to Reseller/Account,2019-02-26 15:03:18.706500
+GIBF_01,GetIndividualBatchFile,Passed:200-Owcyk6pl ,Success,2019-02-26 15:03:18.969094
+GIBF_02,GetIndividualBatchFile,Failed:404,The requested resource does not exist,2019-02-26 15:03:19.207429
+GLOF_01,GetListOfBatchFile,Passed:200,Success,2019-02-26 15:03:19.454919
+GLOF_02,GetListOfBatchFile,Failed:400,Field validation errors-Fails due to invalid startDate.,2019-02-26 15:03:19.686282
+GLOF_03,GetListOfBatchFile,Failed:400,Field validation errors-Fails due to invalid endDate.,2019-02-26 15:03:19.923770
+RT_01,RetrieveTransaction,Passed:200-5408386919326811103004 ,Success,2019-02-26 15:03:20.240546
+RT_02,RetrieveTransaction,Failed:404,The requested resource does not exist,2019-02-26 15:03:20.510019
+CrSR_01,CreateSearchRequest,Passed:201,Success,2019-02-26 15:03:21.442046
+CrSR_02,CreateSearchRequest,Failed:400,Incorrectly formatted query string,2019-02-26 15:03:21.673843
+GetSR_01,GetSearchResults,Failed:400,search Id not fount.,2019-02-26 15:03:21.912186
+GetSR_02,GetSearchResults,Failed:400,search Id not fount.,2019-02-26 15:03:22.143639
+CInstIden_01,CreateInstrumentIdentifier,Passed:200-7020000000001328765,Success,2019-02-26 15:03:22.412488
+CInstIden_02,CreateInstrumentIdentifier,Failed:400,Invalid header values,2019-02-26 15:03:22.631086
+CPIns_01,CreatePaymentsInstrument,Passed:201-82C9920AA9C0A5D4E05340588D0A1DD0,Success,2019-02-26 15:03:22.850503
+CPIns_02,CreatePaymentsInstrument,Failed:400,Invalid header values,2019-02-26 15:03:23.069024
+RemInsIden_01,DeleteInstrumentIdentifier,Failed:410,Token not available,2019-02-26 15:03:23.337424
+RemInsIden_02,DeleteInstrumentIdentifier,Failed:404,Token not found,2019-02-26 15:03:23.553644
+RemPIns_01,DeletePaymentInstrument,Failed:410,Token not available,2019-02-26 15:03:23.769403
+RemPIns_02,DeletePaymentInstrument,Failed:404,Token not found,2019-02-26 15:03:23.991184
+RAPIdenGInsIden_01,RetrieveAllPaymentIdentifiers,Failed:410,Token not available,2019-02-26 15:03:24.229303
+RAPIdenGInsIden_02,RetrieveAllPaymentIdentifiers,Failed:404,Token not found,2019-02-26 15:03:24.448354
+RInsIden_01,RetrieveInstrumentIdentifier,Failed:410,Token not available,2019-02-26 15:03:24.666360
+RInsIden_02,RetrieveInstrumentIdentifier,Failed:404,Token not found,2019-02-26 15:03:24.896128
+RPIden_01,RetrievePaymentInstrument,Passed:200-819A80F076FCC30BE05340588D0AA493,Success,2019-02-26 15:03:25.149901
+RPIden_02,RetrievePaymentInstrument,Failed:404,Token not found,2019-02-26 15:03:25.370693
+UpdInsIden_01,UpdateInstrumentIdentifier,Passed:200-7020000000001328765,Success,2019-02-26 15:03:25.623364
+UpdPIden_01,UpdatePaymentInstrument,Passed:200-819A80F076F5C30BE05340588D0AA493,Success,2019-02-26 15:03:25.868035
+CAdR_01,CreateAdhocReport,Failed:400,Field validation errors:Success,2019-02-26 15:03:26.622477
+CAdR_02,CreateAdhocReport,Failed:400,Field validation errors:fails due to invalid reportDefinitionName,2019-02-26 15:03:27.124131
+CRSFRNO_01,CreateReportSubscriptionForReportNameByOrganization,Passed:201,Success,2019-02-26 15:03:27.910440
+CRSFRNO_02,CreateReportSubscriptionForReportNameByOrganization,Failed:400,Field validation errors:Fails due to invalid reportDefinitionName,2019-02-26 15:03:28.410946
+DSRNO_01,DeleteSubscriptionOfReportNameByOrganization,Passed:200,Success,2019-02-26 15:03:28.918367
+DSRNO_02,DeleteSubscriptionOfReportNameByOrganization,Failed:404,Requested subscription does not exist.:Fails due to invalid reportName,2019-02-26 15:03:29.388552
+DR_01,DownloadReport,Passed:200-testrest ,Success,2019-02-26 15:03:30.181173
+DR_02,DownloadReport,Failed:404,Fails due to invalid reportName,2019-02-26 15:03:30.766387
+DR_03,DownloadReport,Failed:404,Fails due to invalid reportDate,2019-02-26 15:03:31.313830
+GAS_01,GetAllSubscriptions,Passed:200,Success,2019-02-26 15:03:32.115697
+GNOC_01,GetNotificationOfChanges,Failed:404,No results found for the given dates,2019-02-26 15:03:32.632366
+GNOC_02,GetNotificationOfChanges,Failed:400,Field validation errors,2019-02-26 15:03:33.102033
+GNOC_03,GetNotificationOfChanges,Failed:400,Field validation errors,2019-02-26 15:03:33.587010
+GPARD_01,GetPurchaseAndRefundDetails,Failed:404,No Purchase and Refunds found.,2019-02-26 15:03:34.073058
+GPARD_02,GetPurchaseAndRefundDetails,Failed:400,Field validation errors,2019-02-26 15:03:34.554682
+GPARD_03,GetPurchaseAndRefundDetails,Failed:400,Field validation errors,2019-02-26 15:03:35.031841
+GPARD_04,GetPurchaseAndRefundDetails,Failed:404,No Purchase and Refunds found.,2019-02-26 15:03:35.529072
+GRBRI_01,GetReportBasedOnReportId,Passed:200:79642c43-2368-0cd5-e053-a2588e0a7b3c,Success,2019-02-26 15:03:36.047968
+GRBRI_02,GetReportBasedOnReportId,Failed:404,Fails due to invalid reportId,2019-02-26 15:03:36.532617
+GRBRI_03,GetReportBasedOnReportId,Failed:400,Fails due to invalid organizationId,2019-02-26 15:03:37.017227
+GRD_01,GetReportDefinition,Passed:200,Success,2019-02-26 15:03:37.550532
+GRD_02,GetReportDefinition,Failed:404,Fails due to invalid reportDefinitionName,2019-02-26 15:03:38.037964
+GRRI_01,GetReportingResourceInformation,Passed:200,Success,2019-02-26 15:03:38.537980
+GRRI_02,GetReportingResourceInformation,Failed:400,Invalid Merchant,2019-02-26 15:03:39.011333
+GSFRN_01,GetSubscriptionForReportName,Failed:404,Requested subscription does not exist.:Success,2019-02-26 15:03:39.495121
+GSFRN_02,GetSubscriptionForReportName,Failed:404,Requested subscription does not exist.:Fails due to invalid reportName,2019-02-26 15:03:39.976537
+RAR_01,RetrieveAvailableReports,Passed:200,Success,2019-02-26 15:03:41.433020
+RAR_02,RetrieveAvailableReports,Failed:400,Field validation errors:Fails due to invalid timeQueryType,2019-02-26 15:03:41.930431
+RAR_03,RetrieveAvailableReports,Failed:500,Error encountered while processing request:Fails due to invalid startTime,2019-02-26 15:03:42.450202
+RAR_04,RetrieveAvailableReports,Failed:500,Error encountered while processing request:Fails due to invalid endTime,2019-02-26 15:03:42.937007
+GUI_01,GetUserInformation,Passed:200-testrest ,Success,2019-02-26 15:03:43.253513
+GUI_02,GetUserInformation,Failed:401,Fail due to invalid organizationId,2019-02-26 15:03:43.538263
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_instrument_identifier.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_instrument_identifier.csv
new file mode 100644
index 00000000..b7404151
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_instrument_identifier.csv
@@ -0,0 +1,3 @@
+testCaseId,prevTransactionId,profileId,message
+CInstIden_01,123456789012345,93B32398-AD51-4CC2-A682-EA3E93614EB1,Success
+CInstIden_02,123456789012345,25C32588-CD49-6SS3-H123-WQ7T83512NMl,Fails due to invalid profileId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_payment_instrument.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_payment_instrument.csv
new file mode 100644
index 00000000..1042f6ea
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/create_payment_instrument.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,message
+CPIns_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,Success
+CPIns_02,25C32588-CD49-6SS3-H123-WQ7T83512NMl,Fails due to invalid profileId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_instrument_identifier.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_instrument_identifier.csv
new file mode 100644
index 00000000..397c63e4
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_instrument_identifier.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,tokenId,message
+RemInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7020000000000650987,Success
+RemInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_payment_instrument.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_payment_instrument.csv
new file mode 100644
index 00000000..5ae1ca07
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/delete_payment_instrument.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,tokenId,message
+RemPIns_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,819A93B7ACDBD30EE05340588D0AFBA6,Success
+RemPIns_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_all_payment_instruments.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_all_payment_instruments.csv
new file mode 100644
index 00000000..a7fd8899
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_all_payment_instruments.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,tokenId,message
+RAPIdenGInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7020000000000650987,Success
+RAPIdenGInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_instrument_identifier.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_instrument_identifier.csv
new file mode 100644
index 00000000..dd4516f7
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_instrument_identifier.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,tokenId,message
+RInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7020000000000650987,Success
+RInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_payment_instrument.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_payment_instrument.csv
new file mode 100644
index 00000000..d0a5a79a
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/retrieve_payment_instrument.csv
@@ -0,0 +1,3 @@
+testCaseId,profileId,tokenId,message
+RPIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,819A80F076FCC30BE05340588D0AA493,Success
+RPIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_instrument_identifier.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_instrument_identifier.csv
new file mode 100644
index 00000000..5bc81543
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_instrument_identifier.csv
@@ -0,0 +1,2 @@
+testCaseId,profileId,tokenId,message
+UpdInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7020000000001328765,Success
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_payment_instrument.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_payment_instrument.csv
new file mode 100644
index 00000000..9c3b43a6
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/tms/coreservices/update_payment_instrument.csv
@@ -0,0 +1,2 @@
+testCaseId,profileId,tokenId,message
+UpdPIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,819A80F076F5C30BE05340588D0AA493,Success
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_individual_batch_file.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_individual_batch_file.csv
new file mode 100644
index 00000000..53729aa4
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_individual_batch_file.csv
@@ -0,0 +1,3 @@
+testCaseId,id,message
+GIBF_01,Owcyk6pl,Success
+GIBF_02,CYBS123,Fails due to invalid Id
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_list_of_batch_files.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_list_of_batch_files.csv
new file mode 100644
index 00000000..1129a68d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_batches/coreservices/get_list_of_batch_files.csv
@@ -0,0 +1,4 @@
+testCaseId,startTime,endTime,message
+GLOF_01,2018-10-01T00:00:00.00Z,2018-10-31T23:59:59.59Z,Success
+GLOF_02,2018-10-01T00:00,2018-10-31T23:59:59.59Z,Fails due to invalid startDate.
+GLOF_03,2018-10-01T00:00:00.00Z,2018-10-31T23:59,Fails due to invalid endDate.
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_details/coreservices/retrieve_transaction.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_details/coreservices/retrieve_transaction.csv
new file mode 100644
index 00000000..7ec9d17d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_details/coreservices/retrieve_transaction.csv
@@ -0,0 +1,3 @@
+testCaseId,id,message
+RT_01,5408386919326811103004,Success
+RT_02,1234567898745651235454,Fails due to invalid Id
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/create_search_request.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/create_search_request.csv
new file mode 100644
index 00000000..05cf5eff
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/create_search_request.csv
@@ -0,0 +1,3 @@
+testCaseId,name,query,message
+CrSR_01,TSS search,clientReferenceInformation.code:12345,Success
+CrSR_02,TS Far,clientRefeInfo.code:52565,Fails due to invalid name
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/get_search_results.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/get_search_results.csv
new file mode 100644
index 00000000..5b70758d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/transaction_search/coreservices/get_search_results.csv
@@ -0,0 +1,3 @@
+testCaseId,searchId,message
+GetSR_01,a3e82358-892b-467b-9c38-1049294e1d0b,Success
+GetSR_02,5b0afa1f-0dab-492c-b26d-2f8930e06428,Fails due to invalid searchId
\ No newline at end of file
diff --git a/test/cybersource-rest-qa-python/qa_scripts/csv_files/user_management/coreservices/get_user_information.csv b/test/cybersource-rest-qa-python/qa_scripts/csv_files/user_management/coreservices/get_user_information.csv
new file mode 100644
index 00000000..341589b5
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/csv_files/user_management/coreservices/get_user_information.csv
@@ -0,0 +1,3 @@
+testCaseId,orgIdmessage
+GUI_01,testrest,Success
+GUI_02,testre,Fail due to invalid organizationId
diff --git a/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/generate_key.py b/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/generate_key.py
new file mode 100644
index 00000000..1dcffed2
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/generate_key.py
@@ -0,0 +1,75 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def generate_key():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "flex", "coreservices", "generate_key.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = KeyGenerationApi(details_dict1)
+
+ tcid = row[0]
+ encryptiontype = row[1]
+ message = row[2]
+
+ # key_generation = KeyParameters()
+ key_generation = GeneratePublicKeyRequest(encryption_type=encryptiontype)
+
+ message_body = json.dumps(key_generation.__dict__)
+
+ try:
+ api_response = api_instance.generate_public_key(generate_public_key_request=message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Id
+ if api_response_data['keyId']:
+
+ writer.writerow([tcid, "GenerateKey",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'keyId'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "GenerateKey",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "GenerateKey", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GenerateKey", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['message'], datetime.datetime.now()])
+ # json.loads(e.body)["message"]])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GenerateKey", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ generate_key()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/tokenize_card.py b/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/tokenize_card.py
new file mode 100644
index 00000000..121aa69b
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/flex/coreservices/tokenize_card.py
@@ -0,0 +1,90 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def tokenize_card():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "flex", "coreservices", "tokenize_card.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = FlexTokenApi(details_dict1)
+
+ tcid = row[0]
+ keyid = row[1]
+ message = row[2]
+
+ tokenize_card = TokenizeRequest()
+ card_info = Flexv1tokensCardInfo()
+ tokenize_card.key_id = keyid
+
+ card_info.card_expiration_year = "2031"
+ card_info.card_number = "5555555555554444"
+ card_info.card_type = "002"
+ card_info.card_expiration_month = "03"
+ tokenize_card.card_info = card_info.__dict__
+
+ message_body = json.dumps(tokenize_card.__dict__)
+
+ try:
+ api_response = api_instance.tokenize(tokenize_request=message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,Id
+
+ if not api_response_data['_embedded']['icsReply']['requestId']:
+ writer.writerow([tcid, "TokenizedCard",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.REQUEST_ID_NULL,
+ datetime.datetime.now()])
+
+ else:
+ if api_response_data['keyId'] == keyid:
+
+ writer.writerow([tcid, "TokenizedCard",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'keyId'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "TokenizedCard",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "TokenizedCard", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['reason'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "TokenizedCard", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['reason'], datetime.datetime.now()])
+
+ except Exception as ex:
+
+ writer.writerow([tcid, "TokenizedCard", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ tokenize_card()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/flex/keygeneration_noenc.py b/test/cybersource-rest-qa-python/qa_scripts/flex/keygeneration_noenc.py
new file mode 100644
index 00000000..ea658d40
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/flex/keygeneration_noenc.py
@@ -0,0 +1,75 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def key_generation_no_enc():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "flex", "keygeneration_noenc.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = KeyGenerationApi(details_dict1)
+
+ tcid = row[0]
+ encryption_type = row[1]
+ message = row[2]
+
+ # key_generation = KeyParameters()
+ key_generation = GeneratePublicKeyRequest(encryption_type=encryption_type)
+ message_body = json.dumps(key_generation.__dict__)
+
+ # payment_request = AuthorizeNetRest.PaymentRequest("true", amount_detail, "", payment_instrument, baseaddress_bill_to, baseaddress_ship_to, ip, order, "", "", "", lineitem)
+ try:
+ api_response = api_instance.generate_public_key(generate_public_key_request=message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+
+ if api_response_data['keyId']:
+
+ writer.writerow([tcid, "KeyGenerationNoEnc",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'keyId'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "KeyGenerationNoEnc",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "KeyGenerationNoEnc", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['reason'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "KeyGenerationNoEnc", "Failed:" + str(e.status),
+ json.loads(e.body)['responseStatus']['reason'], datetime.datetime.now()])
+
+ except Exception as ex:
+
+ writer.writerow([tcid, "KeyGenerationNoEnc", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ key_generation_no_enc()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/mainC.py b/test/cybersource-rest-qa-python/qa_scripts/mainC.py
new file mode 100644
index 00000000..33362926
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/mainC.py
@@ -0,0 +1,18 @@
+import csv
+import os
+
+path=os.getcwd()
+with open(os.path.join(os.getcwd(), "qa_scripts","csv_files", "test_report", "testresults.csv"), 'a', newline='') as csvfile: #a in place of w for append
+ writer = csv.writer(csvfile, delimiter=',',quotechar='|', quoting=csv.QUOTE_MINIMAL)
+
+
+with open(os.path.join(os.getcwd(), "qa_scripts","csv_files", "driver", "driver.csv"), newline='') as csvfile: #current folder is MainTestPackage
+ reader=csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ if(row[2]=="1"):
+ fileName=row[1]
+ print("opening the file: ",path+"/"+row[0]+"/"+fileName+".py")
+ exec(open(path+"/"+row[0]+"/"+fileName+".py").read())
+
+
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/__init__.py b/test/cybersource-rest-qa-python/qa_scripts/payments/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/capture_payment.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/capture_payment.py
new file mode 100644
index 00000000..32b6667e
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/capture_payment.py
@@ -0,0 +1,98 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def capture_a_payment():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "capture_payment.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = CaptureApi(details_dict1)
+ tcid = row[0]
+ paymentid = row[1]
+ amount = row[2]
+ message = row[3]
+
+ payment_id = paymentid
+ # Setting the json message body
+ request = CapturePaymentRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_capture"
+ request.client_reference_information = client_reference.__dict__
+
+ amount_details = Ptsv2paymentsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "USD"
+ order_information = Ptsv2paymentsOrderInformation()
+ order_information.amount_details = amount_details.__dict__
+ request.order_information = order_information.__dict__
+
+ message_body = (json.dumps(request.__dict__))
+
+ try:
+
+ api_response = api_instance.capture_payment(message_body, payment_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_PENDING:
+ writer.writerow([tcid, "CapturePayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "CapturePayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['orderInformation']['amountDetails']['totalAmount'] == amount:
+
+ writer.writerow([tcid, "CapturePayment",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "CapturePayment",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "CapturePayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CapturePayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "CapturePayment", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ capture_a_payment()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_authorization_reversal.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_authorization_reversal.py
new file mode 100644
index 00000000..33509450
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_authorization_reversal.py
@@ -0,0 +1,94 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def process_an_authorization_reversal():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices",
+ "process_authorization_reversal.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReversalApi(details_dict1)
+ tcid = row[0]
+ paymentid = row[1]
+ amount = row[2]
+ message = row[3]
+ payment_id = paymentid
+ # Setting the json message body
+ request = AuthReversalRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_reversal"
+ request.client_reference_information = client_reference.__dict__
+
+ reversal_information = Ptsv2paymentsidreversalsReversalInformation()
+ reversal_information.reason = "testing"
+ amount_details = Ptsv2paymentsidreversalsReversalInformationAmountDetails()
+ amount_details.total_amount = amount
+ reversal_information.amount_details = amount_details.__dict__
+ request.reversal_information = reversal_information.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.auth_reversal(payment_id, message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_REVERSE:
+ writer.writerow([tcid, "ProcessAuthorizationReversal",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "ProcessAuthorizationReversal",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['reversalAmountDetails']['reversedAmount'] == amount:
+
+ writer.writerow([tcid, "ProcessAuthorizationReversal",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "ProcessAuthorizationReversal",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "ProcessAuthorizationReversal",
+ "Failed:" + str(e.status), json.loads(e.body)['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "ProcessAuthorizationReversal",
+ "Failed:" + str(e.status), json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "ProcessAuthorizationReversal", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ process_an_authorization_reversal()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_credit.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_credit.py
new file mode 100644
index 00000000..20c504ae
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_credit.py
@@ -0,0 +1,110 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def process_a_credit():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "process_credit.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = CreditApi(details_dict1)
+ tcid = row[0]
+ amount = row[1]
+ message = row[2]
+
+ request = CreateCreditRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_credits"
+ request.client_reference_information = client_reference.__dict__
+
+ order_information = Ptsv2paymentsOrderInformation()
+ amount_details = Ptsv2paymentsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "usd"
+ bill_to = Ptsv2paymentsOrderInformationBillTo()
+ bill_to.country = "US"
+ bill_to.first_name = "John"
+ bill_to.last_name = "Doe"
+ bill_to.address1 = "1 Market St"
+ bill_to.phone_number = "9999999999"
+ bill_to.postal_code = "48104-2201"
+ bill_to.locality = "Ann Arbor"
+ bill_to.administrative_area = "MI"
+ bill_to.email = "test@cybs.com"
+ order_information.amount_details = amount_details.__dict__
+ order_information.bill_to = bill_to.__dict__
+
+ payment_information = Ptsv2paymentsPaymentInformation()
+ card_information = Ptsv2paymentsPaymentInformationCard()
+ card_information.expiration_month = "03"
+ card_information.expiration_year = "2031"
+ card_information.type = "001"
+ card_information.number = "4111111111111111"
+ payment_information.card = card_information.__dict__
+ request.order_information = order_information.__dict__
+ request.payment_information = payment_information.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.create_credit(message_body)
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_PENDING:
+ writer.writerow([tcid, "ProcessCredit",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "ProcessCredit",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['creditAmountDetails']['creditAmount'] == amount:
+
+ writer.writerow([tcid, "ProcessCredit",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "ProcessCredit",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "ProcessCredit", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "ProcessCredit", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "ProcessCredit", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ process_a_credit()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_payment.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_payment.py
new file mode 100644
index 00000000..d8a3fc8e
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/process_payment.py
@@ -0,0 +1,142 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def process_a_payment(flag):
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "process_payment.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentsApi(details_dict1)
+ tcid = row[0]
+ amount = row[1]
+ message = row[2]
+
+ request = CreatePaymentRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_payment"
+ request.client_reference_information = client_reference.__dict__
+
+ processing_info = Ptsv2paymentsProcessingInformation()
+
+ if flag:
+ processing_info.capture = "true"
+
+ request.processing_information = processing_info.__dict__
+
+ aggregator_info = Ptsv2paymentsAggregatorInformation()
+ sub_merchant = Ptsv2paymentsAggregatorInformationSubMerchant()
+ sub_merchant.card_acceptor_id = "1234567890"
+ sub_merchant.country = "US"
+ sub_merchant.phone_number = "650-432-0000"
+ sub_merchant.address1 = "900 Metro Center"
+ sub_merchant.postal_code = "94404-2775"
+ sub_merchant.locality = "Foster City"
+ sub_merchant.name = "Visa Inc"
+ sub_merchant.administrative_area = "CA"
+ sub_merchant.region = "PEN"
+ sub_merchant.email = "test@cybs.com"
+ aggregator_info.sub_merchant = sub_merchant.__dict__
+ aggregator_info.name = "V-Internatio"
+ aggregator_info.aggregator_id = "123456789"
+ request.aggregator_information = aggregator_info.__dict__
+
+ order_information = Ptsv2paymentsOrderInformation()
+ bill_to = Ptsv2paymentsOrderInformationBillTo()
+ bill_to.country = "US"
+ bill_to.last_name = "Doe"
+ bill_to.address2 = "1 Market St"
+ bill_to.address1 = "201 S. Division St."
+ bill_to.postal_code = "48104-2201"
+ bill_to.locality = "Ann Arbor"
+ bill_to.administrative_area = "MI"
+ bill_to.first_name = "John"
+ bill_to.phone_number = "999999999"
+ bill_to.district = "MI"
+ bill_to.building_number = "123"
+ bill_to.company = "Visa"
+ bill_to.email = "test@cybs.com"
+
+ amount_details = Ptsv2paymentsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "USD"
+
+ order_information.bill_to = bill_to.__dict__
+ order_information.amount_details = amount_details.__dict__
+
+ payment_info = Ptsv2paymentsPaymentInformation()
+ card = Ptsv2paymentsPaymentInformationCard()
+ card.expiration_year = "2031"
+ card.number = "5555555555554444"
+ card.security_code = "123"
+ card.expiration_month = "12"
+ card.type = "002"
+ payment_info.card = card.__dict__
+ request.payment_information = payment_info.__dict__
+
+ request.order_information = order_information.__dict__
+
+ message_body = json.dumps(request.__dict__)
+ try:
+ api_response = api_instance.create_payment(message_body)
+ api_response_data = json.loads(api_response.data)
+ if (api_response):
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_AUTHORIZED:
+ writer.writerow([tcid, "ProcessPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "ProcessPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['orderInformation']['amountDetails']['authorizedAmount'] == amount:
+
+ writer.writerow([tcid, "ProcessPayment",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "ProcessPayment",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "ProcessPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "ProcessPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+ writer.writerow([tcid, "ProcessPayment", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ process_a_payment(False)
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_capture.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_capture.py
new file mode 100644
index 00000000..ef17a0fa
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_capture.py
@@ -0,0 +1,93 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def refund_a_capture():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "refund_capture.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = RefundApi(details_dict1)
+ tcid = row[0]
+ captureid = row[1]
+ amount = row[2]
+ message = row[3]
+ capture_id = captureid
+ # Setting the json message body
+ request = RefundCaptureRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference._code = "test_refund_capture"
+ request.client_reference_information = client_reference.__dict__
+
+ order_information = Ptsv2paymentsOrderInformation()
+ amount_details = Ptsv2paymentsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "USD"
+ order_information.amount_details = amount_details.__dict__
+ request.order_information = order_information.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.refund_capture(message_body, capture_id)
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_PENDING:
+ writer.writerow([tcid, "RefundCapture",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "RefundCapture",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['refundAmountDetails']['refundAmount'] == amount:
+
+ writer.writerow([tcid, "RefundCapture",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "RefundCapture",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+ except ApiException as e:
+
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "RefundCapture", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RefundCapture", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RefundCapture", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ refund_a_capture()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_payment.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_payment.py
new file mode 100644
index 00000000..e05b73b8
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/refund_payment.py
@@ -0,0 +1,91 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def refund_a_payment():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "refund_payment.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = RefundApi(details_dict1)
+ tcid = row[0]
+ paymentid = row[1]
+ amount = row[2]
+ message = row[3]
+ payment_id = paymentid
+ # Setting the json message body
+ request = RefundPaymentRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference._code = "test_refund_payment"
+ request.client_reference_information = client_reference.__dict__
+
+ order_information = Ptsv2paymentsOrderInformation()
+ amount_details = Ptsv2paymentsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "USD"
+ order_information.amount_details = amount_details.__dict__
+ request.order_information = order_information.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.refund_payment(message_body, payment_id)
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_PENDING:
+ writer.writerow([tcid, "RefundPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "RefundPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['refundAmountDetails']['refundAmount'] == amount:
+
+ writer.writerow([tcid, "RefundPayment",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "RefundCapture",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "RefundPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RefundPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RefundPayment", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ refund_a_payment()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_capture.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_capture.py
new file mode 100644
index 00000000..43936d66
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_capture.py
@@ -0,0 +1,78 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def void_a_capture():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "void_capture.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = VoidApi(details_dict1)
+ tcid = row[0]
+ captureid = row[1]
+ response_body_status = row[2]
+ message = row[3]
+ capture_id = captureid
+ # Setting the json message body
+ request = VoidCaptureRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_capture_void"
+ request.client_reference_information = client_reference.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.void_capture(message_body, capture_id)
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_VOIDED:
+ writer.writerow([tcid, "VoidCapture",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "VoidCapture",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "VoidCapture",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "VoidCapture", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "VoidCapture", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "VoidACapture", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ void_a_capture()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_credit.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_credit.py
new file mode 100644
index 00000000..a6670518
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_credit.py
@@ -0,0 +1,82 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def void_a_credit():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "void_credit.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = VoidApi(details_dict1)
+ tcid = row[0]
+ creditid = row[1]
+ response_body_status = row[2]
+ message = row[3]
+ credit_id = creditid
+
+ # Setting the json message body
+ request = VoidCreditRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference._code = "test_credit_void"
+ request.client_reference_information = client_reference.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ # payment_request = AuthorizeNetRest.PaymentRequest("true", amount_detail, "", payment_instrument, baseaddress_bill_to, baseaddress_ship_to, ip, order, "", "", "", lineitem)
+ try:
+ api_response = api_instance.void_credit(message_body, credit_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_VOIDED:
+ writer.writerow([tcid, "VoidCredit",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "VoidCredit",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "VoidCredit",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "VoidCredit", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "VoidCredit", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "VoidCredit", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ void_a_credit()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_payment.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_payment.py
new file mode 100644
index 00000000..dc215c41
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_payment.py
@@ -0,0 +1,80 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def void_a_payment():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "void_payment.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = VoidApi(details_dict1)
+ tcid = row[0]
+ paymentid = row[1]
+ response_body_status = row[2]
+ message = row[3]
+ payment_id = paymentid
+ # Setting the json message body
+ request = VoidPaymentRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference.code = "test_payment_void"
+ request.client_reference_information = client_reference.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.void_payment(message_body, payment_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_VOIDED:
+ writer.writerow([tcid, "VoidPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "VoidPayment",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "VoidPayment",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "VoidPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "VoidPayment", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "VoidPayment", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ void_a_payment()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_refund.py b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_refund.py
new file mode 100644
index 00000000..3c0b919a
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payments/coreservices/void_refund.py
@@ -0,0 +1,79 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def void_a_refund():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payments", "coreservices", "void_refund.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = VoidApi(details_dict1)
+ tcid = row[0]
+ refundid = row[1]
+ response_body_status = row[2]
+ message = row[3]
+ refund_id = refundid
+ # Setting the json message body
+ request = VoidRefundRequest()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference._code = "test_refund_void"
+ request.client_reference_information = client_reference.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.void_refund(message_body, refund_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_VOIDED:
+ writer.writerow([tcid, "VoidRefund",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "VoidRefund",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "VoidRefund",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "VoidRefund", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "VoidRefund", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "VoidRefund", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ void_a_refund()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/payouts/coreservices/process_payout.py b/test/cybersource-rest-qa-python/qa_scripts/payouts/coreservices/process_payout.py
new file mode 100644
index 00000000..7fb649d4
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/payouts/coreservices/process_payout.py
@@ -0,0 +1,154 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def process_a_payout():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "payouts", "coreservices", "process_payout.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ProcessAPayoutApi(details_dict1)
+ tcid = row[0]
+
+ client_ref_infocode = row[1]
+ business_appid = row[2]
+ amount = row[3]
+ message = row[4]
+ # Setting the json message body
+ request = PtsV2PayoutsPostResponse()
+ client_reference = Ptsv2paymentsClientReferenceInformation()
+ client_reference._code = client_ref_infocode
+ request.client_reference_information = client_reference.__dict__
+
+ sender_info = Ptsv2payoutsSenderInformation()
+ account_info = Ptsv2payoutsSenderInformationAccount()
+ sender_info.reference_number = "1234567890"
+ sender_info.address1 = "900 Metro Center Blvd.900"
+ sender_info.country_code = "US"
+ sender_info.locality = "Foster City"
+ sender_info.name = "Thomas Jefferson"
+ sender_info.administrative_area = "CA"
+ account_info.funds_source = "05"
+ account_info.number = "1234567890123456789012345678901234"
+ sender_info.account = account_info.__dict__
+ request.sender_information = sender_info.__dict__
+
+ processing_info = Ptsv2payoutsProcessingInformation()
+ processing_info.commerce_indicator = "internet"
+ processing_info.business_application_id = business_appid
+ processing_info.network_routing_order = "ECG"
+
+ payouts_details = Ptsv2payoutsProcessingInformationPayoutsOptions()
+ payouts_details.retrieval_reference_number = "123456789012"
+ payouts_details.acquirer_bin = "567890124"
+ processing_info.reconciliation_id = "1087488702VIAQNSPQ"
+ processing_info.payouts_options = payouts_details.__dict__
+ request.processing_information = processing_info.__dict__
+
+ order_information = Ptsv2payoutsOrderInformation()
+ amount_details = Ptsv2payoutsOrderInformationAmountDetails()
+ amount_details.total_amount = amount
+ amount_details.currency = "USD"
+ order_information.amount_details = amount_details.__dict__
+ request.order_information = order_information.__dict__
+
+ merchant_details = Ptsv2payoutsMerchantInformation()
+ merchant_details.category_code = 123
+ merchant_description = Ptsv2payoutsMerchantInformationMerchantDescriptor()
+ merchant_description.country = "US"
+ merchant_description.postal_code = "94440"
+ merchant_description.locality = "FC"
+ merchant_description.name = "Thomas"
+ merchant_description.administrative_area = "CA"
+ merchant_details.merchant_descriptor = merchant_description.__dict__
+ request.merchant_information = merchant_details.__dict__
+
+ payment_info = Ptsv2payoutsPaymentInformation()
+ card_details = Ptsv2payoutsPaymentInformationCard()
+ card_details.expiration_year = "2025"
+ card_details.number = "4111111111111111"
+ card_details.expiration_month = "12"
+ card_details.type = "001"
+ card_details.source_account_type = "CH"
+ payment_info.card = card_details.__dict__
+ request.payment_information = payment_info.__dict__
+
+ recepient_info = Ptsv2payoutsRecipientInformation()
+ recepient_info.first_name = "John"
+ recepient_info.last_name = "Doe"
+ recepient_info.address1 = "Paseo Padre Boulevard"
+ recepient_info.locality = "Foster City"
+ recepient_info.administrative_area = "CA"
+ recepient_info.postal_code = "94400"
+ recepient_info.phone_number = "6504320556"
+ recepient_info.country = "US"
+ recepient_info.date_of_birth = "19801009"
+ request.recipient_information = recepient_info.__dict__
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.oct_create_payment(message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id,amountDetails
+ if api_response_data['status'] != utility.ConstantUtility.STATUS_ACCEPTED:
+ writer.writerow([tcid, "ProcessPayout",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_AUTHORIZE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "ProcessPayout",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+
+ else:
+ if api_response_data['orderInformation']['amountDetails']['totalAmount'] == amount:
+
+ writer.writerow([tcid, "ProcessPayout",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "ProcessPayout",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "ProcessPayout", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "ProcessPayout", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+ print(ex)
+ writer.writerow([tcid, "ProcessPayout", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ process_a_payout()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_adhoc_report.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_adhoc_report.py
new file mode 100644
index 00000000..1e35bae0
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_adhoc_report.py
@@ -0,0 +1,78 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def create_adhoc_report():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "create_adhoc_report.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportsApi(details_dict1)
+ tcid = row[0]
+ definition_name = row[1]
+ reportname = row[2]
+ starttime = row[3]
+ endtime = row[4]
+ message = row[5]
+
+ # Setting the json message body
+ request = RequestBody1()
+ request.report_definition_name = definition_name
+ request.timezone = "GMT"
+ request.report_mime_type = "application/xml"
+ request.report_name = reportname
+ request.report_start_time = starttime
+ request.report_end_time = endtime
+ request.report_filters = {
+ "Application.Name": []
+ }
+ request.report_preferences = {"signedAmounts": "true", "fieldNameConvention": "SOAPI"}
+ request.report_fields = ["Request.RequestID", "Request.TransactionDate", "Request.MerchantID"]
+ message_body = json.dumps(request.__dict__)
+
+ # payment_request = AuthorizeNetRest.PaymentRequest("true", amount_detail, "", payment_instrument, baseaddress_bill_to, baseaddress_ship_to, ip, order, "", "", "", lineitem)
+ try:
+ api_response = api_instance.create_report(message_body)
+
+ if (api_response):
+ writer.writerow([tcid, "CreateAdhocReport", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "CreateAdhocReport", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CreateAdhocReport", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "CreateAdhocReport", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ create_adhoc_report()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_report_subscription_for_report_name_by_organization.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_report_subscription_for_report_name_by_organization.py
new file mode 100644
index 00000000..4a11b650
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/create_report_subscription_for_report_name_by_organization.py
@@ -0,0 +1,75 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def create_report_subscription():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "create_report_subscription_for_report_name_by_organization.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportSubscriptionsApi(details_dict1)
+ tcid = row[0]
+ definition_name = row[1]
+ reportname = row[2]
+ message = row[4]
+ # Setting the json message body
+ request = RequestBody(report_definition_name=definition_name,
+ report_fields=["Request.RequestID", "Request.TransactionDate",
+ "Request.MerchantID"], report_name=reportname)
+
+ request.report_fields = ["Request.RequestID", "Request.TransactionDate", "Request.MerchantID"]
+ request.report_mime_type = "application/xml"
+ request.report_frequency = "WEEKLY"
+ request.timezone = "GMT"
+ request.start_time = "0825"
+ request.start_day = 1
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ api_response = api_instance.create_subscription(message_body, report_name=request.report_name)
+
+ if (api_response):
+ writer.writerow([tcid, "CreateReportSubscriptionForReportNameByOrganization",
+ "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "CreateReportSubscriptionForReportNameByOrganization", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CreateReportSubscriptionForReportNameByOrganization", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow(
+ [tcid, "CreateReportSubscriptionForReportNameByOrganization", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ create_report_subscription()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/delete_subscription_of_report_name_by_organization.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/delete_subscription_of_report_name_by_organization.py
new file mode 100644
index 00000000..7b04fdd1
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/delete_subscription_of_report_name_by_organization.py
@@ -0,0 +1,62 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def delete_subscriptions_report():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "delete_subscription_of_report_name_by_organization.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportSubscriptionsApi(details_dict1)
+ tcid = row[0]
+ report_name = row[1]
+ message = row[2]
+
+ try:
+ api_response = api_instance.delete_subscription(report_name)
+
+ if (api_response):
+ writer.writerow(
+ [tcid, "DeleteSubscriptionOfReportNameByOrganization", "Passed:" + str(api_response.status),
+ message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "DeleteSubscriptionOfReportNameByOrganization", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "DeleteSubscriptionOfReportNameByOrganization", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "DeleteSubscriptionOfReportNameByOrganization", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ delete_subscriptions_report()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/download_report.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/download_report.py
new file mode 100644
index 00000000..0095ef08
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/download_report.py
@@ -0,0 +1,77 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def download_reports():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices", "download_report.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportDownloadsApi(details_dict1)
+ tcid = row[0]
+ orgid = row[1]
+ report_name = row[2]
+ report_date = row[3]
+ message = row[4]
+
+ try:
+ api_response = api_instance.download_report(report_date, report_name, organization_id=orgid)
+
+ if (api_response):
+
+ if api_response.data:
+
+ writer.writerow(
+ [tcid, "DownloadReport", "Passed:" + str(api_response.status) + "-" + orgid + " ",
+ message
+
+ , datetime.datetime.now()])
+ # The Report obtained is being stored in a CSV file
+ f = open(os.path.join(os.getcwd(), "resources", "download_report.csv"), "a+")
+ f.write("\n********************** Start Of Report***********************\n")
+ f.write(api_response.data)
+ f.write("\n********************** End Of Report*************************\n")
+ f.close()
+ print("File Downloaded at the Location : " + os.path.join(os.getcwd(), "resources",
+ "download_report.csv"))
+ else:
+ writer.writerow([tcid, "DownloadReport",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.EMPTY_CONTENT,
+ datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "DownloadReport", "Failed:" + str(e.status), message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "DownloadReport", "Failed:" + str(e.status), message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "DownloadReport", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ download_reports()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_all_subscriptions.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_all_subscriptions.py
new file mode 100644
index 00000000..a74b57b9
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_all_subscriptions.py
@@ -0,0 +1,58 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_all_subscriptions():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_all_subscriptions.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportSubscriptionsApi(details_dict1)
+ tcid = row[0]
+ message = row[1]
+
+ try:
+ api_response = api_instance.get_all_subscriptions()
+
+ if (api_response):
+ writer.writerow([tcid, "GetAllSubscriptions", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetAllSubscriptions", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetAllSubscriptions", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetAllSubscriptions", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_all_subscriptions()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_notification_of_changes.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_notification_of_changes.py
new file mode 100644
index 00000000..39a7f2af
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_notification_of_changes.py
@@ -0,0 +1,61 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def notification_of_changes():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_notification_of_changes.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = NotificationOfChangesApi(details_dict1)
+ tcid = row[0]
+ start_time = row[1]
+ end_time = row[2]
+ message = row[3]
+
+ try:
+ api_response = api_instance.get_notification_of_change_report(start_time, end_time)
+
+ if (api_response):
+ writer.writerow([tcid, "GetNotificationOfChanges", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetNotificationOfChanges", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetNotificationOfChanges", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetNotificationOfChanges", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ notification_of_changes()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_purchase_and_refund_details.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_purchase_and_refund_details.py
new file mode 100644
index 00000000..339ed369
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_purchase_and_refund_details.py
@@ -0,0 +1,63 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def purchase_and_refund():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_purchase_and_refund_details.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PurchaseAndRefundDetailsApi(details_dict1)
+ tcid = row[0]
+ start_time = row[1]
+ end_time = row[2]
+ message = row[4]
+
+ try:
+ api_response = api_instance.get_purchase_and_refund_details(start_time, end_time)
+
+ if (api_response):
+ writer.writerow(
+ [tcid, "GetPurchaseAndRefundDetails", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetPurchaseAndRefundDetails", "Failed:" + str(e.status),
+ json.loads(e.body)['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetPurchaseAndRefundDetails", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetPurchaseAndRefundDetails", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ purchase_and_refund()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_based_on_reportid.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_based_on_reportid.py
new file mode 100644
index 00000000..658acf40
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_based_on_reportid.py
@@ -0,0 +1,70 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_report_by_reportid():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_report_based_on_reportid.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportsApi(details_dict1)
+ tcid = row[0]
+ orgid = row[1]
+ report_id = row[2]
+ message = row[3]
+ try:
+ api_response = api_instance.get_report_by_report_id(report_id, organization_id=orgid)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # QA modification
+ if api_response_data["reportId"] == report_id:
+ # QA modification
+ writer.writerow([tcid, "GetReportBasedOnReportId",
+ "Passed:" + str(api_response.status) + ":" + api_response_data["reportId"]
+
+ , message, datetime.datetime.now()])
+ # print(amount)
+ else:
+ writer.writerow(
+ [tcid, "GetReportBasedOnReportId", "Assertion Failed: " + str(api_response.status),
+ message, datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetReportBasedOnReportId", "Failed:" + str(e.status), message,
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetReportBasedOnReportId", "Failed:" + str(e.status), message,
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetReportBasedOnReportId", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_report_by_reportid()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_definition.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_definition.py
new file mode 100644
index 00000000..55ce8922
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_report_definition.py
@@ -0,0 +1,66 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_report_definitions():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_report_definition.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportDefinitionsApi(details_dict1)
+ tcid = row[0]
+ report_definition_name = row[1]
+ message = row[2]
+ try:
+ api_response = api_instance.get_resource_info_by_report_definition(report_definition_name)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # QA modification
+ if api_response_data["reportDefintionName"] == report_definition_name:
+ # QA modification
+ writer.writerow([tcid, "GetReportDefinition", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+ # print(amount)
+ else:
+ writer.writerow(
+ [tcid, "GetReportDefinition", "Assertion Failed: " + str(api_response.status),
+ datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetReportDefinition", "Failed:" + str(e.status), message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetReportDefinition", "Failed:" + str(e.status)
+ , message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetReportDefinition", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_report_definitions()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_reporting_resource_information.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_reporting_resource_information.py
new file mode 100644
index 00000000..61787355
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_reporting_resource_information.py
@@ -0,0 +1,60 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_reporting_resource_information():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_reporting_resource_information.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportDefinitionsApi(details_dict1)
+ tcid = row[0]
+ orgid = row[1]
+ message = row[2]
+ try:
+ api_response = api_instance.get_resource_v2_info(organization_id=orgid)
+
+ if (api_response):
+ writer.writerow(
+ [tcid, "GetReportingResourceInformation", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetReportingResourceInformation", "Failed:" + str(e.status), e.body,
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetReportingResourceInformation", "Failed:" + str(e.status)
+ , (e.body), datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetReportingResourceInformation", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_reporting_resource_information()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_subscription_for_report_name.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_subscription_for_report_name.py
new file mode 100644
index 00000000..4f049238
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/get_subscription_for_report_name.py
@@ -0,0 +1,70 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_subscriptions_by_name():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "get_subscription_for_report_name.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportSubscriptionsApi(details_dict1)
+ tcid = row[0]
+ report_name = row[1]
+ message = row[2]
+
+ try:
+ api_response = api_instance.get_subscription(report_name)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # QA modification
+ if api_response_data['reportName'] == report_name:
+ # QA modification
+ writer.writerow(
+ [tcid, "GetSubscriptionForReportName", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+ # print(amount)
+ else:
+ writer.writerow(
+ [tcid, "GetSubscriptionForReportName", "Assertion Failed: " + str(api_response.status),
+ message, datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetSubscriptionForReportName", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetSubscriptionForReportName", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetSubscriptionForReportName", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_subscriptions_by_name()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/retrieve_available_reports.py b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/retrieve_available_reports.py
new file mode 100644
index 00000000..c9b0b676
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/reporting/coreservices/retrieve_available_reports.py
@@ -0,0 +1,64 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def available_reports():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "reporting", "coreservices",
+ "retrieve_available_reports.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = ReportsApi(details_dict1)
+ tcid = row[0]
+ start_time = row[1]
+ end_time = row[2]
+ time_query_type = row[3]
+ message = row[4]
+
+ try:
+ api_response = api_instance.search_reports(start_time, end_time, time_query_type)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+
+ writer.writerow([tcid, "RetrieveAvailableReports", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "RetrieveAvailableReports", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RetrieveAvailableReports", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'] + ":" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RetrieveAvailableReports", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ available_reports()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/download_file_with_file_identifier.py b/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/download_file_with_file_identifier.py
new file mode 100644
index 00000000..5736418c
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/download_file_with_file_identifier.py
@@ -0,0 +1,75 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def download_file_with_file_identifier():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "secure_file_share", "coreservices",
+ "download_file_with_file_identifier.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = SecureFileShareApi(details_dict1)
+ tcid = row[0]
+ org_id = row[1]
+ field_id = row[2]
+ message = row[3]
+ try:
+ api_response = api_instance.get_file(field_id, organization_id=org_id)
+
+ if (api_response):
+ if api_response.data:
+
+ writer.writerow([tcid, "DownloadFileWithFileIdentifier",
+ "Passed:" + str(api_response.status) + "-" + field_id + " "
+
+ , message, datetime.datetime.now()])
+ # The Report obtained is being stored in a CSV file
+ f = open(os.path.join(os.getcwd(), "resources", "fileshare_report.csv"), "a+")
+ f.write("\n********************** Start Of Report***********************\n")
+ f.write(api_response.data)
+ f.write("\n********************** End Of Report*************************\n")
+ f.close()
+ print("File Downloaded at the Location : " + os.path.join(os.getcwd(), "resources",
+ "fileshare_report.csv"))
+ else:
+ writer.writerow([tcid, "DownloadFileWithFileIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.EMPTY_CONTENT,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "DownloadFileWithFileIdentifier", "Failed:" + str(e.status), message,
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "DownloadFileWithFileIdentifier", "Failed:" + str(e.status)
+ , message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "DownloadFileWithFileIdentifier", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ download_file_with_file_identifier()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/get_list_of_files.py b/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/get_list_of_files.py
new file mode 100644
index 00000000..53dd48bc
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/secure_file_share/coreservices/get_list_of_files.py
@@ -0,0 +1,62 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_list_of_files():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "secure_file_share", "coreservices",
+ "get_list_of_files.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = SecureFileShareApi(details_dict1)
+ tcid = row[0]
+ org_id = row[1]
+ start_date = row[2]
+ end_date = row[3]
+ message = row[4]
+ try:
+ api_response = api_instance.get_file_details(start_date, end_date,
+ organization_id=org_id)
+
+ if (api_response):
+ writer.writerow([tcid, "GetListOfFiles",
+ "Passed:" + str(api_response.status) + "-" + org_id + " "
+
+ , message, datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetListOfFiles", "Failed:" + str(e.status), e.body, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetListOfFiles", "Failed:" + str(e.status)
+ , e.body, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetListOfFiles", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_list_of_files()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_instrument_identifier.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_instrument_identifier.py
new file mode 100644
index 00000000..40cb96ab
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_instrument_identifier.py
@@ -0,0 +1,108 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def create_instrument_identifier():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "create_instrument_identifier.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = InstrumentIdentifiersApi(details_dict1)
+
+ tcid = row[0]
+ prev_transaction_id = row[1]
+ profile_id = row[2]
+ message = row[3]
+
+ # Setting the json message body
+ request = Body()
+ card_info = Tmsv1instrumentidentifiersCard()
+ card_info.number = "123456789098765"
+ request.card = card_info.__dict__
+
+ processing_info = Tmsv1instrumentidentifiersProcessingInformation()
+ authorize_options_info = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptions()
+ initiator = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiator()
+ merchant_initiated_info = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction()
+ merchant_initiated_info.previous_transaction_id = prev_transaction_id
+ initiator.merchant_initiated_transaction = merchant_initiated_info.__dict__
+ authorize_options_info.initiator = initiator.__dict__
+ processing_info.authorization_options = authorize_options_info.__dict__
+ request.processing_information = processing_info.__dict__
+
+ message_body = json.dumps(request.__dict__)
+
+ # payment_request = AuthorizeNetRest.PaymentRequest("true", amount_detail, "", payment_instrument, baseaddress_bill_to, baseaddress_ship_to, ip, order, "", "", "", lineitem)
+ try:
+ api_response = api_instance.tms_v1_instrumentidentifiers_post(
+ profile_id, body=message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,id
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "CreateInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "CreateInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ if api_response_data['processingInformation']['authorizationOptions'][
+ 'initiator']['merchantInitiatedTransaction'][
+ 'previousTransactionId'] == prev_transaction_id:
+ # QA modification
+ writer.writerow([tcid, "CreateInstrumentIdentifier",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'], message
+
+ , datetime.datetime.now()])
+
+ else:
+ writer.writerow(
+ [tcid,
+ "CreateInstrumentIdentifier", "Assertion Failed: " + str(api_response.status),
+ message,
+
+ datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "CreateInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CreateInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+
+ except Exception as ex:
+
+ writer.writerow([tcid, "CreateInstrumentIdentifier", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ create_instrument_identifier()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_payment_instrument.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_payment_instrument.py
new file mode 100644
index 00000000..b80c8775
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/create_payment_instrument.py
@@ -0,0 +1,106 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def create_payment_instrument():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "create_payment_instrument.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentInstrumentsApi(details_dict1)
+
+ tcid = row[0]
+ profile_id = row[1]
+ message=row[2]
+
+ # Setting the json message body
+ request = Body2()
+ card_info = Tmsv1paymentinstrumentsCard()
+ card_info.expiration_month = "09"
+ card_info.expiration_year = "2022"
+ card_info.type = "visa"
+ request.card = card_info.__dict__
+
+ bill_to_info = Tmsv1paymentinstrumentsBillTo()
+ bill_to_info.first_name = "John"
+ bill_to_info.last_name = "Deo"
+ bill_to_info.company = "CyberSource"
+ bill_to_info.address1 = "12 Main Street"
+ bill_to_info.address2 = "20 My Street"
+ bill_to_info.locality = "Foster City"
+ bill_to_info.administrative_area = "CA"
+ bill_to_info.postal_code = "90200"
+ bill_to_info.country = "US"
+ bill_to_info.email = "john.smith@example.com"
+ bill_to_info.phone_number = "555123456"
+ request.bill_to = bill_to_info.__dict__
+
+ instument_identifier = Tmsv1paymentinstrumentsInstrumentIdentifier()
+ card_info = Tmsv1instrumentidentifiersCard()
+ card_info.number = "4111111111111111"
+ instument_identifier.card = card_info.__dict__
+ request.instrument_identifier = instument_identifier.__dict__
+
+ message_body = json.dumps(request.__dict__)
+
+
+ try:
+ api_response = api_instance.tms_v1_paymentinstruments_post(
+ profile_id, message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "CreatePaymentsInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (api_response_data['id']):
+ writer.writerow([tcid, "CreatePaymentsInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_NULL_ID,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "CreatePaymentsInstrument",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] ,message
+
+ , datetime.datetime.now()])
+
+
+ except ApiException as e:
+
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "CreatePaymentsInstrument",
+ "Failed:" + str(e.status) , json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CreatePaymentsInstrument",
+ "Failed:" + str(e.status), json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "CreatePaymentsInstrument", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ create_payment_instrument()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_instrument_identifier.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_instrument_identifier.py
new file mode 100644
index 00000000..2402df4b
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_instrument_identifier.py
@@ -0,0 +1,58 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+import datetime
+
+
+def remove_instrument_identifier():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "delete_instrument_identifier.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = InstrumentIdentifierApi(details_dict1)
+ tcid = row[0]
+ profile_id = row[1]
+ id = row[2]
+ message = row[3]
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_instrumentidentifiers_token_id_delete(
+ profile_id, id)
+
+ if (api_response):
+ writer.writerow(
+ [tcid, "DeleteInstrumentIdentifier", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "DeleteInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "DeleteInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "DeleteInstrumentIdentifier", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ remove_instrument_identifier()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_payment_instrument.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_payment_instrument.py
new file mode 100644
index 00000000..7e80915f
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/delete_payment_instrument.py
@@ -0,0 +1,57 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+import datetime
+
+
+def remove_payment_istrument():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "delete_payment_instrument.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentInstrumentsApi(details_dict1)
+ tcid = row[0]
+ profile_id = row[1]
+ id = row[2]
+ message = row[3]
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_paymentinstruments_token_id_delete(
+ profile_id, id)
+
+ if (api_response):
+ writer.writerow([tcid, "DeletePaymentInstrument", "Passed:" + str(api_response.status), message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "DeletePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "DeletePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "DeletePaymentInstrument", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ remove_payment_istrument()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_all_payment_instruments.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_all_payment_instruments.py
new file mode 100644
index 00000000..29e08000
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_all_payment_instruments.py
@@ -0,0 +1,69 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def retrieve_all_paymentsidentifiers():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "retrieve_all_payment_instruments.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentInstrumentsApi(details_dict1)
+ tcid = row[0]
+ profile_id = row[1]
+ id = row[2]
+ message = row[3]
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_instrumentidentifiers_token_id_paymentinstruments_get(
+ profile_id, id)
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+
+ if not (row[2]) in api_response_data["_links"]["self"]["href"]:
+
+ writer.writerow([tcid, "RetrieveAllPaymentIdentifiers",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.TOKEN_ID_MISMATCH,
+ datetime.datetime.now()])
+ else:
+
+ writer.writerow([tcid, "RetrieveAllPaymentIdentifiers",
+ "Passed:" + str(api_response.status) + "-" + id, message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row);
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "RetrieveAllPaymentIdentifiers", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RetrieveAllPaymentIdentifiers", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RetrieveAllPaymentIdentifiers", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ retrieve_all_paymentsidentifiers()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_instrument_identifier.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_instrument_identifier.py
new file mode 100644
index 00000000..dcbe58d2
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_instrument_identifier.py
@@ -0,0 +1,73 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def retrieve_instrument_identifier():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "retrieve_instrument_identifier.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = InstrumentIdentifierApi(details_dict1)
+ tcid = row[0]
+ profile_id = row[1]
+ id = row[2]
+ message = row[3]
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_instrumentidentifiers_token_id_get(
+ profile_id, id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "RetrieveInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (row[2]) in api_response_data["_links"]["self"]["href"]:
+
+ writer.writerow([tcid, "RetrieveInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.TOKEN_ID_MISMATCH,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "RetrieveInstrumentIdentifier",
+ "Passed:" + str(api_response.status) + "-" + id, message
+
+ , datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row);
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "RetrieveInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RetrieveInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RetrieveInstrumentIdentifier", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ retrieve_instrument_identifier()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_payment_instrument.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_payment_instrument.py
new file mode 100644
index 00000000..c70b0aee
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/retrieve_payment_instrument.py
@@ -0,0 +1,72 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def retrieve_payment_instrument():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "retrieve_payment_instrument.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentInstrumentsApi(details_dict1)
+ tcid = row[0]
+ profile_id = row[1]
+ id = row[2]
+ message = row[3]
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_paymentinstruments_token_id_get(
+ profile_id, id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "RetrievePaymentInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (row[2]) in api_response_data["_links"]["self"]["href"]:
+
+ writer.writerow([tcid, "RetrievePaymentInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.TOKEN_ID_MISMATCH,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "RetrievePaymentInstrument",
+ "Passed:" + str(api_response.status) + "-" + id, message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row);
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "RetrievePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RetrievePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RetrievePaymentInstrument", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ retrieve_payment_instrument()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_instrument_identifier.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_instrument_identifier.py
new file mode 100644
index 00000000..5402f96d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_instrument_identifier.py
@@ -0,0 +1,89 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def update_instrument_identifier():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "update_instrument_identifier.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = InstrumentIdentifierApi(details_dict1)
+ tcid = row[0]
+ profileid = row[1]
+ tokenid = row[2]
+ message = row[3]
+ # Setting the json message body
+ request = Body1()
+ processing_info = Tmsv1instrumentidentifiersProcessingInformation()
+ authorize_options_info = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptions()
+ initiator = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiator()
+ merchant_initiated_info = Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction()
+
+ merchant_initiated_info.previous_transaction_id = "123456789012345"
+ initiator.merchant_initiated_transaction = merchant_initiated_info.__dict__
+ authorize_options_info.initiator = initiator.__dict__
+ processing_info.authorization_options = authorize_options_info.__dict__
+ request.processing_information = processing_info.__dict__
+
+ message_body = json.dumps(request.__dict__)
+
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_instrumentidentifiers_token_id_patch(
+ profileid, tokenid, body=message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "UpdateInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (row[2]) in api_response_data["_links"]["self"]["href"]:
+
+ writer.writerow([tcid, "UpdateInstrumentIdentifier",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.TOKEN_ID_MISMATCH,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "UpdateInstrumentIdentifier",
+ "Passed:" + str(api_response.status) + "-" + api_response_data['id'],
+ message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row);
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "UpdateInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "UpdateInstrumentIdentifier", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "UpdateInstrumentIdentifier", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ update_instrument_identifier()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_payment_instrument.py b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_payment_instrument.py
new file mode 100644
index 00000000..f5491f84
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/tms/coreservices/update_payment_instrument.py
@@ -0,0 +1,106 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def update_payment_instrument():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "tms", "coreservices",
+ "update_payment_instrument.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ # Reading Merchant details from Configuration file
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = PaymentInstrumentsApi(details_dict1)
+ tcid = row[0]
+ profileid = row[1]
+ tokenid = row[2]
+ message = row[3]
+
+ request = Body3()
+ card_info = Tmsv1paymentinstrumentsCard()
+ card_info.expiration_month = "09"
+ card_info.expiration_year = "2022"
+ card_info.type = "visa"
+ request.card = card_info.__dict__
+
+ bill_to_info = Tmsv1paymentinstrumentsBillTo()
+ bill_to_info.first_name = "John"
+ bill_to_info.last_name = "Deo"
+ bill_to_info.company = "CyberSource"
+ bill_to_info.address1 = "12 Main Street"
+ bill_to_info.address2 = "20 My Street"
+ bill_to_info.locality = "Foster City"
+ bill_to_info.administrative_area = "CA"
+ bill_to_info.postal_code = "90200"
+ bill_to_info.country = "US"
+ bill_to_info.email = "john.smith@example.com"
+ bill_to_info.phone_number = "555123456"
+ request.bill_to = bill_to_info.__dict__
+
+ instument_identifier = Tmsv1paymentinstrumentsInstrumentIdentifier()
+
+ card_info = Tmsv1instrumentidentifiersCard()
+ card_info.number = "4111111111111111"
+ instument_identifier.card = card_info.__dict__
+ request.instrument_identifier = instument_identifier.__dict__
+
+ message_body = json.dumps(request.__dict__)
+ try:
+ # Create A Customer Address
+ api_response = api_instance.tms_v1_paymentinstruments_token_id_patch(profileid
+ , tokenid, message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ if api_response_data['state'] != utility.ConstantUtility.STATUS_ACTIVE:
+ writer.writerow([tcid, "UpdatePaymentInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.MESSAGE_ACTIVE, datetime.datetime.now()])
+ elif not (row[2]) in api_response_data["_links"]["self"]["href"]:
+
+ writer.writerow([tcid, "UpdatePaymentInstrument",
+ "Assertion Failed: " + str(api_response.status),
+ utility.ConstantUtility.TOKEN_ID_MISMATCH,
+ datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "UpdatePaymentInstrument",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'], message
+
+ , datetime.datetime.now()])
+ except ApiException as e:
+ print("Connection exception:")
+ print("Exception when calling tmsAPI->UpdatePaymentInstrument: %s\n" % e)
+ size = len(row);
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+ writer.writerow(
+ [tcid, "UpdatePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "UpdatePaymentInstrument", "Failed:" + str(e.status),
+ json.loads(e.body)['errors'][0]['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "UpdatePaymentInstrument", ex, datetime.datetime.now()]);
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ update_payment_instrument()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_individual_batch_file.py b/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_individual_batch_file.py
new file mode 100644
index 00000000..aabb14f0
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_individual_batch_file.py
@@ -0,0 +1,68 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_individual_batch_file():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "transaction_batches", "coreservices",
+ "get_individual_batch_file.csv"),
+ newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = TransactionBatchApi(details_dict1)
+ tcid = row[0]
+ file_id = row[1]
+ message = row[2]
+ batch_file_id = file_id
+ try:
+ api_response = api_instance.pts_v1_transaction_batches_id_get(batch_file_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for id
+ if api_response_data['id'] == file_id:
+
+ writer.writerow([tcid, "GetIndividualBatchFile",
+ "Passed:" + str(api_response.status) + "-" + file_id + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "GetIndividualBatchFile",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetIndividualBatchFile", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetIndividualBatchFile", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetIndividualBatchFile", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_individual_batch_file()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_list_of_batch_files.py b/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_list_of_batch_files.py
new file mode 100644
index 00000000..c322fc56
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/transaction_batches/coreservices/get_list_of_batch_files.py
@@ -0,0 +1,62 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_list_of_batch_files():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "transaction_batches", "coreservices",
+ "get_list_of_batch_files.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = TransactionBatchesApi(details_dict1)
+ tcid = row[0]
+ start_time = row[1]
+ end_time = row[2]
+ message = row[3]
+
+ try:
+ api_response = api_instance.pts_v1_transaction_batches_get(start_time, end_time)
+
+ if (api_response):
+ writer.writerow([tcid, "GetListOfBatchFile",
+ "Passed:" + str(api_response.status)
+
+ , message, datetime.datetime.now()])
+
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetListOfBatchFile", "Failed:" + str(e.status),
+ json.loads(e.body)['message'] + "-" + message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetListOfBatchFile", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'] + "-" + message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetListOfBatchFile", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_list_of_batch_files()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/transaction_details/coreservices/retrieve_transaction.py b/test/cybersource-rest-qa-python/qa_scripts/transaction_details/coreservices/retrieve_transaction.py
new file mode 100644
index 00000000..6f4e958d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/transaction_details/coreservices/retrieve_transaction.py
@@ -0,0 +1,69 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def retrieve_transaction():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "transaction_details", "coreservices",
+ "retrieve_transaction.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = TransactionDetailsApi(details_dict1)
+ tcid = row[0]
+ transaction_id = row[1]
+ message = row[2]
+ retrieve_transaction_id = transaction_id
+ try:
+ api_response = api_instance.get_transaction(retrieve_transaction_id)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,Id
+
+ if api_response_data['id'] == transaction_id:
+
+ writer.writerow([tcid, "RetrieveTransaction",
+ "Passed:" + str(api_response.status) + "-" + api_response_data[
+ 'id'] + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "RetrieveTransaction",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "RetrieveTransaction", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "RetrieveTransaction", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "RetrieveTransaction", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ retrieve_transaction()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/create_search_request.py b/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/create_search_request.py
new file mode 100644
index 00000000..3900a498
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/create_search_request.py
@@ -0,0 +1,80 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def create_search_request():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "transaction_search", "coreservices",
+ "create_search_request.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = SearchTransactionsApi(details_dict1)
+ tcid = row[0]
+ request_name = row[1]
+ request_query = row[2]
+ message = row[3]
+
+ # Setting the json message body
+ create_search_request = TssV2TransactionsPostResponse()
+ create_search_request.save = "false"
+ create_search_request.name = request_name
+ create_search_request.timezone = "America/Chicago"
+ create_search_request.query = request_query
+ create_search_request.offset = 0
+ create_search_request.limit = 100
+ create_search_request.sort = "id:asc, submitTimeUtc:asc"
+ message_body = json.dumps(create_search_request.__dict__)
+
+ try:
+ api_response = api_instance.create_search(message_body)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,name#which id
+
+ if api_response_data['name'] == request_name:
+
+ writer.writerow([tcid, "CreateSearchRequest",
+ "Passed:" + str(api_response.status)
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "CreateSearchRequest",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "CreateSearchRequest", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "CreateSearchRequest", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "CreateSearchRequest", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ create_search_request()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/get_search_results.py b/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/get_search_results.py
new file mode 100644
index 00000000..06f013a8
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/transaction_search/coreservices/get_search_results.py
@@ -0,0 +1,67 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_search_results():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "transaction_search", "coreservices",
+ "get_search_results.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = SearchTransactionsApi(details_dict1)
+ tcid = row[0]
+ input_id = row[1]
+ message = row[2]
+ id_input = input_id
+ try:
+ api_response = api_instance.get_search(id_input)
+
+ if (api_response):
+ api_response_data = json.loads(api_response.data)
+
+ if api_response_data['searchId'] == input_id:
+
+ writer.writerow([tcid, "GetSearchResults",
+ "Passed:" + str(api_response.status) + "-" + input_id + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "GetSearchResults",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetSearchResults", "Failed:" + str(e.status), json.loads(e.body)['message'],
+ datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetSearchResults", "Failed:" + str(e.status)
+ , json.loads(e.body)['message'], datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetSearchResults", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_search_results()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/user_management/coreservices/get_user_information.py b/test/cybersource-rest-qa-python/qa_scripts/user_management/coreservices/get_user_information.py
new file mode 100644
index 00000000..04c72c21
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/user_management/coreservices/get_user_information.py
@@ -0,0 +1,69 @@
+from __future__ import print_function
+import os
+import sys
+import csv
+from CyberSource import *
+from CyberSource.rest import ApiException
+import json
+from importlib.machinery import SourceFileLoader
+
+config_file = os.path.join(os.getcwd(), "data", "input_configuration.py")
+configuration = SourceFileLoader("module.name", config_file).load_module()
+util_file = os.path.join(os.getcwd(), "qa_scripts", "utility", "constant_utility.py")
+utility = SourceFileLoader("module.name", util_file).load_module()
+import datetime
+
+
+def get_user_information():
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "user_management", "coreservices",
+ "get_user_information.csv"), newline='') as csvfile: # current folder is MainTestPackage
+ reader = csv.reader(csvfile, delimiter=',', quotechar='|')
+ next(reader)
+ for row in reader:
+
+ with open(os.path.join(os.getcwd(), "qa_scripts", "csv_files", "test_report", "testresults.csv"), 'a',
+ newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
+ config_obj = configuration.InputConfiguration()
+ details_dict1 = config_obj.get_configuration()
+ api_instance = UserManagementApi(details_dict1)
+ tcid = row[0]
+ org_id = row[1]
+ message = row[2]
+
+ try:
+ api_response = api_instance.get_users(organization_id=org_id)
+
+ if (api_response):
+
+ api_response_data = json.loads(api_response.data)
+ # Assertion statements for Status,orgId
+
+ if api_response_data["users"][0]['organizationInformation']['organizationId'] == org_id:
+
+ writer.writerow([tcid, "GetUserInformation",
+ "Passed:" + str(api_response.status) + "-" + org_id + " "
+
+ , message, datetime.datetime.now()])
+ else:
+ writer.writerow([tcid, "GetUserInformation",
+ "Assertion Failed: " + str(api_response.status), message,
+ datetime.datetime.now()])
+
+ except ApiException as e:
+ size = len(row)
+ if (row[size - 1] == "Negative" and str(e.status) == '400'):
+
+ writer.writerow(
+ [tcid, "GetUserInformation", "Failed:" + str(e.status), message, datetime.datetime.now()])
+ else:
+ writer.writerow(
+ [tcid, "GetUserInformation", "Failed:" + str(e.status)
+ , message, datetime.datetime.now()])
+ except Exception as ex:
+
+ writer.writerow([tcid, "GetUserInformation", ex, datetime.datetime.now()])
+
+
+if (os.path.basename(__file__) == os.path.basename(sys.argv[0])):
+ get_user_information()
diff --git a/test/cybersource-rest-qa-python/qa_scripts/utility/__init__.py b/test/cybersource-rest-qa-python/qa_scripts/utility/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/cybersource-rest-qa-python/qa_scripts/utility/constant_utility.py b/test/cybersource-rest-qa-python/qa_scripts/utility/constant_utility.py
new file mode 100644
index 00000000..73644d10
--- /dev/null
+++ b/test/cybersource-rest-qa-python/qa_scripts/utility/constant_utility.py
@@ -0,0 +1,14 @@
+class ConstantUtility:
+ STATUS_AUTHORIZED = "AUTHORIZED"
+ MESSAGE_NULL_ID = "Assertion Failed since Payment ID is null"
+ MESSAGE_AUTHORIZE = "Assertion Failed since Status is UNAUTHORIZED"
+ STATUS_VOIDED = "VOIDED"
+ STATUS_PENDING="PENDING"
+ STATUS_REVERSE="REVERSED"
+ STATUS_ACCEPTED="ACCEPTED"
+ STATUS_ACTIVE="ACTIVE"
+ EMPTY_CONTENT="Assertion Failed as no data received"
+ REQUEST_ID_NULL="Assertion Failed as requestId is None"
+ MESSAGE_ACTIVE="Message Failed as status is Inactive"
+ TOKEN_ID_MISMATCH="Assertion Failed due to tokenId Mismatch"
+
diff --git a/test/cybersource-rest-qa-python/resources/__init__.py b/test/cybersource-rest-qa-python/resources/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/cybersource-rest-qa-python/resources/testrest.p12 b/test/cybersource-rest-qa-python/resources/testrest.p12
new file mode 100644
index 00000000..3d09e550
Binary files /dev/null and b/test/cybersource-rest-qa-python/resources/testrest.p12 differ
diff --git a/test/cybersource-rest-qa-python/resources/trr_report.json b/test/cybersource-rest-qa-python/resources/trr_report.json
new file mode 100644
index 00000000..5b6f4a2d
--- /dev/null
+++ b/test/cybersource-rest-qa-python/resources/trr_report.json
@@ -0,0 +1,12 @@
+{
+ "startDay":"23",
+ "timeZone":"America/Chicago",
+ "reportDefinitionName":"TransactionRequestClass",
+ "startTime":"1100",
+ "reportFrequency":"DAILY",
+ "ReportName":"TRRReport",
+ "reportFormat":"csv",
+ "orgId":"testrest",
+ "reportType":"detail",
+ "reportFields": ["Request.RequestID","Request.TransactionDate","Request.MerchantReferenceNumber","Request.MerchantID"]
+}
\ No newline at end of file