From 3bdcc0cc01fafb542efd363cbdf74067f6bdac31 Mon Sep 17 00:00:00 2001 From: "Shiva Shankaran, Akshaya" Date: Tue, 26 Feb 2019 15:40:40 +0530 Subject: [PATCH] Qa Scripts --- .../QaScripts/CSV_Files/Driver/driver.csv | 45 +++++++ .../Flex/CoreServices/CreateKeyGeneration.csv | 3 + .../Flex/CoreServices/CreateTokenizeCard.csv | 3 + .../Flex/CreateKeyGenerationNoEnc.csv | 3 + .../Payments/CoreServices/CreateCapture.csv | 4 + .../CoreServices/CreateProcessCredit.csv | 4 + .../CoreServices/CreateProcessPayment.csv | 4 + .../Payments/CoreServices/CreateReversal.csv | 4 + .../Payments/CoreServices/RefundCapture.csv | 4 + .../Payments/CoreServices/RefundPayment.csv | 4 + .../Payments/CoreServices/VoidCapture.csv | 3 + .../Payments/CoreServices/VoidCredit.csv | 3 + .../Payments/CoreServices/VoidPayment.csv | 3 + .../Payments/CoreServices/VoidRefund.csv | 3 + .../Payouts/CoreServices/CreatePayout.csv | 4 + .../CoreServices/CreateAdhocReport.csv | 3 + ...ubscriptionForReportNameByOrganization.csv | 3 + ...SubscriptionOfReportNameByOrganization.csv | 3 + .../Reporting/CoreServices/DownloadReport.csv | 4 + .../CoreServices/GetAllSubscriptions.csv | 2 + .../CoreServices/GetNotificationOfChanges.csv | 4 + .../GetPurchaseAndRefundDetails.csv | 5 + .../CoreServices/GetReportBasedOnReportid.csv | 4 + .../CoreServices/GetReportDefinition.csv | 3 + .../GetReportingResourceInformation.csv | 3 + .../GetSubscriptionForReportName.csv | 3 + .../CoreServices/RetrieveAvailableReports.csv | 4 + .../DownloadFileWithFileIdentifier.csv | 3 + .../CoreServices/GetListOfFiles.csv | 3 + .../CreateInstrumentIdentifier.csv | 3 + .../CoreServices/CreatePaymentsInstrument.csv | 3 + .../DeleteInstrumentIdentifier.csv | 3 + .../CoreServices/DeletePaymentInstrument.csv | 3 + .../RetrieveAllPaymentInstruments.csv | 3 + .../RetrieveInstrumentIdentifier.csv | 3 + .../RetrievePaymentInstrument.csv | 3 + .../UpdateInstrumentIdentifier.csv | 3 + .../CoreServices/UpdatePaymentInstrument.csv | 3 + .../CSV_Files/TestReport/TestResults.csv | 9 ++ .../CoreServices/GetIndividualBatchFile.csv | 3 + .../CoreServices/GetListOfBatchFiles.csv | 4 + .../CoreServices/RetrieveTransaction.csv | 3 + .../CoreServices/CreateSearchRequest.csv | 3 + .../CoreServices/GetSearchResults.csv | 3 + .../CoreServices/GetUserInformation.csv | 3 + .../QaScripts/ConstantUtility.rb | 22 ++++ .../Flex/CoreServices/GenerateKeyTest.rb | 51 ++++++++ .../Flex/CoreServices/TokenizeCardTest.rb | 58 +++++++++ .../QaScripts/Flex/KeyGenerationNoEncTest.rb | 50 ++++++++ .../QaScripts/Flex/VerifyTokenTest.rb | 40 ++++++ .../QaScripts/MainScript.rb | 19 +++ .../CoreServices/CapturePaymentTest.rb | 56 +++++++++ .../ProcessAuthorizationReversalTest.rb | 59 +++++++++ .../CoreServices/ProcessCreditTest.rb | 79 ++++++++++++ .../CoreServices/ProcessPaymentTest.rb | 106 ++++++++++++++++ .../CoreServices/RefundCaptureTest.rb | 58 +++++++++ .../CoreServices/RefundPaymentTest.rb | 58 +++++++++ .../Payments/CoreServices/VoidCaptureTest.rb | 52 ++++++++ .../Payments/CoreServices/VoidCreditTest.rb | 50 ++++++++ .../Payments/CoreServices/VoidPaymentTest.rb | 48 ++++++++ .../Payments/CoreServices/VoidRefundTest.rb | 52 ++++++++ .../Payouts/CoreServices/ProcessPayoutTest.rb | 116 ++++++++++++++++++ .../CoreServices/CreateAdhocReportTest.rb | 57 +++++++++ ...criptionForReportNameByOrganizationTest.rb | 51 ++++++++ ...scriptionOfReportNameByOrganizationTest.rb | 40 ++++++ .../CoreServices/DownloadReportTest.rb | 49 ++++++++ .../CoreServices/GetAllSubscriptionsTest.rb | 40 ++++++ .../GetNotificationOfChangesTest.rb | 42 +++++++ .../GetPurchaseAndRefundDetailsTest.rb | 49 ++++++++ .../GetReportBasedOnReportidTest.rb | 44 +++++++ .../CoreServices/GetReportDefinitionTest.rb | 40 ++++++ .../GetReportingResourceInformationTest.rb | 39 ++++++ .../GetSubscriptionForReportNameTest.rb | 41 +++++++ .../RetrieveAvailableReportsTest.rb | 44 +++++++ .../DownloadFileWithFileIdentifierTest.rb | 48 ++++++++ .../CoreServices/GetListOfFilesTest.rb | 43 +++++++ .../CreateInstrumentIdentifierTest.rb | 67 ++++++++++ .../CreatePaymentInstrumentTest.rb | 74 +++++++++++ .../DeleteInstrumentIdentifierTest.rb | 42 +++++++ .../DeletePaymentInstrumentTest.rb | 42 +++++++ .../RetrieveAllPaymentInstrumentsTest.rb | 43 +++++++ .../RetrieveInstrumentIdentifierTest.rb | 46 +++++++ .../RetrievePaymentInstrumentTest.rb | 47 +++++++ .../UpdateInstrumentIdentifierTest.rb | 65 ++++++++++ .../UpdatePaymentInstrumentTest.rb | 74 +++++++++++ .../GetIndividualBatchFileTest.rb | 42 +++++++ .../CoreServices/GetListOfBatchFilesTest.rb | 43 +++++++ .../CoreServices/RetrieveTransactionTest.rb | 43 +++++++ .../CoreServices/CreateSearchRequestTest.rb | 48 ++++++++ .../CoreServices/GetSearchResultsTest.rb | 39 ++++++ .../CoreServices/GetUserInformationTest.rb | 39 ++++++ .../data/Configuration.rb | 43 +++++++ .../resource/testrest.p12 | Bin 0 -> 3553 bytes 93 files changed, 2594 insertions(+) create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Driver/driver.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateKeyGeneration.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateTokenizeCard.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CreateKeyGenerationNoEnc.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateCapture.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessCredit.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessPayment.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateReversal.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundCapture.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundPayment.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCapture.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCredit.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidPayment.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidRefund.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payouts/CoreServices/CreatePayout.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateAdhocReport.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganization.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganization.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DownloadReport.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetAllSubscriptions.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetNotificationOfChanges.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetPurchaseAndRefundDetails.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportBasedOnReportid.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportDefinition.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportingResourceInformation.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetSubscriptionForReportName.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/RetrieveAvailableReports.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/DownloadFileWithFileIdentifier.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/GetListOfFiles.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreateInstrumentIdentifier.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreatePaymentsInstrument.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeleteInstrumentIdentifier.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeletePaymentInstrument.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveAllPaymentInstruments.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveInstrumentIdentifier.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrievePaymentInstrument.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdateInstrumentIdentifier.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdatePaymentInstrument.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TestReport/TestResults.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetIndividualBatchFile.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetListOfBatchFiles.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionDetails/CoreServices/RetrieveTransaction.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/CreateSearchRequest.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/GetSearchResults.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/UserManagement/CoreServices/GetUserInformation.csv create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/ConstantUtility.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/GenerateKeyTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/TokenizeCardTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Flex/KeyGenerationNoEncTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Flex/VerifyTokenTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/MainScript.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/CapturePaymentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessAuthorizationReversalTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessCreditTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessPaymentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundCaptureTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundPaymentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCaptureTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCreditTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidPaymentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidRefundTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Payouts/CoreServices/ProcessPayoutTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateAdhocReportTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganizationTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganizationTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DownloadReportTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetAllSubscriptionsTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetNotificationOfChangesTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetPurchaseAndRefundDetailsTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportBasedOnReportidTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportDefinitionTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportingResourceInformationTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetSubscriptionForReportNameTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/RetrieveAvailableReportsTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/DownloadFileWithFileIdentifierTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/GetListOfFilesTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreateInstrumentIdentifierTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreatePaymentInstrumentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeleteInstrumentIdentifierTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeletePaymentInstrumentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveAllPaymentInstrumentsTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveInstrumentIdentifierTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrievePaymentInstrumentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdateInstrumentIdentifierTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdatePaymentInstrumentTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetIndividualBatchFileTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetListOfBatchFilesTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TransactionDetails/CoreServices/RetrieveTransactionTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/CreateSearchRequestTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/GetSearchResultsTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/QaScripts/UserManagement/CoreServices/GetUserInformationTest.rb create mode 100644 spec/cybersource-rest-qa-ruby/data/Configuration.rb create mode 100644 spec/cybersource-rest-qa-ruby/resource/testrest.p12 diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Driver/driver.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Driver/driver.csv new file mode 100644 index 00000000..f41778dc --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Driver/driver.csv @@ -0,0 +1,45 @@ +dirName,fileName,Flag +Payments/CoreServices,ProcessPaymentTest,1 +Payments/CoreServices,ProcessCreditTest,1 +Payments/CoreServices,ProcessAuthorizationReversalTest,0 +Payments/CoreServices,CapturePaymentTest,0 +Payments/CoreServices,RefundCaptureTest,0 +Payments/CoreServices,RefundPaymentTest,1 +Payments/CoreServices,VoidCaptureTest,0 +Payments/CoreServices,VoidCreditTest,0 +Payments/CoreServices,VoidPaymentTest,0 +Payments/CoreServices,VoidRefundTest,0 +Payouts/CoreServices,ProcessPayoutTest,1 +Flex/CoreServices,GenerateKeyTest,0 +Flex/CoreServices,TokenizeCardTest,0 +Flex,KeyGenerationNoEncTest,1 +TMS/CoreServices,CreateInstrumentIdentifierTest,1 +TMS/CoreServices,CreatePaymentInstrumentTest,0 +TMS/CoreServices,RetrieveInstrumentIdentifierTest,0 +TMS/CoreServices,RetrievePaymentInstrumentTest,0 +TMS/CoreServices,RetrieveAllPaymentInstrumentsTest,0 +TMS/CoreServices,UpdateInstrumentIdentifierTest,0 +TMS/CoreServices,UpdatePaymentInstrumentTest,0 +TMS/CoreServices,DeleteInstrumentIdentifierTest,0 +TMS/CoreServices,DeletePaymentInstrumentTest,0 +TMS/CoreServices,DeletePaymentInstrumentTest,0 +TransactionBatches/CoreServices,GetIndividualBatchFileTest,0 +TransactionBatches/CoreServices,GetListOfBatchFilesTest,0 +TransactionDetails/CoreServices,RetrieveTransactionTest,0 +TransactionSearch/CoreServices,CreateSearchRequestTest,0 +TransactionSearch/CoreServices,GetSearchResultsTest,1 +UserManagement/CoreServices,GetUserInformationTest,0 +SecureFileShare/CoreServices,GetListOfFilesTest,0 +SecureFileShare/CoreServices,DownloadFileWithFileIdentifierTest,0 +Reporting/CoreServices,CreateAdhocReportTest,0 +Reporting/CoreServices,CreateReportSubscriptionForReportNameByOrganizationTest,0 +Reporting/CoreServices,DeleteSubscriptionOfReportNameByOrganizationTest,0 +Reporting/CoreServices,DownloadReportTest,0 +Reporting/CoreServices,GetAllSubscriptionsTest,0 +Reporting/CoreServices,GetNotificationOfChangesTest,0 +Reporting/CoreServices,GetPurchaseAndRefundDetailsTest,0 +Reporting/CoreServices,GetReportBasedOnReportidTest,0 +Reporting/CoreServices,GetReportDefinitionTest,0 +Reporting/CoreServices,GetReportingResourceInformationTest,0 +Reporting/CoreServices,GetSubscriptionForReportNameTest,0 +Reporting/CoreServices,RetrieveAvailableReportsTest,0 diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateKeyGeneration.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateKeyGeneration.csv new file mode 100644 index 00000000..0e7f3371 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateKeyGeneration.csv @@ -0,0 +1,3 @@ +testCaseId,encryptionType,message +CKeyGen_01,RsaOaep256,Success +CKeyGen_02,PqaPabc255,Fails due to invalid encryptionType diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateTokenizeCard.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateTokenizeCard.csv new file mode 100644 index 00000000..b5a19ad3 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CoreServices/CreateTokenizeCard.csv @@ -0,0 +1,3 @@ +testCaseId,keyId,message +CTokC_01,08lunaoHYjKAzbydtVLSJB24Ao39aNf1,Success +CTokC_02,0023154mudgshfyrtdgfj456fhdggdg1,Fails due to invalid keyId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CreateKeyGenerationNoEnc.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CreateKeyGenerationNoEnc.csv new file mode 100644 index 00000000..1899f9ac --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Flex/CreateKeyGenerationNoEnc.csv @@ -0,0 +1,3 @@ +testCaseId,encryptionType,message +CKeyGenNE_01,None,Success +CKeyGenNE_02,SDMP,Fails due to invalid encryptionType diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateCapture.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateCapture.csv new file mode 100644 index 00000000..8a590277 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateCapture.csv @@ -0,0 +1,4 @@ +testCaseId,paymentId,amount,message +CACap_01,5495429490576774004003,102.21,Success +CACap_02,5440958242536325704002,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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessCredit.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessCredit.csv new file mode 100644 index 00000000..cdec118f --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessCredit.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessPayment.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessPayment.csv new file mode 100644 index 00000000..1d581167 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateProcessPayment.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateReversal.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateReversal.csv new file mode 100644 index 00000000..4c3af695 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/CreateReversal.csv @@ -0,0 +1,4 @@ +testCaseId,paymentId,amount,message +CARev_01,5507422897256771003004,102.21,Success +CARev_02,5507423875116982403003,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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundCapture.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundCapture.csv new file mode 100644 index 00000000..85add4a2 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundCapture.csv @@ -0,0 +1,4 @@ +testCaseId,captureId,amount,message +RAC_01,5440961493586401004003,102.21,Success +RAC_02,5440961496736640504004,102,Fails due to mismatch amount +RAC_03,1234567898745632145698,BSL8,Fails due to invalid captureId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundPayment.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundPayment.csv new file mode 100644 index 00000000..05b0d43e --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/RefundPayment.csv @@ -0,0 +1,4 @@ +testCaseId,paymentId,amount,message +RAP_01,5441039154576979604004,102.21,Success +RAP_02,5441040074026145504005,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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCapture.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCapture.csv new file mode 100644 index 00000000..2c1fff1b --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCapture.csv @@ -0,0 +1,3 @@ +testCaseId,captureId,status,message +VAC_01,5441563648876440004001,VOIDED,Success +VAC_02,8964213433846812344644,VOIDED,Fails due to invalid captureId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCredit.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCredit.csv new file mode 100644 index 00000000..2d7167b7 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidCredit.csv @@ -0,0 +1,3 @@ +testCaseId,creditId,message +VAC_01,5508378826696729404006,Success +VAC_02,8964213433846812344644,Fails due to invalid creditId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidPayment.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidPayment.csv new file mode 100644 index 00000000..569b1cc0 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidPayment.csv @@ -0,0 +1,3 @@ +testCaseId,paymentId,status,message +VAP_01,5441562707056439504001,VOIDED,Success +VAP_02,8964213433846812344644,VOIDED,Fails due to invalid paymentId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidRefund.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidRefund.csv new file mode 100644 index 00000000..9cfe7c2c --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payments/CoreServices/VoidRefund.csv @@ -0,0 +1,3 @@ +testCaseId,refundId,status,message +VAR_01,5441568951426815904006,VOIDED,Success +VAR_02,8964213433846812344644,VOIDED,Fails due to invalid refundId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payouts/CoreServices/CreatePayout.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payouts/CoreServices/CreatePayout.csv new file mode 100644 index 00000000..3de1964b --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Payouts/CoreServices/CreatePayout.csv @@ -0,0 +1,4 @@ +testCaseId,cleintRefInfoCode,businessAppId,amount,message +CPay_01,33557799,FD,100.00,Success +CPay_02,12345,GD,200,Fails due to amount mismatch +CPay_03,6789,MD,DSWAZ1,Fails due to invalid amount \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateAdhocReport.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateAdhocReport.csv new file mode 100644 index 00000000..34a92e47 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateAdhocReport.csv @@ -0,0 +1,3 @@ +testCaseId,reportDefName,repName,reportSTime,reportETime,message +CAdR_01,TransactionRequestClass,V2_reportTestQA1,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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganization.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganization.csv new file mode 100644 index 00000000..f640b9c6 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganization.csv @@ -0,0 +1,3 @@ +testCaseId,reportDefName,repName,repFrequency,message +CRSFRNO_01,TransactionRequestClass,QA_test_reporting_org,WEEKLY,Success +CRSFRNO_02,TransactionRes,subscriptionAutomation2,DAILY,Fails due to invalid reportDefinitionName diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganization.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganization.csv new file mode 100644 index 00000000..97a4092d --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganization.csv @@ -0,0 +1,3 @@ +testCaseId,repName,message +DSRNO_01,testrest_subcription_v1,Success +DSRNO_02,ghsrrawasbhfhcb,Fails due to invalid reportName diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DownloadReport.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DownloadReport.csv new file mode 100644 index 00000000..0c14e16b --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/DownloadReport.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetAllSubscriptions.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetAllSubscriptions.csv new file mode 100644 index 00000000..1a9ccf41 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetAllSubscriptions.csv @@ -0,0 +1,2 @@ +testCaseId,,message +GAS_01,Success diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetNotificationOfChanges.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetNotificationOfChanges.csv new file mode 100644 index 00000000..41b1cc2a --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetNotificationOfChanges.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetPurchaseAndRefundDetails.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetPurchaseAndRefundDetails.csv new file mode 100644 index 00000000..169a562d --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetPurchaseAndRefundDetails.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportBasedOnReportid.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportBasedOnReportid.csv new file mode 100644 index 00000000..c1407d09 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportBasedOnReportid.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportDefinition.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportDefinition.csv new file mode 100644 index 00000000..154cf11f --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportDefinition.csv @@ -0,0 +1,3 @@ +testCaseId,reportDefName,message +GRD_01,SubscriptionDetailClass,Success +GRD_02,SubscDetail,Fails due to invalid reportDefinitionName \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportingResourceInformation.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportingResourceInformation.csv new file mode 100644 index 00000000..f09027c5 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetReportingResourceInformation.csv @@ -0,0 +1,3 @@ +testCaseId,orgId,message +GRRI_01,testrest,Success +GRRI_02,bplkmdghd,Fails due to invalid organizationId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetSubscriptionForReportName.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetSubscriptionForReportName.csv new file mode 100644 index 00000000..754b39b1 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/GetSubscriptionForReportName.csv @@ -0,0 +1,3 @@ +testCaseId,repName,message +GSFRN_01,QA_test_reporting_org,Success +GSFRN_02,bplkmdgsd,Fails due to invalid reportName diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/RetrieveAvailableReports.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/RetrieveAvailableReports.csv new file mode 100644 index 00000000..b9442397 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/Reporting/CoreServices/RetrieveAvailableReports.csv @@ -0,0 +1,4 @@ +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.TZ,2018-09-05T23:59:59.0Z,executedTime,Fails due to invalid startTime +RAR_03,2018-09-01T00:00:00.0Z,2018-09-05T23:59:59.TZ,executedTime,Fails due to invalid endTime \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/DownloadFileWithFileIdentifier.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/DownloadFileWithFileIdentifier.csv new file mode 100644 index 00000000..0c674ee0 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/DownloadFileWithFileIdentifier.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/GetListOfFiles.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/GetListOfFiles.csv new file mode 100644 index 00000000..6341acd2 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/SecureFileShare/CoreServices/GetListOfFiles.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,invalid organizationId \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreateInstrumentIdentifier.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreateInstrumentIdentifier.csv new file mode 100644 index 00000000..b7404151 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreateInstrumentIdentifier.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreatePaymentsInstrument.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreatePaymentsInstrument.csv new file mode 100644 index 00000000..1042f6ea --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/CreatePaymentsInstrument.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeleteInstrumentIdentifier.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeleteInstrumentIdentifier.csv new file mode 100644 index 00000000..7a1a8e99 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeleteInstrumentIdentifier.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +RemInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7010000000004750123,Success +RemInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeletePaymentInstrument.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeletePaymentInstrument.csv new file mode 100644 index 00000000..3254ceb2 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/DeletePaymentInstrument.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +RemPIns_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,815D2A76BD28F785E05341588E0AD705,Success +RemPIns_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveAllPaymentInstruments.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveAllPaymentInstruments.csv new file mode 100644 index 00000000..48271ec9 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveAllPaymentInstruments.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +RAPIdenGInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7010000000004750123,Success +RAPIdenGInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveInstrumentIdentifier.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveInstrumentIdentifier.csv new file mode 100644 index 00000000..c3b1cc66 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrieveInstrumentIdentifier.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +RInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7010000000004750123,Success +RInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrievePaymentInstrument.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrievePaymentInstrument.csv new file mode 100644 index 00000000..2766e254 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/RetrievePaymentInstrument.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +RPIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,815D5F887A9223A7E05341588E0A2D3A,Success +RPIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7654264589567855546,Fails due to invalid tokenId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdateInstrumentIdentifier.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdateInstrumentIdentifier.csv new file mode 100644 index 00000000..ac1c209f --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdateInstrumentIdentifier.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +UpdInsIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,7010000000004750123,Success +UpdInsIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,70200000000001376465,Success diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdatePaymentInstrument.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdatePaymentInstrument.csv new file mode 100644 index 00000000..415d765e --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TMS/CoreServices/UpdatePaymentInstrument.csv @@ -0,0 +1,3 @@ +testCaseId,profileId,tokenId,message +UpdPIden_01,93B32398-AD51-4CC2-A682-EA3E93614EB1,815D5F887A9223A7E05341588E0A2D3A,Success +UpdPIden_02,93B32398-AD51-4CC2-A682-EA3E93614EB1,7501E647FA683692E05340588D0A131D677ef,Success \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TestReport/TestResults.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TestReport/TestResults.csv new file mode 100644 index 00000000..8e2c67c6 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TestReport/TestResults.csv @@ -0,0 +1,9 @@ +TestCaseId,APIName,Status,Message,TimeStamp +CPAP_01,ProcessPayment,Pass:201-5511756285216380104005,Success,2019-02-26T15:37:08+05:30 +CPAP_02,ProcessPayment,Assertion Failed:201,Fails due to mismatch amount,2019-02-26T15:37:09+05:30 +CPAP_03,ProcessPayment,Fail:400,Declined - One or more fields in the request contains invalid data,2019-02-26T15:37:09+05:30 +CACre_01,ProcessCredit,Pass:201-5511756301216511204003,Success,2019-02-26T15:37:10+05:30 +CACre_02,ProcessCredit,Assertion Failed:201,Fails due to mismatch amount,2019-02-26T15:37:10+05:30 +CACre_03,ProcessCredit,Fail:400,Declined - One or more fields in the request contains invalid data,2019-02-26T15:37:10+05:30 +RAP_01,RefundPayment,Pass:201-5511756310746511304003,Success,2019-02-26T15:37:11+05:30 +RAP_02,RefundPayment,Assertion Failed:201,Fails due to mismatch amount,2019-02-26T15:37:11+05:30 diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetIndividualBatchFile.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetIndividualBatchFile.csv new file mode 100644 index 00000000..53729aa4 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetIndividualBatchFile.csv @@ -0,0 +1,3 @@ +testCaseId,id,message +GIBF_01,Owcyk6pl,Success +GIBF_02,CYBS123,Fails due to invalid Id diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetListOfBatchFiles.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetListOfBatchFiles.csv new file mode 100644 index 00000000..1129a68d --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionBatches/CoreServices/GetListOfBatchFiles.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/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionDetails/CoreServices/RetrieveTransaction.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionDetails/CoreServices/RetrieveTransaction.csv new file mode 100644 index 00000000..9cd405c5 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionDetails/CoreServices/RetrieveTransaction.csv @@ -0,0 +1,3 @@ +testCaseId,id,message +RT_01,5408386919326811103004,Success +RT_02,1234567898745651235454,Fails due to invalid Id diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/CreateSearchRequest.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/CreateSearchRequest.csv new file mode 100644 index 00000000..3381e31c --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/CreateSearchRequest.csv @@ -0,0 +1,3 @@ +testCaseId,name,query,message +CSR_01,TSS search,clientReferenceInformation.code:12345,Success +CSR_02,TSS search,clientRefeInfo.code:52465,Fails due to invalid query. diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/GetSearchResults.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/GetSearchResults.csv new file mode 100644 index 00000000..e01e2e92 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/TransactionSearch/CoreServices/GetSearchResults.csv @@ -0,0 +1,3 @@ +testCaseId,id,message +GSR_01,93adaa7b-9145-4b90-84cc-166e2d87a70f,Success +GSR_02,93adaa7b-457667-4b90-bgh-daert,Fails due to invalid Id \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/UserManagement/CoreServices/GetUserInformation.csv b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/UserManagement/CoreServices/GetUserInformation.csv new file mode 100644 index 00000000..ecee2f8e --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/CSV_Files/UserManagement/CoreServices/GetUserInformation.csv @@ -0,0 +1,3 @@ +testCaseId,orgId,userName,permissionId,roleId,message +GUI_01,testrest,tesrest,CustomerProfileViewPermission,admin,Success +GUI_02,testre,tesrest,CustomerProfileViewPermission,admin,Fail due to invalid organizationId diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/ConstantUtility.rb b/spec/cybersource-rest-qa-ruby/QaScripts/ConstantUtility.rb new file mode 100644 index 00000000..716d4854 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/ConstantUtility.rb @@ -0,0 +1,22 @@ +class ConstantUtility + STATUS_AUTHORIZED = 'AUTHORIZED' unless const_defined?(:STATUS_AUTHORIZED) + MESSAGE_AUTHORIZE = 'Assertion Failed since Status is UNAUTHORIZED' unless const_defined?(:MESSAGE_AUTHORIZE) + + STATUS_PENDING = 'PENDING' unless const_defined?(:STATUS_PENDING) + MESSAGE_PENDING = 'Assertion Failed since Status is not PENDING' unless const_defined?(:MESSAGE_PENDING) + + STATUS_REVERSED = 'REVERSED' unless const_defined?(:STATUS_REVERSED) + MESSAGE_REVERSED = 'Assertion Failed since Status is not REVERSED' unless const_defined?(:MESSAGE_REVERSED) + + STATUS_VOIDED = 'VOIDED' unless const_defined?(:STATUS_VOIDED) + MESSAGE_VOIDED = 'Assertion Failed since Status is not VOIDED' unless const_defined?(:MESSAGE_VOIDED) + + STATUS_ACCEPTED = 'ACCEPTED' unless const_defined?(:STATUS_ACCEPTED) + MESSAGE_ACCEPTED = 'Assertion Failed since Status is not ACCEPTED' unless const_defined?(:MESSAGE_ACCEPTED) + + STATE_ACTIVE = 'ACTIVE' unless const_defined?(:STATE_ACTIVE) + MESSAGE_ACTIVE = 'Assertion Failed since Status is not ACTIVE' unless const_defined?(:MESSAGE_ACTIVE) + + MESSAGE_RESPONSE_CODE = 'Assertion Failed in Response code validation' unless const_defined?(:MESSAGE_RESPONSE_CODE) + MESSAGE_NULL_ID = 'Assertion Failed since Payment ID is null' unless const_defined?(:MESSAGE_NULL_ID) +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/GenerateKeyTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/GenerateKeyTest.rb new file mode 100644 index 00000000..37703747 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/GenerateKeyTest.rb @@ -0,0 +1,51 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +# * This is a sample code to call KeyGenerationApi, +# * Generate Key - with Encryption Type +# * GeneratePublickey method will create a new Public Key and Key ID +public +class Generatekey + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::KeyParameters.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::KeyGenerationApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Flex\\CoreServices\\CreateKeyGeneration.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + request.encryption_type = row[1] + options = {} + options[:'generate_public_key_request'] = request + begin + response_body , response_code, response_headers = api_instance.generate_public_key(options) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GenerateKey', 'Pass:' + response_code.to_s, row[2], DateTime.now] + elsif resp['keyId'] == nil + writeToCSV << [row[0], 'GenerateKey', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'GenerateKey', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GenerateKey', 'Fail:' + err.code.to_s, row[2], DateTime.now] + end + else + puts err + end + end + end + end + Generatekey.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/TokenizeCardTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/TokenizeCardTest.rb new file mode 100644 index 00000000..1fc0b5b4 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/CoreServices/TokenizeCardTest.rb @@ -0,0 +1,58 @@ +require 'cybersource_rest_client' +require_relative '../VerifyTokenTest.rb' +require_relative '../../../data/Configuration.rb' + +# * This is a sample code to call Tokenization Api which will return key and +# * TokenizationApi Returns a token representing the supplied card details. +# * to verify the token with the key generated. + +public +class TokenizeCard + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::TokenizeRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::FlexTokenApi.new(api_client, config) + + card_info = CyberSource::Flexv1tokensCardInfo.new + card_info.card_number = "5555555555554444" + card_info.card_expiration_month = "03" + card_info.card_expiration_year = "2031" + card_info.card_type = "002" + request.card_info = card_info + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Flex\\CoreServices\\CreateTokenizeCard.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + request.key_id = row[1] + options = {} + options[:'tokenize_request'] = request + begin + response_body, response_code, response_headers = api_instance.tokenize(options) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'TokenizeCard', 'Pass:' + response_code.to_s, row[2], DateTime.now] + elsif resp['keyId'] == nil + writeToCSV << [row[0], 'TokenizeCard', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'TokenizeCard', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'TokenizeCard','Fail:' + err.code.to_s, resp['responseStatus']['message'], DateTime.now] + end + else + puts err + end + end + end + end + TokenizeCard.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Flex/KeyGenerationNoEncTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/KeyGenerationNoEncTest.rb new file mode 100644 index 00000000..3fbf1368 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/KeyGenerationNoEncTest.rb @@ -0,0 +1,50 @@ +require 'cybersource_rest_client' +require_relative '../../data/Configuration.rb' +# * This is a sample code to call KeyGenerationApi, +# * Generate Key - with Encryption Type as none +# * GeneratePublickey method will create a new Public Key and Key ID + +public +class NoEncGeneratekey + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::KeyParameters.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::KeyGenerationApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Flex\\CreateKeyGenerationNoEnc.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + request.encryption_type = row[1] + options = {} + options[:'generate_public_key_request'] = request + begin + response_body, response_code, response_headers = api_instance.generate_public_key(options) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'KeyGenerationNoEncryption', 'Pass:' + response_code.to_s, row[2], DateTime.now] + elsif resp['keyId'] == nil + writeToCSV << [row[0], 'KeyGenerationNoEncryption', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'KeyGenerationNoEncryption', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'KeyGenerationNoEncryption', 'Fail:' + err.code.to_s, row[2], DateTime.now] + end + else + puts err + end + end + end + end + NoEncGeneratekey.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Flex/VerifyTokenTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/VerifyTokenTest.rb new file mode 100644 index 00000000..ffa519cc --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Flex/VerifyTokenTest.rb @@ -0,0 +1,40 @@ +public +class VerifyToken + def verify(public_key, post_param) + post_param = JSON.parse(post_param) + signed_fields = Array.new + get_signed_fields = Array.new + signed_values = "" + signature = "" + if post_param['signedFields'].to_s.empty? + raise StandardError.new("Missing required field: signed_fields") + else + signed_fields = post_param['signedFields'].split(',') + end + signed_fields.each do |value| + signed_values << ',' + signed_values << post_param[value].to_s + end + if signed_values.length > 0 + signed_values.slice!(0) + end + if post_param['signature'].to_s.empty? + raise StandardError.new("Missing required field: signature") + else + signature = post_param['signature'] + end + string_to_pem = "-----BEGIN PUBLIC KEY-----\n#{public_key}\n-----END PUBLIC KEY-----\n" + public_key_to_pem = OpenSSL::PKey::RSA.new(string_to_pem) + verify = public_key_to_pem.verify(OpenSSL::Digest::SHA512.new, Base64.decode64(signature), signed_values) + rescue StandardError => err + puts err.message + end + # Converting response field from camelCase to Underscore + def CamelCasetoUnderscore(str) + str.gsub(/::/, '/'). + gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). + gsub(/([a-z\d])([A-Z])/,'\1_\2'). + tr("-", "_"). + downcase + end +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/MainScript.rb b/spec/cybersource-rest-qa-ruby/QaScripts/MainScript.rb new file mode 100644 index 00000000..1c8aa977 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/MainScript.rb @@ -0,0 +1,19 @@ + # Driver Code for running the flagged samples +require 'json' +require 'securerandom' +require 'base64' +require 'csv' + +# Code to write the Output file + CSV.open("QaScripts/CSV_Files/TestReport/TestResults.csv","wb", :headers => true) do |writeToCSV| + writeToCSV << ["TestCaseId","APIName","Status","Message","TimeStamp"] + end + csv_text = File.read("QaScripts/CSV_Files/Driver/driver.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + if(row[2].to_s.strip == "1") + puts "Executing #{row['fileName'].to_s}" + require_relative "./"+row['dirName'].to_s+"/"+row['fileName'].to_s + + end + end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/CapturePaymentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/CapturePaymentTest.rb new file mode 100644 index 00000000..27614378 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/CapturePaymentTest.rb @@ -0,0 +1,56 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class CapturePayment + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::CapturePaymentRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::CaptureApi.new(api_client, config) + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\CreateCapture.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + payment_id = row[1] + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_capture" + request.client_reference_information = client_reference_information + + order_information = CyberSource::Ptsv2paymentsOrderInformation.new + amount_details = CyberSource::Ptsv2paymentsOrderInformationAmountDetails.new + amount_details.total_amount = row[2] + amount_details.currency ="USD" + order_information.amount_details = amount_details + request.order_information = order_information + begin + response_body , response_code, response_headers = api_instance.capture_payment(request,payment_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_PENDING + writeToCSV << [row[0], 'CapturePayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_PENDING, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'CapturePayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['orderInformation']['amountDetails']['totalAmount'] == row[2] + writeToCSV << [row[0], 'CapturePayment', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'CapturePayment', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CapturePayment', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + CapturePayment.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessAuthorizationReversalTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessAuthorizationReversalTest.rb new file mode 100644 index 00000000..e185b311 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessAuthorizationReversalTest.rb @@ -0,0 +1,59 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class ProcessAuthorizationReversal + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::AuthReversalRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReversalApi.new(api_client, config) + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\CreateReversal.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + payment_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_reversal" + request.client_reference_information = client_reference_information + + reversal_information = CyberSource::Ptsv2paymentsidreversalsReversalInformation.new + reversal_information.reason = "testing" + + amount_details = CyberSource::Ptsv2paymentsidreversalsReversalInformationAmountDetails.new + amount_details.total_amount = row[2] + + reversal_information.amount_details = amount_details + request.reversal_information = reversal_information + begin + response_body , response_code, response_headers = api_instance.auth_reversal(payment_id, request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_REVERSED + writeToCSV << [row[0], 'ProcessAuthorizationReversal', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_REVERSED, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'ProcessAuthorizationReversal', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['reversalAmountDetails']['reversedAmount'] == row[2] + writeToCSV << [row[0], 'ProcessAuthorizationReversal', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'ProcessAuthorizationReversal', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body !=nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'ProcessAuthorizationReversal', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + ProcessAuthorizationReversal.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessCreditTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessCreditTest.rb new file mode 100644 index 00000000..8335132c --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessCreditTest.rb @@ -0,0 +1,79 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class CreateCredit + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::CreateCreditRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::CreditApi.new(api_client, config) + + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\CreateProcessCredit.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_credit" + request.client_reference_information = client_reference_information + + order_information = CyberSource::Ptsv2paymentsOrderInformation.new + bill_to_information = CyberSource::Ptsv2paymentsOrderInformationBillTo.new + bill_to_information.country = "US" + bill_to_information.last_name = "Deo" + bill_to_information.address1 = "1 Market St" + bill_to_information.postal_code = "94105" + bill_to_information.locality = "san francisco" + bill_to_information.administrative_area = "CA" + bill_to_information.first_name = "John" + bill_to_information.phone_number = "4158880000" + bill_to_information.email = "test@cybs.com" + order_information.bill_to = bill_to_information + request.order_information = order_information + + amount_information = CyberSource::Ptsv2paymentsOrderInformationAmountDetails.new + amount_information.total_amount = row[1] + amount_information.currency = "USD" + order_information.amount_details = amount_information + request.order_information = order_information + + payment_information = CyberSource::Ptsv2paymentsPaymentInformation.new + card_information =CyberSource::Ptsv2paymentsPaymentInformationCard.new + card_information.expiration_year = "2031" + card_information.number = "5555555555554444" + card_information.expiration_month = "12" + card_information.type = "002" + payment_information.card = card_information + request.payment_information = payment_information + begin + response_body , response_code, response_headers = api_instance.create_credit(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_PENDING + writeToCSV << [row[0], 'ProcessCredit', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_PENDING, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'ProcessCredit', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['creditAmountDetails']['creditAmount'] == row[1] + writeToCSV << [row[0], 'ProcessCredit', 'Pass:' + response_code.to_s + '-' + resp['id'], row[2], DateTime.now] + else + writeToCSV << [row[0], 'ProcessCredit', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'ProcessCredit', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreateCredit.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessPaymentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessPaymentTest.rb new file mode 100644 index 00000000..a05036eb --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/ProcessPaymentTest.rb @@ -0,0 +1,106 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +# * This is a sample code to call PaymentApi, +# * for Core Services - Process Payment +# * createPayment method will create a new payment + +public +class CreatePayment + def main() + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::CreatePaymentRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentsApi.new(api_client, config) + + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\CreateProcessPayment.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_payment" + request.client_reference_information = client_reference_information + processing_information = CyberSource::Ptsv2paymentsProcessingInformation.new + + aggregator_information = CyberSource::Ptsv2paymentsAggregatorInformation.new + sub_merchant_information = CyberSource::Ptsv2paymentsAggregatorInformationSubMerchant.new + sub_merchant_information.card_acceptor_id = "1234567890" + sub_merchant_information.country = "US" + sub_merchant_information.phone_number = "4158880000" + sub_merchant_information.address1 = "1 Market St" + sub_merchant_information.postal_code = "94105" + sub_merchant_information.locality = "san francisco" + sub_merchant_information.name = "Visa Inc" + sub_merchant_information.administrative_area = "CA" + sub_merchant_information.region = "PEN" + sub_merchant_information.email = "test@cybs.com" + aggregator_information.sub_merchant = sub_merchant_information + aggregator_information.name = "V-Internatio" + aggregator_information.aggregator_id = "123456789" + request.aggregator_information = aggregator_information + + order_information = CyberSource::Ptsv2paymentsOrderInformation.new + bill_to_information = CyberSource::Ptsv2paymentsOrderInformationBillTo.new + bill_to_information.country = "US" + bill_to_information.last_name = "Deo" + bill_to_information.address2 = "Address 2" + bill_to_information.address1 = "1 Market St" + bill_to_information.postal_code = "94105" + bill_to_information.locality = "san francisco" + bill_to_information.administrative_area = "CA" + bill_to_information.first_name = "John" + bill_to_information.phone_number = "4158880000" + bill_to_information.district = "MI" + bill_to_information.building_number = "123" + bill_to_information.company = "Visa" + bill_to_information.email = "test@cybs.com" + order_information.bill_to = bill_to_information + request.order_information = order_information + + amount_information = CyberSource::Ptsv2paymentsOrderInformationAmountDetails.new + amount_information.total_amount = row[1] + amount_information.currency = "USD" + order_information.amount_details = amount_information + request.order_information = order_information + + payment_information = CyberSource::Ptsv2paymentsPaymentInformation.new + card_information =CyberSource::Ptsv2paymentsPaymentInformationCard.new + card_information.expiration_year = "2031" + card_information.number = "5555555555554444" + card_information.security_code = "123" + card_information.expiration_month = "12" + card_information.type = "002" + payment_information.card = card_information + request.payment_information = payment_information + begin + response_body , response_code, response_headers = api_instance.create_payment(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_AUTHORIZED + writeToCSV << [row[0], 'ProcessPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_AUTHORIZE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'ProcessPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['orderInformation']['amountDetails']['authorizedAmount'] == row[1] + writeToCSV << [row[0], 'ProcessPayment', 'Pass:' + response_code.to_s + '-' + resp['id'], row[2], DateTime.now] + else + writeToCSV << [row[0], 'ProcessPayment', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'ProcessPayment', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreatePayment.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundCaptureTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundCaptureTest.rb new file mode 100644 index 00000000..3509cbd1 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundCaptureTest.rb @@ -0,0 +1,58 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RefundCapture + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::RefundCaptureRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::RefundApi.new(api_client, config) + + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\RefundCapture.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + capture_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_refund_capture" + request.client_reference_information = client_reference_information + order_information = CyberSource::Ptsv2paymentsOrderInformation.new + amount_details = CyberSource::Ptsv2paymentsOrderInformationAmountDetails.new + amount_details.total_amount = row[2] + amount_details.currency ="USD" + order_information.amount_details = amount_details + request.order_information = order_information + + begin + response_body , response_code, response_headers = api_instance.refund_capture(request,capture_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_PENDING + writeToCSV << [row[0], 'RefundCapture', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_PENDING, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'RefundCapture', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['refundAmountDetails']['refundAmount'] == row[2] + writeToCSV << [row[0], 'RefundCapture', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'RefundCapture', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RefundCapture', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + RefundCapture.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundPaymentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundPaymentTest.rb new file mode 100644 index 00000000..ada29858 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/RefundPaymentTest.rb @@ -0,0 +1,58 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RefundPayment + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::RefundPaymentRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::RefundApi.new(api_client, config) + + #Reading from Input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\RefundPayment.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + payment_id = row[1] + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_refund_payment" + request.client_reference_information = client_reference_information + + order_information = CyberSource::Ptsv2paymentsOrderInformation.new + amount_details = CyberSource::Ptsv2paymentsOrderInformationAmountDetails.new + amount_details.total_amount = row[2] + amount_details.currency ="USD" + order_information.amount_details = amount_details + request.order_information = order_information + + begin + response_body , response_code, response_headers = api_instance.refund_payment(request, payment_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_PENDING + writeToCSV << [row[0], 'RefundPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_PENDING, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'RefundPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['refundAmountDetails']['refundAmount'] == row[2] + writeToCSV << [row[0], 'RefundPayment', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'RefundPayment', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RefundPayment', 'Fail:' + err.code.to_s, resp['reason'], DateTime.now] + end + else + puts err + end + end + end + end + RefundPayment.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCaptureTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCaptureTest.rb new file mode 100644 index 00000000..415820ce --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCaptureTest.rb @@ -0,0 +1,52 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class VoidCapture + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::VoidCaptureRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::VoidApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\VoidCapture.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + capture_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_capture_void" + request.client_reference_information = client_reference_information + + + begin + response_body , response_code, response_headers = api_instance.void_capture(request,capture_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_VOIDED + writeToCSV << [row[0], 'VoidCapture', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_VOIDED, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'VoidCapture', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'VoidCapture', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'VoidCapture', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + VoidCapture.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCreditTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCreditTest.rb new file mode 100644 index 00000000..3169736f --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidCreditTest.rb @@ -0,0 +1,50 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class VoidCredit + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::VoidCreditRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::VoidApi.new(api_client, config) + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\VoidCredit.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + credit_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_credit_void" + request.client_reference_information = client_reference_information + + begin + response_body , response_code, response_headers = api_instance.void_credit(request, credit_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_VOIDED + writeToCSV << [row[0], 'VoidCredit', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_VOIDED, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'VoidCredit', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'VoidCredit', 'Pass:' + response_code.to_s + '-' + resp['id'], row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'VoidCredit', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + VoidCredit.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidPaymentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidPaymentTest.rb new file mode 100644 index 00000000..f16cf0aa --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidPaymentTest.rb @@ -0,0 +1,48 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class VoidPayment + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::VoidPaymentRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::VoidApi.new(api_client, config) + #Reading from input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\VoidPayment.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + payment_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_payment_void" + request.client_reference_information = client_reference_information + begin + response_body , response_code, response_headers = api_instance.void_payment(request,payment_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_VOIDED + writeToCSV << [row[0], 'VoidPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_VOIDED, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'VoidPayment', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + else + writeToCSV << [row[0], 'VoidPayment', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'VoidPayment', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + VoidPayment.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidRefundTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidRefundTest.rb new file mode 100644 index 00000000..c8d03a63 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payments/CoreServices/VoidRefundTest.rb @@ -0,0 +1,52 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class VoidRefund + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::VoidRefundRequest.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::VoidApi.new(api_client, config) + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\Payments\\CoreServices\\VoidRefund.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + refund_id = row[1] + + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "test_refund_void" + request.client_reference_information = client_reference_information + + begin + responsebody , code, headers = api_instance.void_refund(request,refund_id) + resp = JSON.parse(responsebody) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_PENDING + writeToCSV << [row[0], 'VoidRefund', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_PENDING, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'VoidRefund', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['refundAmountDetails']['refundAmount'] == row[2] + writeToCSV << [row[0], 'VoidRefund', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'VoidRefund', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'VoidRefund', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + VoidRefund.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Payouts/CoreServices/ProcessPayoutTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Payouts/CoreServices/ProcessPayoutTest.rb new file mode 100644 index 00000000..f36cf7ea --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Payouts/CoreServices/ProcessPayoutTest.rb @@ -0,0 +1,116 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class ProcessAPayout + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::PtsV2PayoutsPostResponse.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ProcessAPayoutApi.new(api_client, config) + + #Reading from input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\Payouts\\CoreServices\\CreatePayout.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + client_reference_information = CyberSource::Ptsv2paymentsClientReferenceInformation.new + client_reference_information.code = "33557799" + request.client_reference_information = client_reference_information + + sender_information = CyberSource::Ptsv2payoutsSenderInformation.new + sender_information.reference_number = "1234567890" + sender_information.address1 = "900 Metro Center Blvd.900" + sender_information.country_code = "US" + sender_information.locality = "Foster City" + sender_information.name = "Thomas Jefferson" + sender_information.administrative_area = "CA" + account = CyberSource::Ptsv2payoutsSenderInformationAccount.new + account.number = "1234567890123456789012345678901234" + account.funds_source = "01" + sender_information.account = account + request.sender_information = sender_information + + processing_information = CyberSource::Ptsv2payoutsProcessingInformation.new + processing_information.commerce_indicator = "internet" + processing_information.business_application_id = "FD" + processing_information.network_routing_order = "ECG" + request.processing_information = processing_information + + payout_options = CyberSource::Ptsv2payoutsProcessingInformationPayoutsOptions.new + payout_options.retrieval_reference_number = "123456789012" + payout_options.acquirer_bin = "567890124" + + # missing + # processing_information.reconciliation_id = "1087488702VIAQNSPQ" + + order_information = CyberSource::Ptsv2payoutsOrderInformation.new + amount_details = CyberSource::Ptsv2payoutsOrderInformationAmountDetails.new + amount_details.total_amount = row[3] + amount_details.currency = "USD" + order_information.amount_details = amount_details + request.order_information = order_information + + merchant_information = CyberSource::Ptsv2payoutsMerchantInformation.new + merchant_information.category_code = 123 + merchant_descriptor = CyberSource::Ptsv2payoutsMerchantInformationMerchantDescriptor.new + merchant_descriptor.country = "US" + merchant_descriptor.postal_code = "94440" + merchant_descriptor.locality = "FC" + merchant_descriptor.name = "Thomas" + merchant_descriptor.administrative_area = "CA" + merchant_information.merchant_descriptor = merchant_descriptor + request.merchant_information = merchant_information + + payment_information = CyberSource::Ptsv2payoutsPaymentInformation.new + payment_information_card = CyberSource::Ptsv2payoutsPaymentInformationCard.new + payment_information_card.expiration_year = "2025" + payment_information_card.number = "4111111111111111" + payment_information_card.expiration_month = "12" + payment_information_card.type = "001" + payment_information_card.source_account_type = "CH" + payment_information.card = payment_information_card + request.payment_information = payment_information + + recipient_information = CyberSource::Ptsv2payoutsRecipientInformation.new + recipient_information.first_name = "John" + recipient_information.last_name = "Doe" + recipient_information.address1 = "Paseo Padre Boulevard" + recipient_information.locality = "Foster City" + recipient_information.administrative_area = "CA" + recipient_information.postal_code = "94400" + recipient_information.phone_number = "6504320556" + recipient_information.date_of_birth = "19801009" + recipient_information.country = "US" + request.recipient_information = recipient_information + + begin + response_body, response_code, response_headers = api_instance.oct_create_payment(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['status'] != ConstantUtility::STATUS_ACCEPTED + writeToCSV << [row[0], 'ProcessPayout', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACCEPTED, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'ProcessPayout', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['orderInformation']['amountDetails']['totalAmount'] == row[3] + writeToCSV << [row[0], 'ProcessPayout', 'Pass:' + response_code.to_s + '-' + resp['id'], row[4], DateTime.now] + else + writeToCSV << [row[0], 'ProcessPayout', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'ProcessPayout', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + ProcessAPayout.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateAdhocReportTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateAdhocReportTest.rb new file mode 100644 index 00000000..e905a873 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateAdhocReportTest.rb @@ -0,0 +1,57 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class CreateAdhocReport + def main() + config = MerchantConfiguration.new.merchantConfigProp() + request= CyberSource::RequestBody1.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\CreateAdhocReport.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + + request.report_definition_name = row[1] + request.report_fields=[ + "Request.RequestID", + "Request.TransactionDate", + "Request.MerchantID" + ] + request.report_mime_type="application/xml" + request.timezone = "GMT" + request.report_name = row[2] + request.report_start_time = row[3] + request.report_end_time = row[4] + report_pref = {} + report_pref['SignedAmounts'] = "true" + report_pref['fieldNameConvention'] = "SOAPI" + request.report_preferences = report_pref + + begin + response_body, response_code, response_headers = api_instance.create_report(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'CreateAdhocReport', 'Pass:' + response_code.to_s, row[5], DateTime.now] + else + writeToCSV << [row[0], 'CreateAdhocReport', 'Assertion Failed:' + response_code.to_s, row[5], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CreateAdhocReport', 'Fail:' + err.code.to_s, resp['message'] + '-' + resp['fields'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreateAdhocReport.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganizationTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganizationTest.rb new file mode 100644 index 00000000..5975eaee --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/CreateReportSubscriptionForReportNameByOrganizationTest.rb @@ -0,0 +1,51 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class CreateReportSubscriptionForReportNameByOrganization + def main() + config = MerchantConfiguration.new.merchantConfigProp() + request= CyberSource::RequestBody.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportSubscriptionsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\CreateReportSubscriptionForReportNameByOrganization.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + request.report_definition_name=row[1] + request.report_fields=[ + "Request.RequestID", + "Request.TransactionDate", + "Request.MerchantID" + ] + request.report_mime_type="text/csv" + request.report_name = row[2] + request.report_frequency= row[3] + request.timezone="America/Chicago" + request.start_time="0406" + request.start_day=1 + begin + response_body, response_code, response_headers = api_instance.create_subscription(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'CreateReportSubscriptionForReportNameByOrganization', 'Pass:' + response_code.to_s, row[4], DateTime.now] + else + writeToCSV << [row[0], 'CreateReportSubscriptionForReportNameByOrganization', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CreateReportSubscriptionForReportNameByOrganization', 'Fail:' + err.code.to_s, resp['message'] + '-' + resp['fields'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreateReportSubscriptionForReportNameByOrganization.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganizationTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganizationTest.rb new file mode 100644 index 00000000..da771e19 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DeleteSubscriptionOfReportNameByOrganizationTest.rb @@ -0,0 +1,40 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class DeleteSubscriptionOfReportNameByOrganization + def main(report_name) + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportSubscriptionsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\DeleteSubscriptionOfReportNameByOrganization.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + report_name = row[1] + begin + response_body, response_code, response_headers = api_instance.delete_subscription(report_name) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'DeleteSubscriptionOfReportNameByOrganization', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'DeleteSubscriptionOfReportNameByOrganization', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'DeleteSubscriptionOfReportNameByOrganization', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + DeleteSubscriptionOfReportNameByOrganization.new.main("testrest_subcription_v1") +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DownloadReportTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DownloadReportTest.rb new file mode 100644 index 00000000..ee8b9c58 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/DownloadReportTest.rb @@ -0,0 +1,49 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require 'csv' + +public +class DownloadReport + def main() + file_path = "..\\cybersource-rest-qa-ruby\\resource\\DownloadReport.xml" + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportDownloadsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\DownloadReport.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + opts = {} + opts[:'organization_id'] = row[1] + reportName = row[2] + reportDate = row[3] + begin + response_body, response_code, response_headers = api_instance.download_report(reportDate, reportName, opts) + if response_body != nil + f = File.new(file_path,"w") + f.write(response_body) + f.close + end + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil && response_body != nil + writeToCSV << [row[0], 'DownloadReport', 'Pass:' + response_code.to_s, row[4], DateTime.now] + else + writeToCSV << [row[0], 'DownloadReport', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'DownloadReport', 'Fail:' + err.code.to_s, row[4], DateTime.now] + end + else + puts err + end + end + end + end + DownloadReport.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetAllSubscriptionsTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetAllSubscriptionsTest.rb new file mode 100644 index 00000000..fc2ba735 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetAllSubscriptionsTest.rb @@ -0,0 +1,40 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetAllSubscriptions + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportSubscriptionsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetAllSubscriptions.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + begin + response_body, response_code, response_headers = api_instance.get_all_subscriptions() + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetAllSubscriptions', 'Pass:' + response_code.to_s, row[1], DateTime.now] + else + writeToCSV << [row[0], 'GetAllSubscriptions', 'Assertion Failed:' + response_code.to_s, row[1], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetAllSubscriptions', 'Fail:' + err.code.to_s, row[1], DateTime.now] + end + else + puts err + end + end + end + end + GetAllSubscriptions.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetNotificationOfChangesTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetNotificationOfChangesTest.rb new file mode 100644 index 00000000..1ad09b7f --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetNotificationOfChangesTest.rb @@ -0,0 +1,42 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetNotificationOfChanges + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::NotificationOfChangesApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetNotificationOfChanges.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + start_time = row[1] + end_time = row[2] + begin + response_body , response_code, response_headers = api_instance.get_notification_of_change_report(start_time, end_time) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetNotificationOfChanges', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'GetNotificationOfChanges', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetNotificationOfChanges', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + GetNotificationOfChanges.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetPurchaseAndRefundDetailsTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetPurchaseAndRefundDetailsTest.rb new file mode 100644 index 00000000..01c685da --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetPurchaseAndRefundDetailsTest.rb @@ -0,0 +1,49 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetPurchaseAndRefundDetails + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PurchaseAndRefundDetailsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetPurchaseAndRefundDetails.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + start_time = row[1] + end_time = row[2] + opts = {} + opts[:'organizationId'] = "testrest" + opts[:'paymentSubtype'] = "VI" + opts[:'viewBy'] = "requestDate" + opts[:'groupName'] = "groupName" + opts[:'offset'] = 20 + opts[:'limit'] = 200 + begin + response_body, response_code, response_headers = api_instance.get_purchase_and_refund_details(start_time, end_time, opts) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetPurchaseAndRefundDetails', 'Pass:' + response_code.to_s, row[4], DateTime.now] + else + writeToCSV << [row[0], 'GetPurchaseAndRefundDetails', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetPurchaseAndRefundDetails', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + GetPurchaseAndRefundDetails.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportBasedOnReportidTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportBasedOnReportidTest.rb new file mode 100644 index 00000000..a64a8f00 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportBasedOnReportidTest.rb @@ -0,0 +1,44 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetReportBasedOnReportid + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetReportBasedOnReportid.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + opts = {} + opts[:'organization_id'] = row[1] + id = row[2] + + begin + response_body, response_code, response_headers = api_instance.get_report_by_report_id(id, opts) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['reportId'] == row[2] + writeToCSV << [row[0], 'GetReportBasedOnReportid', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'GetReportBasedOnReportid', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetReportBasedOnReportid', 'Fail:' + err.code.to_s, row[3], DateTime.now] + end + else + puts err + end + end + end + end + GetReportBasedOnReportid.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportDefinitionTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportDefinitionTest.rb new file mode 100644 index 00000000..4c80b40c --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportDefinitionTest.rb @@ -0,0 +1,40 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetReportDefinition + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportDefinitionsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetReportDefinition.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + report_definition_name = row[1] + begin + response_body, response_code, response_headers = api_instance.get_resource_info_by_report_definition(report_definition_name) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['reportDefintionName'] == row[1] + writeToCSV << [row[0], 'GetReportDefinition', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'GetReportDefinition', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetReportDefinition', 'Fail:' + err.code.to_s, row[2], DateTime.now] + end + else + puts err + end + end + end + end + GetReportDefinition.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportingResourceInformationTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportingResourceInformationTest.rb new file mode 100644 index 00000000..319cc744 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetReportingResourceInformationTest.rb @@ -0,0 +1,39 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetReportingResourceInformation + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportDefinitionsApi.new(api_client, config) + opts = {} + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetReportingResourceInformation.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + opts[:'organization_id'] = row[1] + begin + response_body, response_code, response_headers = api_instance.get_resource_v2_info(opts) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetReportingResourceInformation', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'GetReportingResourceInformation', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetReportingResourceInformation', 'Fail:' + err.code.to_s, row[2], DateTime.now] + end + else + puts err + end + end + end + end + GetReportingResourceInformation.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetSubscriptionForReportNameTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetSubscriptionForReportNameTest.rb new file mode 100644 index 00000000..12028a72 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/GetSubscriptionForReportNameTest.rb @@ -0,0 +1,41 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +public +class GetSubscriptionForReportName + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportSubscriptionsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\GetSubscriptionForReportName.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + report_Name = row[1] + begin + response_body, response_code, response_headers = api_instance.get_subscription(report_Name) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['reportName'] == row[1] + writeToCSV << [row[0], 'GetSubscriptionForReportName', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'GetSubscriptionForReportName', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetSubscriptionForReportName', 'Fail:' + err.code.to_s, err.response_body['message'], DateTime.now] + end + else + puts err + end + end + end + end + GetSubscriptionForReportName.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/RetrieveAvailableReportsTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/RetrieveAvailableReportsTest.rb new file mode 100644 index 00000000..91455bbb --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/Reporting/CoreServices/RetrieveAvailableReportsTest.rb @@ -0,0 +1,44 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class RetrieveAvailableReports + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::ReportsApi.new(api_client, config) + opts = {} + csv_text = File.read("QaScripts\\CSV_Files\\Reporting\\CoreServices\\RetrieveAvailableReports.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + start_time = row[1] + end_time = row[2] + time_query_type = row[3] + opts[:'reportMimeType'] = "text/csv" + begin + response_body, response_code, response_headers = api_instance.search_reports(start_time, end_time, time_query_type, opts) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'RetrieveAvailableReports', 'Pass:' + response_code.to_s, row[4], DateTime.now] + else + writeToCSV << [row[0], 'RetrieveAvailableReports', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RetrieveAvailableReports', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + RetrieveAvailableReports.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/DownloadFileWithFileIdentifierTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/DownloadFileWithFileIdentifierTest.rb new file mode 100644 index 00000000..397d5221 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/DownloadFileWithFileIdentifierTest.rb @@ -0,0 +1,48 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class DownloadFileWithFileIdentifier + def main() + file_path = "..\\cybersource-rest-qa-ruby\\resource\\DownloadFileWithFileIdentifier.csv" + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::SecureFileShareApi.new(api_client, config) + opts = {} + csv_text = File.read("QaScripts\\CSV_Files\\SecureFileShare\\CoreServices\\DownloadFileWithFileIdentifier.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + file_id = row[2] + opts[:'organization_id'] = row[1] + begin + response_body, response_code, response_headers = api_instance.get_file(file_id, opts) + if response_body != nil + f = File.new(file_path,"w") + f.write(response_body) + f.close + end + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil && response_body != nil + writeToCSV << [row[0], 'DownloadFileWithFileIdentifier', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'DownloadFileWithFileIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'DownloadFileWithFileIdentifier', 'Fail:' + err.code.to_s, row[3], DateTime.now] + end + else + puts err + end + end + end + end + DownloadFileWithFileIdentifier.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/GetListOfFilesTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/GetListOfFilesTest.rb new file mode 100644 index 00000000..720b6314 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/SecureFileShare/CoreServices/GetListOfFilesTest.rb @@ -0,0 +1,43 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetListOfFiles + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::SecureFileShareApi.new(api_client, config) + opts = {} + csv_text = File.read("QaScripts\\CSV_Files\\SecureFileShare\\CoreServices\\GetListOfFiles.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + start_date = row[2] + end_date = row[3] + opts[:'organization_id'] = row[1] + begin + response_body, response_code, response_headers = api_instance.get_file_details(start_date, end_date, opts) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetListOfFiles', 'Pass:' + response_code.to_s, row[4], DateTime.now] + else + writeToCSV << [row[0], 'GetListOfFiles', 'Assertion Failed:' + response_code.to_s, row[4], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetListOfFiles', 'Fail:' + err.code.to_s, err.response_body, DateTime.now] + end + else + puts err + end + end + end + end + GetListOfFiles.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreateInstrumentIdentifierTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreateInstrumentIdentifierTest.rb new file mode 100644 index 00000000..951215b6 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreateInstrumentIdentifierTest.rb @@ -0,0 +1,67 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class CreateInstrumentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::Body.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::InstrumentIdentifiersApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\CreateInstrumentIdentifier.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[2] + + instrument_card_info = CyberSource::Tmsv1instrumentidentifiersCard.new + instrument_card_info.number = "1234567890123" + request.card = instrument_card_info + + instrument_processing_information_merchant_initiator = CyberSource::Tmsv1instrumentidentifiersAuthorizationOptionsMerchantInitiatedTransaction.new + instrument_processing_information_merchant_initiator.previous_transaction_id = row[1] + + + instrument_processing_information_initiator = CyberSource::Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiator.new + instrument_processing_information_initiator.merchant_initiated_transaction = instrument_processing_information_merchant_initiator + + instrument_processing_information_auth = CyberSource::Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptions.new + instrument_processing_information_auth.initiator = instrument_processing_information_initiator + + instrument_processing_information = CyberSource::Tmsv1instrumentidentifiersProcessingInformation.new + instrument_processing_information.authorization_options = instrument_processing_information_auth + + request.processing_information = instrument_processing_information + + begin + response_body, response_code, response_headers = api_instance.tms_v1_instrumentidentifiers_post(profile_id, request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'CreateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'CreateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['processingInformation']['authorizationOptions']['initiator']['merchantInitiatedTransaction']['previousTransactionId'] == row[1] + writeToCSV << [row[0], 'CreateInstrumentIdentifier', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'CreateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CreateInstrumentIdentifier', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreateInstrumentIdentifier.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreatePaymentInstrumentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreatePaymentInstrumentTest.rb new file mode 100644 index 00000000..0498f9ad --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/CreatePaymentInstrumentTest.rb @@ -0,0 +1,74 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class CreatePaymentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::Body2.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentInstrumentsApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\CreatePaymentsInstrument.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + card = CyberSource::Tmsv1paymentinstrumentsCard.new + card.expiration_month = "09" + card.expiration_year = "2022" + card.type = "visa" + request.card = card + + bill_to = CyberSource::Tmsv1paymentinstrumentsBillTo.new + bill_to.first_name = "John" + bill_to.last_name = "Deo" + bill_to.company = "CyberSource" + bill_to.address1 = "12 Main Street" + bill_to.address2 = "20 My Street" + bill_to.locality = "Foster City" + bill_to.administrative_area = "CA" + bill_to.postal_code = "90200" + bill_to.country = "US" + bill_to.email = "john.smith@example.com" + bill_to.phone_number = "555123456" + request.bill_to = bill_to + + instrument_identifier_card = CyberSource::Tmsv1instrumentidentifiersCard.new + instrument_identifier_card.number = "4111111111111111" + + instrument_identifier = CyberSource::Tmsv1paymentinstrumentsInstrumentIdentifier.new + instrument_identifier.card = instrument_identifier_card + request.instrument_identifier = instrument_identifier + + begin + response_body , response_code, response_headers = api_instance.tms_v1_paymentinstruments_post(profile_id, request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'CreatePaymentInstrument', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'CreatePaymentInstrument', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif response_code != nil + writeToCSV << [row[0], 'CreatePaymentInstrument', 'Pass:' + response_code.to_s + '-' + resp['id'], row[2], DateTime.now] + else + writeToCSV << [row[0], 'CreatePaymentInstrument', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CreatePaymentInstrument', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreatePaymentIdentifier.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeleteInstrumentIdentifierTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeleteInstrumentIdentifierTest.rb new file mode 100644 index 00000000..b4da1272 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeleteInstrumentIdentifierTest.rb @@ -0,0 +1,42 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class DeleteInstrumentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::InstrumentIdentifierApi.new(api_client,config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\DeleteInstrumentIdentifier.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + + begin + response_body , response_code, response_headers = api_instance.tms_v1_instrumentidentifiers_token_id_delete(profile_id, row[2]) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'DeleteInstrumentIdentifier', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'DeleteInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'DeleteInstrumentIdentifier', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + DeleteInstrumentIdentifier.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeletePaymentInstrumentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeletePaymentInstrumentTest.rb new file mode 100644 index 00000000..b2e7db33 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/DeletePaymentInstrumentTest.rb @@ -0,0 +1,42 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class DeletePaymentInstrument + def main + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentInstrumentsApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\DeletePaymentInstrument.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + token_id = row[2] + begin + response_body , response_code, response_headers = api_instance.tms_v1_paymentinstruments_token_id_delete(profile_id, token_id) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'DeletePaymentInstrument', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'DeletePaymentInstrument', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'DeletePaymentInstrument', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + DeletePaymentInstrument.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveAllPaymentInstrumentsTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveAllPaymentInstrumentsTest.rb new file mode 100644 index 00000000..d2b9ca6b --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveAllPaymentInstrumentsTest.rb @@ -0,0 +1,43 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RetrieveAllPaymentInstruments + def main + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentInstrumentsApi.new(api_client, config) + + #Reading from input CSV file + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\RetrieveAllPaymentInstruments.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + token_id = row[2] + begin + response_body, response_code, response_headers = api_instance.tms_v1_instrumentidentifiers_token_id_paymentinstruments_get(profile_id, token_id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['_links']['self']['href'].include? row[2] + writeToCSV << [row[0], 'RetrieveAllPaymentInstruments', 'Pass:' + response_code.to_s + '-' + row[2], row[3], DateTime.now] + else + writeToCSV << [row[0], 'RetrieveAllPaymentInstruments', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RetrieveAllPaymentInstruments', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + RetrieveAllPaymentInstruments.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveInstrumentIdentifierTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveInstrumentIdentifierTest.rb new file mode 100644 index 00000000..ffb19008 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrieveInstrumentIdentifierTest.rb @@ -0,0 +1,46 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RetrieveInstrumentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::InstrumentIdentifierApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\RetrieveInstrumentIdentifier.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + begin + response_body , response_code, response_headers = api_instance.tms_v1_instrumentidentifiers_token_id_get(profile_id, row[2]) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'RetrieveInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'RetrieveInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['id'] == row[2] + writeToCSV << [row[0], 'RetrieveInstrumentIdentifier', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'RetrieveInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RetrieveInstrumentIdentifier', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + RetrieveInstrumentIdentifier.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrievePaymentInstrumentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrievePaymentInstrumentTest.rb new file mode 100644 index 00000000..48726c42 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/RetrievePaymentInstrumentTest.rb @@ -0,0 +1,47 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RetrievePaymentInstrument + def main + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentInstrumentsApi.new(api_client, config) + + #Reading from input CSV file-- + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\RetrievePaymentInstrument.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + + begin + response_body , response_code, response_headers = api_instance.tms_v1_paymentinstruments_token_id_get(profile_id, row[2]) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'RetrievePaymentInstrument', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'RetrievePaymentInstrument', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['id'] == row[2] + writeToCSV << [row[0], 'RetrievePaymentInstrument', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'RetrievePaymentInstrument', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RetrievePaymentInstrument', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + RetrievePaymentInstrument.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdateInstrumentIdentifierTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdateInstrumentIdentifierTest.rb new file mode 100644 index 00000000..f5b8d134 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdateInstrumentIdentifierTest.rb @@ -0,0 +1,65 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +# * This is a sample code to call InstrumentIdentifierApi, +# * Update an Instrument Identifier +# * Include the profile_id, token_id in the POST request to create a instrument identifier. + +public +class UpdateInstrumentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + body = CyberSource::Body1.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::InstrumentIdentifierApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\UpdateInstrumentIdentifier.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + + merchant_initiated_transaction = CyberSource::Tmsv1instrumentidentifiersAuthorizationOptionsMerchantInitiatedTransaction.new + previous_transaction_id = "123456789012345" + merchant_initiated_transaction.previous_transaction_id = previous_transaction_id + + initiator = CyberSource::Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiator.new + initiator.merchant_initiated_transaction = merchant_initiated_transaction + + authorization_options = CyberSource::Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptions.new + authorization_options.initiator = initiator + + processing_information = CyberSource::Tmsv1instrumentidentifiersProcessingInformation.new + processing_information.authorization_options = authorization_options + + body.processing_information = processing_information + begin + response_body , response_code, response_headers = api_instance.tms_v1_instrumentidentifiers_token_id_patch(profile_id, row[2], body) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['id'] == row[2] + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + UpdateInstrumentIdentifier.new.main +end \ No newline at end of file diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdatePaymentInstrumentTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdatePaymentInstrumentTest.rb new file mode 100644 index 00000000..8cd7bbbb --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TMS/CoreServices/UpdatePaymentInstrumentTest.rb @@ -0,0 +1,74 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +# * This is a sample code to call InstrumentIdentifierApi, +# * Update an Payment Identifier +# * Include the profile_id, token_id in the POST body to create a payment identifier. + +public +class UpdatePaymentIdentifier + def main + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::Body3.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::PaymentInstrumentsApi.new(api_client, config) + csv_text = File.read("QaScripts\\CSV_Files\\TMS\\CoreServices\\UpdatePaymentInstrument.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + profile_id = row[1] + card = CyberSource::Tmsv1paymentinstrumentsCard.new + card.expiration_month = "09" + card.expiration_year = "2022" + card.type = "visa" + request.card = card + + bill_to = CyberSource::Tmsv1paymentinstrumentsBillTo.new + bill_to.first_name = "John" + bill_to.last_name = "Deo" + bill_to.company = "CyberSource" + bill_to.address1 = "12 Main Street" + bill_to.address2 = "20 My Street" + bill_to.locality = "Foster City" + bill_to.administrative_area = "CA" + bill_to.postal_code = "90200" + bill_to.country = "US" + bill_to.email = "john.smith@example.com" + bill_to.phone_number = "555123456" + request.bill_to = bill_to + + instrument_identifier_card = CyberSource::Tmsv1instrumentidentifiersCard.new + instrument_identifier_card.number = "4111111111111111" + instrument_identifier = CyberSource::Tmsv1paymentinstrumentsInstrumentIdentifier.new + instrument_identifier.card = instrument_identifier_card + request.instrument_identifier = instrument_identifier + begin + response_body , response_code, response_headers = api_instance.tms_v1_paymentinstruments_token_id_patch(profile_id, row[2], request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['state'] != ConstantUtility::STATE_ACTIVE + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_ACTIVE, DateTime.now] + elsif resp['id'] == nil + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, ConstantUtility::MESSAGE_NULL_ID, DateTime.now] + elsif resp['id'] == row[2] + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Pass:' + response_code.to_s + '-' + resp['id'], row[3], DateTime.now] + else + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'UpdateInstrumentIdentifier', 'Fail:' + err.code.to_s, resp['errors'][0]['message'], DateTime.now] + end + else + puts err + end + end + end + end + UpdatePaymentIdentifier.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetIndividualBatchFileTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetIndividualBatchFileTest.rb new file mode 100644 index 00000000..87074cb4 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetIndividualBatchFileTest.rb @@ -0,0 +1,42 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetIndividualBatchFile + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::TransactionBatchApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TransactionBatches\\CoreServices\\GetIndividualBatchFile.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + id = row[1] + begin + response_body, response_code, response_headers = api_instance.pts_v1_transaction_batches_id_get(id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['id'] == row[1] + writeToCSV << [row[0], 'GetIndividualBatchFile', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'GetIndividualBatchFile', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetIndividualBatchFile', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + GetIndividualBatchFile.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetListOfBatchFilesTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetListOfBatchFilesTest.rb new file mode 100644 index 00000000..4e6594b6 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionBatches/CoreServices/GetListOfBatchFilesTest.rb @@ -0,0 +1,43 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetListOfBatchFiles + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::TransactionBatchesApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TransactionBatches\\CoreServices\\GetListOfBatchFiles.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + start_time = row[1] + end_time = row[2] + begin + response_body, response_code, response_headers = api_instance.pts_v1_transaction_batches_get(start_time, end_time) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if response_code != nil + writeToCSV << [row[0], 'GetListOfBatchFiles', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'GetListOfBatchFiles', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetListOfBatchFiles', 'Fail:' + err.code.to_s, resp['message'] + '-' + resp['invalidFields']['reasonMessage'], DateTime.now] + end + else + puts err + end + end + end + end + GetListOfBatchFiles.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TransactionDetails/CoreServices/RetrieveTransactionTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionDetails/CoreServices/RetrieveTransactionTest.rb new file mode 100644 index 00000000..7184df08 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionDetails/CoreServices/RetrieveTransactionTest.rb @@ -0,0 +1,43 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' +require_relative '../../ConstantUtility.rb' + +public +class RetrieveTransaction + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::TransactionDetailsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TransactionDetails\\CoreServices\\RetrieveTransaction.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + id = row[1] + begin + response_body, response_code, response_headers = api_instance.get_transaction(id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['id'] == row[1] + writeToCSV << [row[0], 'RetrieveTransaction', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'RetrieveTransaction', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'RetrieveTransaction', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + RetrieveTransaction.new.main +end + + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/CreateSearchRequestTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/CreateSearchRequestTest.rb new file mode 100644 index 00000000..c5c0141b --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/CreateSearchRequestTest.rb @@ -0,0 +1,48 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class CreateSearchRequest + def main() + config = MerchantConfiguration.new.merchantConfigProp() + request = CyberSource::TssV2TransactionsPostResponse.new + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::SearchTransactionsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TransactionSearch\\CoreServices\\CreateSearchRequest.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + request.save = "false" + request.name = row[1] + request.timezone = "America/Chicago" + request.query = row[2] + request.offset = 0 + request.limit = 100 + request.sort = "id:asc,submitTimeUtc:asc" + begin + response_body, response_code, response_headers = api_instance.create_search(request) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['name'] == row[1] + writeToCSV << [row[0], 'CreateSearchRequest', 'Pass:' + response_code.to_s, row[3], DateTime.now] + else + writeToCSV << [row[0], 'CreateSearchRequest', 'Assertion Failed:' + response_code.to_s, row[3], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + resp = JSON.parse(err.response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'CreateSearchRequest', 'Fail:' + err.code.to_s, resp['message'], DateTime.now] + end + else + puts err + end + end + end + end + CreateSearchRequest.new.main +end + diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/GetSearchResultsTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/GetSearchResultsTest.rb new file mode 100644 index 00000000..c3681dca --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/TransactionSearch/CoreServices/GetSearchResultsTest.rb @@ -0,0 +1,39 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetSearchResults + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::SearchTransactionsApi.new(api_client, config) + + csv_text = File.read("QaScripts\\CSV_Files\\TransactionSearch\\CoreServices\\GetSearchResults.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + id = row[1] + begin + response_body, response_code, response_headers = api_instance.get_search(id) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['searchId'] == row[1] + writeToCSV << [row[0], 'GetSearchResults', 'Pass:' + response_code.to_s, row[2], DateTime.now] + else + writeToCSV << [row[0], 'GetSearchResults', 'Assertion Failed:' + response_code.to_s, row[2], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetSearchResults', 'Fail:' + err.code.to_s, row[2], DateTime.now] + end + else + puts err + end + end + end + end + GetSearchResults.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/QaScripts/UserManagement/CoreServices/GetUserInformationTest.rb b/spec/cybersource-rest-qa-ruby/QaScripts/UserManagement/CoreServices/GetUserInformationTest.rb new file mode 100644 index 00000000..cfa98312 --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/QaScripts/UserManagement/CoreServices/GetUserInformationTest.rb @@ -0,0 +1,39 @@ +require 'cybersource_rest_client' +require_relative '../../../data/Configuration.rb' + +public +class GetUserInformation + def main() + config = MerchantConfiguration.new.merchantConfigProp() + api_client = CyberSource::ApiClient.new + api_instance = CyberSource::UserManagementApi.new(api_client, config) + opts = {} + csv_text = File.read("QaScripts\\CSV_Files\\UserManagement\\CoreServices\\GetUserInformation.csv") + csv = CSV.parse(csv_text, :headers => true) + csv.each do |row| + opts[:'organization_id'] = row[1] + begin + response_body, response_code, response_headers = api_instance.get_users(opts) + resp = JSON.parse(response_body) + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + if resp['users'][0]['organizationInformation']['organizationId'] == row[1] + writeToCSV << [row[0], 'GetUserInformation', 'Pass:' + response_code.to_s, row[5], DateTime.now] + else + writeToCSV << [row[0], 'GetUserInformation', 'Assertion Failed:' + response_code.to_s, row[5], DateTime.now] + end + end + rescue StandardError => err + if err.response_body != nil + #Writing to output CSV file + CSV.open("QaScripts\\CSV_Files\\TestReport\\TestResults.csv", "a+") do |writeToCSV| + writeToCSV << [row[0], 'GetUserInformation', 'Fail:' + err.code.to_s, row[5], DateTime.now] + end + else + puts err + end + end + end + end + GetUserInformation.new.main +end diff --git a/spec/cybersource-rest-qa-ruby/data/Configuration.rb b/spec/cybersource-rest-qa-ruby/data/Configuration.rb new file mode 100644 index 00000000..6dc0253e --- /dev/null +++ b/spec/cybersource-rest-qa-ruby/data/Configuration.rb @@ -0,0 +1,43 @@ +public +class MerchantConfiguration + def merchantConfigProp() + merchantId='testrest' + runEnvironment='cybersource.environment.sandbox' + timeout=1000 #In Milliseconds + authenticationType='http_signature' + logDirectory='../log' + jsonFilePath='resource/request.json' + logSize=10485760 + enableLog=false + # proxyAddress='userproxy.com' + # proxyPort=123 + # HTTP Parameters + merchantKeyId='08c94330-f618-42a3-b09d-e1e43be5efda' + merchantSecretKey='yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE=' + # JWT Parameters + keysDirectory='resource' + keyAlias='testrest' + keyPass='testrest' + keyFilename='testrest' + logFilename='cybs' + configurationDictionary={} + configurationDictionary['merchantID']=merchantId + configurationDictionary['runEnvironment']=runEnvironment + configurationDictionary['timeout']=timeout + configurationDictionary['authenticationType']=authenticationType + configurationDictionary['logDirectory']=logDirectory + configurationDictionary['jsonFilePath']=jsonFilePath + configurationDictionary['logSize']=logSize + configurationDictionary['enableLog']=enableLog + # configurationDictionary['proxyPort']=proxyPort + # configurationDictionary['proxyAddress']=proxyAddress + configurationDictionary['merchantsecretKey']=merchantSecretKey + configurationDictionary['merchantKeyId']=merchantKeyId + configurationDictionary['keysDirectory']=keysDirectory + configurationDictionary['keyAlias']=keyAlias + configurationDictionary['keyPass']=keyPass + configurationDictionary['keyFilename'] = keyFilename + configurationDictionary['logFilename'] = logFilename + return configurationDictionary + end +end diff --git a/spec/cybersource-rest-qa-ruby/resource/testrest.p12 b/spec/cybersource-rest-qa-ruby/resource/testrest.p12 new file mode 100644 index 0000000000000000000000000000000000000000..3d09e55046312f3bef42e7cb484a136f634fa58a GIT binary patch literal 3553 zcmV<74Ic6^f(_jQ0Ru3C4XFkRDuzgg_YDCD0ic2nngoIkmN0@1k}!e|js^)ThDe6@ z4FLxRpn?s5FoF$x0s#Opf(>*A2`Yw2hW8Bt2LUh}1_~;MNQUQkbqpg46XHX@GI1jWh39@8Qcb& z&$kUn89}Mb4l)mj6ihZC^i?l3x20q?Txx9o19{;U6#$K_GIqRUL= z@~YOF0BeJE0w{d2Iy^EVi+#A&VF#o19;25+L$YU%hBN9xDWlac8fq2vuhnRU_rR2i zPIW1D9w@ZPAJjOSk3lp{kWE+(Yi&I8*HarZ*k7!yuW5N726MvVIvUR?!#n#FFv5M$m%9Z=joe=2OA(z^)4xh@nf`(GZAX!Ookw~j!0wkQDVHd zNvqyD(5Nq-rAwrnKigEnl)P5T$s0m+LTX&H-X zKz8R`anCxjw*o!jQ9CSvg)HNyGs!?mDi9W+82V!ZHWgHsK|u}%A@Fq@)rScoWx3HE zpz`(8T$ft}vZlmO%r?Dh{T5~(ZUeT0#RO2&HHM$*Na*sg3jo|yI2krj8RJLArd625 z5l6K87`|@!QcK&4X^BQ0n+=sujnGOOJQ0$DqGexq_nB-wuOY@0tntl!XD^E82Yl;t z2AC(Cc1F54*tSr-z(nd>@w?p|lE8l0;fC5mG;5HYx_dsX6OPP!GqW>fLgS@q62UIDseGr(d`VM`!J#QUuv(}{Xb}|W-K`O zB;muP)I2*{Mi-S#=SiCu_%X48pjPc2XDBvxbK$OvdrZupyS(o*l<<=#=Kbd(T{pV# zci8?OXe6RcMuuaREE|+(SlCA!O z>8|cZ+JSfo@hcv_rys>*v4t;H`32 zD|!0c7%<7#p1L@m?O}zP%9a)BVF3g zJw_t?RnenMMXpNy#HP*5jwYLhGjHT9$JCs$1eH-QQqvyeGm#G4A(Uek8pw@Eb`2KC z9{zr;>FsCTGx{3-oW4N(kldXpzJx`yTJ9ak>xm+eMZGE!gy(D2HwElu&K^$C=b1tk zLKs7XMR?C!hfLKWu@i^VQtMeJ@&Is`yPH*SjsIu-*Wa3FU$mlS5c z&_ybOS;lvjeDu9%3T!kexLrt6Zi7sDT(bQKZ=n7t78Ie>6VdAKr=q#l+4c^vd+&k0 za0&`ui@RI*?@NR2G`S$`{QHmgGQpxCCyg5)j@&N1s5Ir#kp#_3R~inbg<{io$8oHJ z8>uOyVY4Ze_)px4d|iI!GS-&RA1u#r!U%1`0JaF|9;c~%uR3=!;2{o|d0VB=`Y>l! z?5}n(!tr0-CH=b!T@e9yImd}V5=A$tKD#HdNTt!AWxQ)U+^~7)Diwi)gf(1hW39EnY;(Zpe?k&K$gd9yQE^b4 zR`%f|1b4LPZKOHer~%98ygE(#$R8||TA@vEZ?HU!yo|O;;q)Tq{2x@0J{@0Qk4O&r zgQuH3)@RZ3UOd%EjtgPDJ4vs{bmg7wglM)m)+&mxU~Xa}b2Z!C6*X`Q?LVZ%*w_+x zQAjOTuX$r;qh6@5TV^tV_m~XPC*>L5l5)wcy|c^Wqbtc<5`QT51gA6Hi4oNLw8JmE*yUr2?fdGz2Jd6re)2y%Xv$Jz>R| zaDg@^x(PPoIvsom)-K3LkltcMzt}{QY%5(H%vlR}jOmjMbC}jI6?-x7jFRd9jy^r! z+rpt+ol$|{By+Y6sXmMX&wT<=)|kLYejbZfrE8%jcsS79wccmZxB0aX{GJEymcGSJ zmA_F5Ry72koG|+stw78Sl0OAX&I|l%rI5w6HljR_M!3Z93nHALZJ2$O5LLOHQS;L` zaqPB>t}*RJMqL~XIN)K_#c6?7c!TTj!p~F0R;pj7i0u>;*rFVBxR93hj>-CLq_*a1 zO3X~Yt>=8y*}|ZaZ8!J3ss1Z46x0-P+4z;Tm}qYSqM;LG8*p@Hx!;U|%c4bs`Q4!| z-lN7+`8^MOuiIYjtNxr&3ncRS9 z(LHHUX4qH-j*9P-un{}`j{*GzxJ3P@FTpPm74zPD)#=6Ov$_&JhT|};P(?{q)<0Zz zmis?5tQCcJ)c5)1ob(zuh(qjy@mB@dCJU@iVJ-S z2>TJxPr2&vmB|(BE~oxHLM``*uub<601(Njr+6pz10kc zPMgpES~6*u48~_?GXW-(fU&&)WOmcK!n}RoB_%Vgbc7r(-v2={_w2 z1^8z@y~-Y>tI+zhNYPuX(c~5r;PUp{jzX#F4ImD>J<_ zpU?5963SqLfwKQbg#za%A&IJxsqi~BF;faoNrtx=M-8}5s3s2-=z;6Svsz)aP z3%zxcpoExEty-`C0su(ba(pNOMlTcqb-6cye^}&|M0d!xU|oyPN;#?EoiU+9P~Nhu zMe>|>Z@-*C@GqqE45raHe zzSZ~VKDO4I!vM)$Q9Hgf{?bT{sRXsBpxMslR?%Ms2LPy&8ycS@)m#g5^n1@j6iR=% zqbF%z8(iU(g~-v_p^|35yvG5rsSj6Y12}b@<14{_kjGYUBmcF4liX) zje+IOe%{ajFCejlJik{P73|h3VAE literal 0 HcmV?d00001