globalpayments-api 3.7.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/LICENSE.md +257 -257
- package/README.md +141 -141
- package/lib/src/Builders/BaseBuilder/Validations.js +1 -1
- package/lib/src/Builders/BaseBuilder/Validations.js.map +1 -1
- package/lib/src/Builders/ManagementBuilder.d.ts +26 -6
- package/lib/src/Builders/ManagementBuilder.js +66 -34
- package/lib/src/Builders/ManagementBuilder.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +19 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.d.ts +2 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js +86 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js.map +1 -1
- package/lib/src/Builders/TransactionReportBuilder.d.ts +5 -2
- package/lib/src/Builders/TransactionReportBuilder.js +19 -0
- package/lib/src/Builders/TransactionReportBuilder.js.map +1 -1
- package/lib/src/Entities/AdditionalTaxDetails.d.ts +5 -0
- package/lib/src/Entities/AdditionalTaxDetails.js +10 -0
- package/lib/src/Entities/AdditionalTaxDetails.js.map +1 -0
- package/lib/src/Entities/CommercialData.d.ts +26 -0
- package/lib/src/Entities/CommercialData.js +36 -0
- package/lib/src/Entities/CommercialData.js.map +1 -0
- package/lib/src/Entities/CommercialLineItem.d.ts +21 -0
- package/lib/src/Entities/CommercialLineItem.js +24 -0
- package/lib/src/Entities/CommercialLineItem.js.map +1 -0
- package/lib/src/Entities/DiscountDetails.d.ts +8 -0
- package/lib/src/Entities/DiscountDetails.js +13 -0
- package/lib/src/Entities/DiscountDetails.js.map +1 -0
- package/lib/src/Entities/DisputeDocument.d.ts +5 -0
- package/lib/src/Entities/DisputeDocument.js +10 -0
- package/lib/src/Entities/DisputeDocument.js.map +1 -0
- package/lib/src/Entities/Document.d.ts +10 -0
- package/lib/src/Entities/Document.js +13 -0
- package/lib/src/Entities/Document.js.map +1 -0
- package/lib/src/Entities/Enums/DisputeSortProperty.d.ts +12 -0
- package/lib/src/Entities/Enums/DisputeSortProperty.js +17 -0
- package/lib/src/Entities/Enums/DisputeSortProperty.js.map +1 -0
- package/lib/src/Entities/Enums/DisputeStage.d.ts +11 -0
- package/lib/src/Entities/Enums/DisputeStage.js +16 -0
- package/lib/src/Entities/Enums/DisputeStage.js.map +1 -0
- package/lib/src/Entities/Enums/DisputeStatus.d.ts +7 -0
- package/lib/src/Entities/Enums/DisputeStatus.js +12 -0
- package/lib/src/Entities/Enums/DisputeStatus.js.map +1 -0
- package/lib/src/Entities/Enums/DocumentCategory.d.ts +5 -0
- package/lib/src/Entities/Enums/DocumentCategory.js +10 -0
- package/lib/src/Entities/Enums/DocumentCategory.js.map +1 -0
- package/lib/src/Entities/Enums/FileType.d.ts +11 -0
- package/lib/src/Entities/Enums/FileType.js +16 -0
- package/lib/src/Entities/Enums/FileType.js.map +1 -0
- package/lib/src/Entities/Enums.d.ts +17 -1
- package/lib/src/Entities/Enums.js +20 -2
- package/lib/src/Entities/Enums.js.map +1 -1
- package/lib/src/Entities/HostedPaymentData.d.ts +3 -0
- package/lib/src/Entities/HostedPaymentData.js +3 -0
- package/lib/src/Entities/HostedPaymentData.js.map +1 -1
- package/lib/src/Entities/Reporting/DisputeSummary.d.ts +53 -0
- package/lib/src/Entities/Reporting/DisputeSummary.js +64 -0
- package/lib/src/Entities/Reporting/DisputeSummary.js.map +1 -0
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.d.ts +4 -2
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js +2 -0
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js.map +1 -1
- package/lib/src/Entities/Reporting/index.d.ts +1 -0
- package/lib/src/Entities/Reporting/index.js +1 -0
- package/lib/src/Entities/Reporting/index.js.map +1 -1
- package/lib/src/Entities/Transaction.js +3 -0
- package/lib/src/Entities/Transaction.js.map +1 -1
- package/lib/src/Entities/TransactionSummary.d.ts +1 -0
- package/lib/src/Entities/TransactionSummary.js +1 -0
- package/lib/src/Entities/TransactionSummary.js.map +1 -1
- package/lib/src/Entities/index.d.ts +7 -0
- package/lib/src/Entities/index.js +7 -0
- package/lib/src/Entities/index.js.map +1 -1
- package/lib/src/Gateways/GpApiConnector.js +3 -0
- package/lib/src/Gateways/GpApiConnector.js.map +1 -1
- package/lib/src/Gateways/GpEcomConnector.js +9 -0
- package/lib/src/Gateways/GpEcomConnector.js.map +1 -1
- package/lib/src/Gateways/PayPlanConnector.d.ts +1 -1
- package/lib/src/Gateways/PorticoConnector.d.ts +3 -3
- package/lib/src/Gateways/PorticoConnector.js +117 -4
- package/lib/src/Gateways/PorticoConnector.js.map +1 -1
- package/lib/src/Mapping/GpApiMapping.d.ts +2 -1
- package/lib/src/Mapping/GpApiMapping.js +75 -2
- package/lib/src/Mapping/GpApiMapping.js.map +1 -1
- package/lib/src/Services/ReportingService.d.ts +6 -1
- package/lib/src/Services/ReportingService.js +15 -0
- package/lib/src/Services/ReportingService.js.map +1 -1
- package/lib/test/Integration/Gateways/GpApiConnector/{3DS2Test.js → 3DS2.test.js} +338 -341
- package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{3DSecureTest.js → 3DSecure.test.js} +167 -173
- package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js +130 -0
- package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js +1070 -0
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{DebitCardTest.js → DebitCard.test.js} +27 -33
- package/lib/test/Integration/Gateways/GpApiConnector/DebitCard.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{GpApiCertificationTest.js → GpApiCertification.test.js} +211 -208
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertification.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js +151 -0
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{ReportingDepositsTest.js → ReportingDeposits.test.js} +103 -103
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingDeposits.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js +571 -0
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{ReportingSettlementTransactionsTest.js → ReportingSettlementTransactions.test.js} +104 -108
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactions.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{ReportingStoredPaymentMethodsTest.js → ReportingStoredPaymentMethods.test.js} +75 -76
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethods.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/{ReportingTransactionsTest.js → ReportingTransactions.test.js} +97 -95
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactions.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AuthTest.js → Auth.test.js} +441 -461
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Auth.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AvsTest.js → Avs.test.js} +274 -218
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Avs.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{CreditTest.js → Credit.test.js} +317 -321
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Credit.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{HoldTest.js → Hold.test.js} +290 -257
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Hold.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/{CreditTest.js → Credit.test.js} +76 -84
- package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js +137 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js +124 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js +54 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js +357 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceTest.js → Ecommerce.test.js} +403 -459
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceCheckTest.js → EcommerceCheck.test.js} +17 -23
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheck.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoTest.js → Moto.test.js} +377 -650
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Moto.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoCheckTest.js → MotoCheck.test.js} +16 -22
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheck.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js +393 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RetailTest.js → Retail.test.js} +481 -600
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Retail.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +433 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/{DebitTest.js → Debit.test.js} +32 -37
- package/lib/test/Integration/Gateways/PorticoConnector/Debit.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/{EbtTest.js → Ebt.test.js} +30 -39
- package/lib/test/Integration/Gateways/PorticoConnector/Ebt.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/{EcommerceTest.js → Ecommerce.test.js} +38 -45
- package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js +121 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/{PorticoManagementTokenTest.js → PorticoManagementToken.test.js} +8 -16
- package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementToken.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js +87 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js.map +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/{ReportingTest.js → Reporting.test.js} +12 -18
- package/lib/test/Integration/Gateways/PorticoConnector/Reporting.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{GetInformationCertificationTest.js → GetInformationCertification.test.js} +12 -18
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertification.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayAccountCertificationTest.js → ProPayAccountCertification.test.js} +49 -64
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertification.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayFundCertificationTest.js → ProPayFundCertification.test.js} +14 -22
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertification.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayInNetworkTransactionCertificationTest.js → ProPayInNetworkTransactionCertification.test.js} +18 -26
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertification.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/{GetInformationTest.js → GetInformation.test.js} +11 -18
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformation.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/{ProPayAccountTest.js → ProPayAccount.test.js} +63 -83
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccount.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/{ProPayFundsTest.js → ProPayFunds.test.js} +15 -22
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFunds.test.js.map +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/{ProPayInNetworkTransactionTest.js → ProPayInNetworkTransaction.test.js} +17 -25
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransaction.test.js.map +1 -0
- package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js +165 -0
- package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js.map +1 -0
- package/lib/test/Integration/Services/{CheckServiceTest.js → CheckService.test.js} +11 -18
- package/lib/test/Integration/Services/CheckService.test.js.map +1 -0
- package/lib/test/Integration/Services/{CreditServiceTest.js → CreditService.test.js} +48 -64
- package/lib/test/Integration/Services/CreditService.test.js.map +1 -0
- package/lib/test/Integration/Services/{DebitServiceTest.js → DebitService.test.js} +28 -32
- package/lib/test/Integration/Services/DebitService.test.js.map +1 -0
- package/lib/test/Integration/Services/{EBTServiceTest.js → EBTService.test.js} +16 -26
- package/lib/test/Integration/Services/EBTService.test.js.map +1 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js +122 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js.map +1 -0
- package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js +66 -0
- package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js.map +1 -0
- package/lib/test/Unit/Gateways/GpEcomConnector/{CreditTest.js → Credit.test.js} +13 -15
- package/lib/test/Unit/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js +128 -0
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js.map +1 -0
- package/package.json +7 -17
- package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +0 -109
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +0 -1025
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +0 -439
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +0 -149
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +0 -99
- package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +0 -1
- package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +0 -133
- package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -59
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -378
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -420
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -392
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -147
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -101
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +0 -1
- package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +0 -149
- package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +0 -1
- package/lib/test/Integration/Services/CheckServiceTest.js.map +0 -1
- package/lib/test/Integration/Services/CreditServiceTest.js.map +0 -1
- package/lib/test/Integration/Services/DebitServiceTest.js.map +0 -1
- package/lib/test/Integration/Services/EBTServiceTest.js.map +0 -1
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -111
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +0 -1
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -62
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +0 -1
- package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -125
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +0 -1
- /package/lib/test/Integration/Gateways/GpApiConnector/{3DS2Test.d.ts → 3DS2.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{3DSecureTest.d.ts → 3DSecure.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{AccessTokenTest.d.ts → AccessToken.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{CreditCardNotPresentTest.d.ts → CreditCardNotPresent.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{CreditCardPresentTest.d.ts → DebitCard.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{DebitCardTest.d.ts → GpApiCertification.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{GpApiCertificationTest.d.ts → GpApiTokenManagement.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{GpApiTokenManagementTest.d.ts → ReportingDeposits.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingDepositsTest.d.ts → ReportingDisputes.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingSettlementTransactionsTest.d.ts → ReportingSettlementTransactions.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingStoredPaymentMethodsTest.d.ts → ReportingStoredPaymentMethods.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingTransactionsTest.d.ts → ReportingTransactions.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AuthTest.d.ts → Auth.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AvsTest.d.ts → Avs.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{HoldTest.d.ts → Hold.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/{HppTest.d.ts → Hpp.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/GpEcomConnector/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{AchTest.d.ts → Ach.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{CheckTest.d.ts → Check.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceCheckTest.d.ts → Ecommerce.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceTest.d.ts → EcommerceCheck.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoCheckTest.d.ts → Moto.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoTest.d.ts → MotoCheck.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RetailTest.d.ts → Retail.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{DebitTest.d.ts → Debit.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{EbtTest.d.ts → Ebt.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{EcommerceTest.d.ts → Ecommerce.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{GiftTest.d.ts → Gift.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{PorticoManagementTokenTest.d.ts → PorticoManagementToken.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/PorticoConnector/{ReportingTest.d.ts → Reporting.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{GetInformationCertificationTest.d.ts → GetInformationCertification.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayAccountCertificationTest.d.ts → ProPayAccountCertification.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayFundCertificationTest.d.ts → ProPayFundCertification.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayInNetworkTransactionCertificationTest.d.ts → ProPayInNetworkTransactionCertification.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/{GetInformationTest.d.ts → GetInformation.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayAccountTest.d.ts → ProPayAccount.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayFundsTest.d.ts → ProPayFunds.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayInNetworkTransactionTest.d.ts → ProPayInNetworkTransaction.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/Terminals/UPA/{UpaMicTest.d.ts → UpaMic.test.d.ts} +0 -0
- /package/lib/test/Integration/Services/{CheckServiceTest.d.ts → CheckService.test.d.ts} +0 -0
- /package/lib/test/Integration/Services/{CreditServiceTest.d.ts → CreditService.test.d.ts} +0 -0
- /package/lib/test/Integration/Services/{DebitServiceTest.d.ts → DebitService.test.d.ts} +0 -0
- /package/lib/test/Integration/Services/{EBTServiceTest.d.ts → EBTService.test.d.ts} +0 -0
- /package/lib/test/Unit/Builders/AuthorizationBuilder/{ValidationTest.d.ts → Validation.test.d.ts} +0 -0
- /package/lib/test/Unit/Builders/ReportBuilder/{ValidationTest.d.ts → Validation.test.d.ts} +0 -0
- /package/lib/test/Unit/Gateways/GpEcomConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
- /package/lib/test/Unit/Gateways/PorticoConnector/{InputValidationTest.d.ts → InputValidation.test.d.ts} +0 -0
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ava_1 = __importDefault(require("ava"));
|
|
7
3
|
const src_1 = require("../../../../src");
|
|
8
4
|
const Data_1 = require("../../../Data");
|
|
9
5
|
const ThreeDSecureAsClient_1 = require("../ThreeDSecureAsClient");
|
|
10
6
|
const AcsResponse_1 = require("../AcsResponse");
|
|
11
|
-
const runSerially = true;
|
|
12
|
-
const test = runSerially ? ava_1.default.serial : ava_1.default;
|
|
13
7
|
const currency = "GBP";
|
|
14
8
|
const amount = "10.01";
|
|
15
9
|
const date = new Date();
|
|
@@ -40,21 +34,21 @@ browserData.challengWindowSize = src_1.ChallengeWindowSize.Windowed600x400;
|
|
|
40
34
|
browserData.timeZone = "0";
|
|
41
35
|
browserData.userAgent =
|
|
42
36
|
"Mozilla/5.0 (Windows NT 6.1; Win64, x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36";
|
|
43
|
-
|
|
37
|
+
beforeAll(() => {
|
|
44
38
|
const config = Data_1.BaseGpApiTestConfig.gpApiSetupConfig(src_1.Channel.CardNotPresent);
|
|
45
39
|
gatewayProvider = config.gatewayProvider;
|
|
46
40
|
src_1.ServicesContainer.configureService(config);
|
|
47
41
|
});
|
|
48
|
-
|
|
42
|
+
beforeEach(() => {
|
|
49
43
|
card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
|
|
50
44
|
});
|
|
51
|
-
test("full cycle v2 frictionless", async (
|
|
45
|
+
test("full cycle v2 frictionless", async () => {
|
|
52
46
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
53
47
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
54
48
|
.withCurrency(currency)
|
|
55
49
|
.withAmount(amount)
|
|
56
50
|
.execute();
|
|
57
|
-
assertCheckEnrollment3DSV2(
|
|
51
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
58
52
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
59
53
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
60
54
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -66,33 +60,33 @@ test("full cycle v2 frictionless", async (t) => {
|
|
|
66
60
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
67
61
|
.withBrowserData(browserData)
|
|
68
62
|
.execute();
|
|
69
|
-
|
|
63
|
+
expect(initAuth).toBeTruthy();
|
|
70
64
|
initAuth instanceof src_1.ThreeDSecure &&
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
|
|
66
|
+
expect("YES").toBe(initAuth.liabilityShift);
|
|
73
67
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
74
68
|
.withServerTransactionId(secureEcom.serverTransactionId)
|
|
75
69
|
.withAmount(amount)
|
|
76
70
|
.execute();
|
|
77
71
|
card.threeDSecure = secureEcom2;
|
|
78
72
|
secureEcom2 instanceof src_1.ThreeDSecure &&
|
|
79
|
-
|
|
73
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
|
|
80
74
|
const transaction = await card
|
|
81
75
|
.charge(amount)
|
|
82
76
|
.withCurrency(currency)
|
|
83
77
|
.execute();
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
expect(transaction).toBeTruthy();
|
|
79
|
+
expect("SUCCESS").toBe(transaction.responseCode);
|
|
80
|
+
expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
|
|
87
81
|
}
|
|
88
82
|
});
|
|
89
|
-
test("full cycle v2 frictionless failed", async (
|
|
83
|
+
test("full cycle v2 frictionless failed", async () => {
|
|
90
84
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_FAILED_V2_2;
|
|
91
85
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
92
86
|
.withCurrency(currency)
|
|
93
87
|
.withAmount(amount)
|
|
94
88
|
.execute();
|
|
95
|
-
assertCheckEnrollment3DSV2(
|
|
89
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
96
90
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
97
91
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
98
92
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -104,27 +98,27 @@ test("full cycle v2 frictionless failed", async (t) => {
|
|
|
104
98
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
105
99
|
.withBrowserData(browserData)
|
|
106
100
|
.execute();
|
|
107
|
-
|
|
101
|
+
expect(initAuth).toBeTruthy();
|
|
108
102
|
initAuth instanceof src_1.ThreeDSecure &&
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
expect(src_1.Secure3dStatus.NotAuthenticated).toBe(initAuth.status);
|
|
104
|
+
expect("YES").not.toBe(initAuth.liabilityShift);
|
|
111
105
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
112
106
|
.withServerTransactionId(secureEcom.serverTransactionId)
|
|
113
107
|
.withAmount(amount)
|
|
114
108
|
.execute();
|
|
115
109
|
card.threeDSecure = secureEcom2;
|
|
116
110
|
secureEcom2 instanceof src_1.ThreeDSecure &&
|
|
117
|
-
|
|
111
|
+
expect(src_1.Secure3dStatus.NotAuthenticated).toBe(secureEcom2.status);
|
|
118
112
|
const transaction = await card
|
|
119
113
|
.charge(amount)
|
|
120
114
|
.withCurrency(currency)
|
|
121
115
|
.execute();
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
expect(transaction).toBeTruthy();
|
|
117
|
+
expect("SUCCESS").toBe(transaction.responseCode);
|
|
118
|
+
expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
|
|
125
119
|
}
|
|
126
120
|
});
|
|
127
|
-
test("full cycle v2 frictionless with card tokenization", async (
|
|
121
|
+
test("full cycle v2 frictionless with card tokenization", async () => {
|
|
128
122
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
129
123
|
const tokenizeResponse = await card.tokenize().execute();
|
|
130
124
|
const tokenId = tokenizeResponse.token;
|
|
@@ -135,8 +129,8 @@ test("full cycle v2 frictionless with card tokenization", async (t) => {
|
|
|
135
129
|
.withCurrency(currency)
|
|
136
130
|
.withAmount(amount)
|
|
137
131
|
.execute();
|
|
138
|
-
assertCheckEnrollment3DSV2(
|
|
139
|
-
|
|
132
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
133
|
+
expect(secureEcom.payerAuthenticationRequest).toBeTruthy();
|
|
140
134
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
141
135
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
142
136
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(tokenizedCard, secureEcom)
|
|
@@ -148,33 +142,33 @@ test("full cycle v2 frictionless with card tokenization", async (t) => {
|
|
|
148
142
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
149
143
|
.withBrowserData(browserData)
|
|
150
144
|
.execute();
|
|
151
|
-
|
|
145
|
+
expect(initAuth).toBeTruthy();
|
|
152
146
|
initAuth instanceof src_1.ThreeDSecure &&
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
|
|
148
|
+
expect("YES").toBe(initAuth.liabilityShift);
|
|
155
149
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
156
150
|
.withServerTransactionId(secureEcom.serverTransactionId)
|
|
157
151
|
.withAmount(amount)
|
|
158
152
|
.execute();
|
|
159
153
|
card.threeDSecure = secureEcom2;
|
|
160
154
|
secureEcom2 instanceof src_1.ThreeDSecure &&
|
|
161
|
-
|
|
155
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
|
|
162
156
|
const transaction = await card
|
|
163
157
|
.charge(amount)
|
|
164
158
|
.withCurrency(currency)
|
|
165
159
|
.execute();
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
expect(transaction).toBeTruthy();
|
|
161
|
+
expect("SUCCESS").toBe(transaction.responseCode);
|
|
162
|
+
expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
|
|
169
163
|
}
|
|
170
164
|
});
|
|
171
|
-
test("full cycle v2 card holder enrolled challenge required", async (
|
|
165
|
+
test("full cycle v2 card holder enrolled challenge required", async () => {
|
|
172
166
|
card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
|
|
173
167
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
174
168
|
.withCurrency(currency)
|
|
175
169
|
.withAmount(amount)
|
|
176
170
|
.execute();
|
|
177
|
-
assertCheckEnrollment3DSV2(
|
|
171
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
178
172
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
179
173
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
180
174
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -186,43 +180,44 @@ test("full cycle v2 card holder enrolled challenge required", async (t) => {
|
|
|
186
180
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
187
181
|
.withBrowserData(browserData)
|
|
188
182
|
.execute();
|
|
189
|
-
|
|
190
|
-
assertInitiate3DSV2(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
183
|
+
expect(response).toBeTruthy();
|
|
184
|
+
assertInitiate3DSV2(response);
|
|
185
|
+
expect(src_1.Secure3dStatus.ChallengeRequired).toBe(response.status);
|
|
186
|
+
expect(response.payerAuthenticationRequest).toBeTruthy();
|
|
187
|
+
expect(response.issuerAcsUrl).toBeTruthy();
|
|
194
188
|
const authClient = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
|
|
195
189
|
authClient.setGatewayProvider(gatewayProvider);
|
|
196
190
|
const authResponse = await authClient.authenticate_v2(response);
|
|
197
191
|
if (authResponse instanceof AcsResponse_1.AcsResponse) {
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
expect(authResponse.getStatus()).toBe(true);
|
|
193
|
+
expect(authResponse.getMerchantData()).toBeTruthy();
|
|
200
194
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
201
195
|
.withServerTransactionId(authResponse.getMerchantData())
|
|
202
196
|
.withAmount(amount)
|
|
203
197
|
.execute();
|
|
204
198
|
card.threeDSecure = secureEcom2;
|
|
205
199
|
secureEcom2 instanceof src_1.ThreeDSecure &&
|
|
206
|
-
|
|
200
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
|
|
207
201
|
const transaction = await card
|
|
208
202
|
.charge(amount)
|
|
209
203
|
.withCurrency(currency)
|
|
210
204
|
.execute();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
expect(transaction).toBeTruthy();
|
|
206
|
+
expect("SUCCESS").toBe(transaction.responseCode);
|
|
207
|
+
expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
|
|
214
208
|
}
|
|
215
209
|
}
|
|
216
210
|
});
|
|
217
|
-
test("card holder enrolled challenge required v2 2", async (
|
|
211
|
+
test("card holder enrolled challenge required v2 2", async () => {
|
|
218
212
|
card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
|
|
219
213
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
220
214
|
.withCurrency(currency)
|
|
221
215
|
.withAmount(amount)
|
|
222
216
|
.execute();
|
|
223
|
-
assertCheckEnrollment3DSV2(
|
|
217
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
224
218
|
});
|
|
225
|
-
|
|
219
|
+
// Use as template
|
|
220
|
+
test("card holder enrolled challenge required v2 - with idempotency key", async () => {
|
|
226
221
|
card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
|
|
227
222
|
const idempotencyKey = src_1.GenerationUtils.getGuuid();
|
|
228
223
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
@@ -230,21 +225,21 @@ test("card holder enrolled challenge required v2 - with idempotency key", async
|
|
|
230
225
|
.withIdempotencyKey(idempotencyKey)
|
|
231
226
|
.withAmount(amount)
|
|
232
227
|
.execute();
|
|
233
|
-
assertCheckEnrollment3DSV2(
|
|
234
|
-
|
|
235
|
-
.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
228
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
229
|
+
try {
|
|
230
|
+
await src_1.Secure3dService.checkEnrollment(card)
|
|
231
|
+
.withCurrency(currency)
|
|
232
|
+
.withIdempotencyKey(idempotencyKey)
|
|
233
|
+
.withAmount(amount)
|
|
234
|
+
.execute();
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
expect(e.responseCode).toBe("40039");
|
|
238
|
+
expect(e.responseMessage.includes("Idempotency Key seen before")).toBe(true);
|
|
239
|
+
expect(e instanceof src_1.GatewayError).toBe(true);
|
|
245
240
|
}
|
|
246
241
|
});
|
|
247
|
-
test("card holder enrolled challenge required v2 - with tokenized card", async (
|
|
242
|
+
test("card holder enrolled challenge required v2 - with tokenized card", async () => {
|
|
248
243
|
const response = await card.tokenize().execute();
|
|
249
244
|
const tokenizedCard = new src_1.CreditCardData();
|
|
250
245
|
tokenizedCard.token = response.token;
|
|
@@ -253,19 +248,19 @@ test("card holder enrolled challenge required v2 - with tokenized card", async (
|
|
|
253
248
|
.withCurrency(currency)
|
|
254
249
|
.withAmount(amount)
|
|
255
250
|
.execute();
|
|
256
|
-
assertCheckEnrollment3DSV2(
|
|
251
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
257
252
|
});
|
|
258
|
-
test("card holder enrolled challenge required v2 - all preference value", async (
|
|
259
|
-
|
|
253
|
+
test("card holder enrolled challenge required v2 - all preference value", async () => {
|
|
254
|
+
for (const value of Object.values(src_1.ChallengeRequestIndicator)) {
|
|
260
255
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
261
256
|
.withCurrency(currency)
|
|
262
257
|
.withAmount(amount)
|
|
263
258
|
.withChallengeRequestIndicator(value)
|
|
264
259
|
.execute();
|
|
265
|
-
assertCheckEnrollment3DSV2(
|
|
266
|
-
}
|
|
260
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
261
|
+
}
|
|
267
262
|
});
|
|
268
|
-
test("card holder enrolled challenge required v2 - stored credentials", async (
|
|
263
|
+
test("card holder enrolled challenge required v2 - stored credentials", async () => {
|
|
269
264
|
const storedCredentials = new src_1.StoredCredential();
|
|
270
265
|
storedCredentials.initiator = src_1.EnumMapping.mapStoredCredentialInitiator(gatewayProvider, src_1.StoredCredentialInitiator.Merchant);
|
|
271
266
|
storedCredentials.type = src_1.StoredCredentialType.INSTALLMENT;
|
|
@@ -276,52 +271,46 @@ test("card holder enrolled challenge required v2 - stored credentials", async (t
|
|
|
276
271
|
.withAmount(amount)
|
|
277
272
|
.withStoredCredential(storedCredentials)
|
|
278
273
|
.execute();
|
|
279
|
-
assertCheckEnrollment3DSV2(
|
|
274
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
280
275
|
});
|
|
281
|
-
test("card holder enrolled challenge required v2 - all sources", async (
|
|
282
|
-
|
|
276
|
+
test("card holder enrolled challenge required v2 - all sources", async () => {
|
|
277
|
+
for (const value of Object.values(src_1.AuthenticationSource)) {
|
|
283
278
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
284
279
|
.withCurrency(currency)
|
|
285
280
|
.withAmount(amount)
|
|
286
281
|
.withAuthenticationSource(value)
|
|
287
282
|
.execute();
|
|
288
|
-
assertCheckEnrollment3DSV2(
|
|
289
|
-
}
|
|
283
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
284
|
+
}
|
|
290
285
|
});
|
|
291
|
-
test("card holder enrolled challenge required v2 - with null payment method", async (
|
|
286
|
+
test("card holder enrolled challenge required v2 - with null payment method", async () => {
|
|
292
287
|
// below validation is not working on PHP and node has another error
|
|
293
288
|
// this.validations
|
|
294
289
|
// .of("transactionType", TransactionType.VerifyEnrolled)
|
|
295
290
|
// .check("paymentMethod")
|
|
296
291
|
// .isNotNull();
|
|
297
|
-
|
|
298
|
-
.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// error.message.includes(
|
|
309
|
-
// "Status Code: INVALID_REQUEST_DATA - Request expects the following conditionally mandatory fields number,expiry_month,expiry_year.",
|
|
310
|
-
// ),
|
|
311
|
-
// true,
|
|
312
|
-
// );
|
|
313
|
-
t.is(error.message.includes("paymentMethod cannot be null for this transaction type."), true);
|
|
292
|
+
try {
|
|
293
|
+
await src_1.Secure3dService.checkEnrollment(card)
|
|
294
|
+
.withCurrency(currency)
|
|
295
|
+
.withPaymentMethod(null)
|
|
296
|
+
.withAmount(amount)
|
|
297
|
+
.execute();
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
expect(error).toBeTruthy();
|
|
301
|
+
expect(error.message.includes("paymentMethod cannot be null for this transaction type.")).toBe(true);
|
|
302
|
+
expect(error instanceof src_1.BuilderError).toBe(true);
|
|
314
303
|
}
|
|
315
304
|
});
|
|
316
|
-
test("card holder enrolled frictionless v2", async (
|
|
305
|
+
test("card holder enrolled frictionless v2", async () => {
|
|
317
306
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
318
307
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
319
308
|
.withCurrency(currency)
|
|
320
309
|
.withAmount(amount)
|
|
321
310
|
.execute();
|
|
322
|
-
assertCheckEnrollment3DSV2(
|
|
311
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
323
312
|
});
|
|
324
|
-
test("card holder enrolled frictionless v2 - with idempotency key", async (
|
|
313
|
+
test("card holder enrolled frictionless v2 - with idempotency key", async () => {
|
|
325
314
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
326
315
|
const idempotencyKey = src_1.GenerationUtils.getGuuid();
|
|
327
316
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
@@ -329,21 +318,21 @@ test("card holder enrolled frictionless v2 - with idempotency key", async (t) =>
|
|
|
329
318
|
.withIdempotencyKey(idempotencyKey)
|
|
330
319
|
.withAmount(amount)
|
|
331
320
|
.execute();
|
|
332
|
-
assertCheckEnrollment3DSV2(
|
|
333
|
-
|
|
334
|
-
.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
321
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
322
|
+
try {
|
|
323
|
+
await src_1.Secure3dService.checkEnrollment(card)
|
|
324
|
+
.withCurrency(currency)
|
|
325
|
+
.withIdempotencyKey(idempotencyKey)
|
|
326
|
+
.withAmount(amount)
|
|
327
|
+
.execute();
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
expect("40039").toBe(error.responseCode);
|
|
331
|
+
expect(error.responseMessage.includes("Idempotency Key seen before")).toBe(true);
|
|
332
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
344
333
|
}
|
|
345
334
|
});
|
|
346
|
-
test("card holder enrolled frictionless v2 - with tokenized card", async (
|
|
335
|
+
test("card holder enrolled frictionless v2 - with tokenized card", async () => {
|
|
347
336
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
348
337
|
const response = await card.tokenize().execute();
|
|
349
338
|
const tokenizedCard = new src_1.CreditCardData();
|
|
@@ -353,20 +342,20 @@ test("card holder enrolled frictionless v2 - with tokenized card", async (t) =>
|
|
|
353
342
|
.withAmount(amount)
|
|
354
343
|
.withAuthenticationSource(src_1.AuthenticationSource.Browser)
|
|
355
344
|
.execute();
|
|
356
|
-
assertCheckEnrollment3DSV2(
|
|
345
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
357
346
|
});
|
|
358
|
-
test("card holder enrolled frictionless v2 - all preference values", async (
|
|
347
|
+
test("card holder enrolled frictionless v2 - all preference values", async () => {
|
|
359
348
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
360
|
-
|
|
349
|
+
for (const value of Object.values(src_1.ChallengeRequestIndicator)) {
|
|
361
350
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
362
351
|
.withCurrency(currency)
|
|
363
352
|
.withAmount(amount)
|
|
364
353
|
.withChallengeRequestIndicator(value)
|
|
365
354
|
.execute();
|
|
366
|
-
assertCheckEnrollment3DSV2(
|
|
367
|
-
}
|
|
355
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
356
|
+
}
|
|
368
357
|
});
|
|
369
|
-
test("card holder enrolled frictionless v2 - stored credentials", async (
|
|
358
|
+
test("card holder enrolled frictionless v2 - stored credentials", async () => {
|
|
370
359
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
371
360
|
const storedCredentials = new src_1.StoredCredential();
|
|
372
361
|
storedCredentials.initiator = src_1.EnumMapping.mapStoredCredentialInitiator(gatewayProvider, src_1.StoredCredentialInitiator.Merchant);
|
|
@@ -378,28 +367,28 @@ test("card holder enrolled frictionless v2 - stored credentials", async (t) => {
|
|
|
378
367
|
.withAmount(amount)
|
|
379
368
|
.withStoredCredential(storedCredentials)
|
|
380
369
|
.execute();
|
|
381
|
-
assertCheckEnrollment3DSV2(
|
|
370
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
382
371
|
});
|
|
383
|
-
test("card holder enrolled frictionless v2 - all sources", async (
|
|
384
|
-
|
|
372
|
+
test("card holder enrolled frictionless v2 - all sources", async () => {
|
|
373
|
+
for (const value of Object.values(src_1.AuthenticationSource)) {
|
|
385
374
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
386
375
|
.withCurrency(currency)
|
|
387
376
|
.withAmount(amount)
|
|
388
377
|
.withAuthenticationSource(value)
|
|
389
378
|
.execute();
|
|
390
|
-
assertCheckEnrollment3DSV2(
|
|
391
|
-
}
|
|
379
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
380
|
+
}
|
|
392
381
|
});
|
|
393
|
-
test("card holder challenge required - post result", async (
|
|
382
|
+
test("card holder challenge required - post result", async () => {
|
|
394
383
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
395
384
|
.withCurrency(currency)
|
|
396
385
|
.withAmount(amount)
|
|
397
386
|
.execute();
|
|
398
|
-
assertCheckEnrollment3DSV2(
|
|
387
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
399
388
|
if (!(secureEcom instanceof src_1.Transaction)) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
389
|
+
expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
|
|
390
|
+
expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
|
|
391
|
+
expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
|
|
403
392
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
404
393
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
405
394
|
.withAmount(amount)
|
|
@@ -410,45 +399,45 @@ test("card holder challenge required - post result", async (t) => {
|
|
|
410
399
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
411
400
|
.withBrowserData(browserData)
|
|
412
401
|
.execute();
|
|
413
|
-
|
|
402
|
+
expect(initAuth).toBeTruthy();
|
|
414
403
|
if (initAuth instanceof src_1.ThreeDSecure) {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
404
|
+
expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
|
|
405
|
+
expect(initAuth.issuerAcsUrl).toBeTruthy();
|
|
406
|
+
expect(initAuth.payerAuthenticationRequest).toBeTruthy();
|
|
418
407
|
const authClient = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
|
|
419
408
|
authClient.setGatewayProvider(gatewayProvider);
|
|
420
409
|
const authResponse = await authClient.authenticate_v2(initAuth);
|
|
421
410
|
if (authResponse instanceof AcsResponse_1.AcsResponse) {
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
expect(authResponse.getStatus()).toBe(true);
|
|
412
|
+
expect(authResponse.getMerchantData()).toBeTruthy();
|
|
424
413
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
425
414
|
.withServerTransactionId(authResponse.getMerchantData())
|
|
426
415
|
.withAmount(amount)
|
|
427
416
|
.execute();
|
|
428
417
|
card.threeDSecure = secureEcom2;
|
|
429
418
|
if (secureEcom2 instanceof src_1.ThreeDSecure) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
419
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
|
|
420
|
+
expect("05").toBe(String(secureEcom2.eci));
|
|
421
|
+
expect("2.1.0").toBe(secureEcom2.messageVersion);
|
|
422
|
+
expect(secureEcom2.acsTransactionId).toBeTruthy();
|
|
423
|
+
expect(secureEcom2.serverTransactionId).toBeTruthy();
|
|
424
|
+
expect(secureEcom2.directoryServerTransactionId).toBeTruthy();
|
|
436
425
|
}
|
|
437
426
|
}
|
|
438
427
|
}
|
|
439
428
|
}
|
|
440
429
|
});
|
|
441
|
-
test("card holder challenge required - post result with idempotency key", async (
|
|
430
|
+
test("card holder challenge required - post result with idempotency key", async () => {
|
|
442
431
|
const idempotencyKey = src_1.GenerationUtils.getGuuid();
|
|
443
432
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
444
433
|
.withCurrency(currency)
|
|
445
434
|
.withAmount(amount)
|
|
446
435
|
.execute();
|
|
447
|
-
assertCheckEnrollment3DSV2(
|
|
436
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
448
437
|
if (!(secureEcom instanceof src_1.Transaction)) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
438
|
+
expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
|
|
439
|
+
expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
|
|
440
|
+
expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
|
|
452
441
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
453
442
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
454
443
|
.withAmount(amount)
|
|
@@ -459,17 +448,17 @@ test("card holder challenge required - post result with idempotency key", async
|
|
|
459
448
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
460
449
|
.withBrowserData(browserData)
|
|
461
450
|
.execute();
|
|
462
|
-
|
|
451
|
+
expect(initAuth).toBeTruthy();
|
|
463
452
|
if (initAuth instanceof src_1.ThreeDSecure) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
453
|
+
expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
|
|
454
|
+
expect(initAuth.issuerAcsUrl).toBeTruthy();
|
|
455
|
+
expect(initAuth.payerAuthenticationRequest).toBeTruthy();
|
|
467
456
|
const authClient = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
|
|
468
457
|
authClient.setGatewayProvider(gatewayProvider);
|
|
469
458
|
const authResponse = await authClient.authenticate_v2(initAuth);
|
|
470
459
|
if (authResponse instanceof AcsResponse_1.AcsResponse) {
|
|
471
|
-
|
|
472
|
-
|
|
460
|
+
expect(authResponse.getStatus()).toBe(true);
|
|
461
|
+
expect(authResponse.getMerchantData()).toBeTruthy();
|
|
473
462
|
const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
|
|
474
463
|
.withServerTransactionId(authResponse.getMerchantData())
|
|
475
464
|
.withIdempotencyKey(idempotencyKey)
|
|
@@ -477,47 +466,49 @@ test("card holder challenge required - post result with idempotency key", async
|
|
|
477
466
|
.execute();
|
|
478
467
|
card.threeDSecure = secureEcom2;
|
|
479
468
|
if (secureEcom2 instanceof src_1.ThreeDSecure) {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
469
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
|
|
470
|
+
expect("05").toBe(String(secureEcom2.eci));
|
|
471
|
+
expect("2.1.0").toBe(secureEcom2.messageVersion);
|
|
472
|
+
expect(secureEcom2.acsTransactionId).toBeTruthy();
|
|
473
|
+
expect(secureEcom2.serverTransactionId).toBeTruthy();
|
|
474
|
+
expect(secureEcom2.directoryServerTransactionId).toBeTruthy();
|
|
486
475
|
}
|
|
487
|
-
|
|
488
|
-
.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
476
|
+
try {
|
|
477
|
+
await src_1.Secure3dService.getAuthenticationData()
|
|
478
|
+
.withServerTransactionId(secureEcom2.serverTransactionId)
|
|
479
|
+
.withIdempotencyKey(idempotencyKey)
|
|
480
|
+
.execute();
|
|
481
|
+
}
|
|
482
|
+
catch (error) {
|
|
483
|
+
expect("40039").toBe(error.responseCode);
|
|
484
|
+
expect(error.responseMessage.includes("Idempotency Key seen before")).toBe(true);
|
|
485
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
497
486
|
}
|
|
498
487
|
}
|
|
499
488
|
}
|
|
500
489
|
}
|
|
501
490
|
});
|
|
502
|
-
test("card holder challenge required - post result non existent id", async (
|
|
491
|
+
test("card holder challenge required - post result non existent id", async () => {
|
|
503
492
|
const transactionId = "AUT_" + src_1.GenerationUtils.getGuuid();
|
|
504
|
-
|
|
505
|
-
.
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
493
|
+
try {
|
|
494
|
+
await src_1.Secure3dService.getAuthenticationData()
|
|
495
|
+
.withServerTransactionId(transactionId)
|
|
496
|
+
.execute();
|
|
497
|
+
}
|
|
498
|
+
catch (error) {
|
|
499
|
+
expect(error).toBeTruthy();
|
|
500
|
+
expect("40118").toBe(error.responseCode);
|
|
501
|
+
expect(error.responseMessage.includes(`Authentication ${transactionId} not found at this location.`)).toBe(true);
|
|
502
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
513
503
|
}
|
|
514
504
|
});
|
|
515
|
-
|
|
505
|
+
// failed
|
|
506
|
+
test("card holder challenge required - v2 initiate", async () => {
|
|
516
507
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
517
508
|
.withCurrency(currency)
|
|
518
509
|
.withAmount(amount)
|
|
519
510
|
.execute();
|
|
520
|
-
assertCheckEnrollment3DSV2(
|
|
511
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
521
512
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
522
513
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
523
514
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -529,17 +520,17 @@ test("card holder challenge required - v2 initiate", async (t) => {
|
|
|
529
520
|
.withOrderCreateDate(formatedDate)
|
|
530
521
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
531
522
|
.execute();
|
|
532
|
-
|
|
533
|
-
assertInitiate3DSV2(
|
|
523
|
+
expect(response).toBeTruthy();
|
|
524
|
+
assertInitiate3DSV2(response);
|
|
534
525
|
}
|
|
535
526
|
});
|
|
536
|
-
test("card holder challenge required - v2 initiate with idempotency key", async (
|
|
527
|
+
test("card holder challenge required - v2 initiate with idempotency key", async () => {
|
|
537
528
|
const idempotencyKey = src_1.GenerationUtils.getGuuid();
|
|
538
529
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
539
530
|
.withCurrency(currency)
|
|
540
531
|
.withAmount(amount)
|
|
541
532
|
.execute();
|
|
542
|
-
assertCheckEnrollment3DSV2(
|
|
533
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
543
534
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
544
535
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
545
536
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -552,28 +543,29 @@ test("card holder challenge required - v2 initiate with idempotency key", async
|
|
|
552
543
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
553
544
|
.withIdempotencyKey(idempotencyKey)
|
|
554
545
|
.execute();
|
|
555
|
-
|
|
556
|
-
assertInitiate3DSV2(
|
|
557
|
-
|
|
558
|
-
.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
546
|
+
expect(response).toBeTruthy();
|
|
547
|
+
assertInitiate3DSV2(response);
|
|
548
|
+
try {
|
|
549
|
+
await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
550
|
+
.withAmount(amount)
|
|
551
|
+
.withCurrency(currency)
|
|
552
|
+
.withAuthenticationSource(src_1.AuthenticationSource.Browser)
|
|
553
|
+
.withBrowserData(browserData)
|
|
554
|
+
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
555
|
+
.withOrderCreateDate(formatedDate)
|
|
556
|
+
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
557
|
+
.withIdempotencyKey(idempotencyKey)
|
|
558
|
+
.execute();
|
|
559
|
+
}
|
|
560
|
+
catch (error) {
|
|
561
|
+
expect(error).toBeTruthy();
|
|
562
|
+
expect("40039").toBe(error.responseCode);
|
|
563
|
+
expect(error.responseMessage.includes("Idempotency Key seen before")).toBe(true);
|
|
564
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
573
565
|
}
|
|
574
566
|
}
|
|
575
567
|
});
|
|
576
|
-
test("card holder challenge required - v2 initiate tokenized card", async (
|
|
568
|
+
test("card holder challenge required - v2 initiate tokenized card", async () => {
|
|
577
569
|
const response = await card.tokenize().execute();
|
|
578
570
|
const tokenizedCard = new src_1.CreditCardData();
|
|
579
571
|
tokenizedCard.token = response.token;
|
|
@@ -581,7 +573,7 @@ test("card holder challenge required - v2 initiate tokenized card", async (t) =>
|
|
|
581
573
|
.withCurrency(currency)
|
|
582
574
|
.withAmount(amount)
|
|
583
575
|
.execute();
|
|
584
|
-
assertCheckEnrollment3DSV2(
|
|
576
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
585
577
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
586
578
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
587
579
|
const response = await src_1.Secure3dService.initiateAuthentication(tokenizedCard, secureEcom)
|
|
@@ -593,16 +585,16 @@ test("card holder challenge required - v2 initiate tokenized card", async (t) =>
|
|
|
593
585
|
.withOrderCreateDate(formatedDate)
|
|
594
586
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
595
587
|
.execute();
|
|
596
|
-
|
|
597
|
-
assertInitiate3DSV2(
|
|
588
|
+
expect(response).toBeTruthy();
|
|
589
|
+
assertInitiate3DSV2(response);
|
|
598
590
|
}
|
|
599
591
|
});
|
|
600
|
-
test("card holder challenge required - v2 initiate method url set no", async (
|
|
592
|
+
test("card holder challenge required - v2 initiate method url set no", async () => {
|
|
601
593
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
602
594
|
.withCurrency(currency)
|
|
603
595
|
.withAmount(amount)
|
|
604
596
|
.execute();
|
|
605
|
-
assertCheckEnrollment3DSV2(
|
|
597
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
606
598
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
607
599
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
608
600
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -614,16 +606,16 @@ test("card holder challenge required - v2 initiate method url set no", async (t)
|
|
|
614
606
|
.withOrderCreateDate(formatedDate)
|
|
615
607
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
616
608
|
.execute();
|
|
617
|
-
|
|
618
|
-
assertInitiate3DSV2(
|
|
609
|
+
expect(response).toBeTruthy();
|
|
610
|
+
assertInitiate3DSV2(response);
|
|
619
611
|
}
|
|
620
612
|
});
|
|
621
|
-
test("card holder challenge required - v2 initiate method url set unavailable", async (
|
|
613
|
+
test("card holder challenge required - v2 initiate method url set unavailable", async () => {
|
|
622
614
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
623
615
|
.withCurrency(currency)
|
|
624
616
|
.withAmount(amount)
|
|
625
617
|
.execute();
|
|
626
|
-
assertCheckEnrollment3DSV2(
|
|
618
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
627
619
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
628
620
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
629
621
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -635,16 +627,16 @@ test("card holder challenge required - v2 initiate method url set unavailable",
|
|
|
635
627
|
.withOrderCreateDate(formatedDate)
|
|
636
628
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
637
629
|
.execute();
|
|
638
|
-
|
|
639
|
-
assertInitiate3DSV2(
|
|
630
|
+
expect(response).toBeTruthy();
|
|
631
|
+
assertInitiate3DSV2(response);
|
|
640
632
|
}
|
|
641
633
|
});
|
|
642
|
-
test("card holder challenge required - v2 initiate without shipping address", async (
|
|
634
|
+
test("card holder challenge required - v2 initiate without shipping address", async () => {
|
|
643
635
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
644
636
|
.withCurrency(currency)
|
|
645
637
|
.withAmount(amount)
|
|
646
638
|
.execute();
|
|
647
|
-
assertCheckEnrollment3DSV2(
|
|
639
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
648
640
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
649
641
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
650
642
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -655,16 +647,16 @@ test("card holder challenge required - v2 initiate without shipping address", as
|
|
|
655
647
|
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
656
648
|
.withOrderCreateDate(formatedDate)
|
|
657
649
|
.execute();
|
|
658
|
-
|
|
659
|
-
assertInitiate3DSV2(
|
|
650
|
+
expect(response).toBeTruthy();
|
|
651
|
+
assertInitiate3DSV2(response);
|
|
660
652
|
}
|
|
661
653
|
});
|
|
662
|
-
test("card holder challenge required - v2 initiate with gift card", async (
|
|
654
|
+
test("card holder challenge required - v2 initiate with gift card", async () => {
|
|
663
655
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
664
656
|
.withCurrency(currency)
|
|
665
657
|
.withAmount(amount)
|
|
666
658
|
.execute();
|
|
667
|
-
assertCheckEnrollment3DSV2(
|
|
659
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
668
660
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
669
661
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
670
662
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -679,16 +671,16 @@ test("card holder challenge required - v2 initiate with gift card", async (t) =>
|
|
|
679
671
|
.withGiftCardCount(1)
|
|
680
672
|
.withGiftCardCurrency(currency)
|
|
681
673
|
.execute();
|
|
682
|
-
|
|
683
|
-
assertInitiate3DSV2(
|
|
674
|
+
expect(response).toBeTruthy();
|
|
675
|
+
assertInitiate3DSV2(response);
|
|
684
676
|
}
|
|
685
677
|
});
|
|
686
|
-
test("card holder challenge required - v2 initiate with shipping method", async (
|
|
678
|
+
test("card holder challenge required - v2 initiate with shipping method", async () => {
|
|
687
679
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
688
680
|
.withCurrency(currency)
|
|
689
681
|
.withAmount(amount)
|
|
690
682
|
.execute();
|
|
691
|
-
assertCheckEnrollment3DSV2(
|
|
683
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
692
684
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
693
685
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
694
686
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -701,16 +693,16 @@ test("card holder challenge required - v2 initiate with shipping method", async
|
|
|
701
693
|
.withShippingMethod(src_1.ShippingMethod.DigitalGoods)
|
|
702
694
|
.withOrderCreateDate(formatedDate)
|
|
703
695
|
.execute();
|
|
704
|
-
|
|
705
|
-
assertInitiate3DSV2(
|
|
696
|
+
expect(response).toBeTruthy();
|
|
697
|
+
assertInitiate3DSV2(response);
|
|
706
698
|
}
|
|
707
699
|
});
|
|
708
|
-
test("card holder challenge required - v2 initiate with delivery email", async (
|
|
700
|
+
test("card holder challenge required - v2 initiate with delivery email", async () => {
|
|
709
701
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
710
702
|
.withCurrency(currency)
|
|
711
703
|
.withAmount(amount)
|
|
712
704
|
.execute();
|
|
713
|
-
assertCheckEnrollment3DSV2(
|
|
705
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
714
706
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
715
707
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
716
708
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -724,17 +716,17 @@ test("card holder challenge required - v2 initiate with delivery email", async (
|
|
|
724
716
|
.withDeliveryTimeFrame(src_1.DeliveryTimeFrame.SameDay)
|
|
725
717
|
.withOrderCreateDate(formatedDate)
|
|
726
718
|
.execute();
|
|
727
|
-
|
|
728
|
-
assertInitiate3DSV2(
|
|
719
|
+
expect(response).toBeTruthy();
|
|
720
|
+
assertInitiate3DSV2(response);
|
|
729
721
|
}
|
|
730
722
|
});
|
|
731
|
-
test("card holder challenge required - v2 initiate all preference values", async (
|
|
723
|
+
test("card holder challenge required - v2 initiate all preference values", async () => {
|
|
732
724
|
Promise.all(Object.values(src_1.ChallengeRequestIndicator).map(async (value) => {
|
|
733
725
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
734
726
|
.withCurrency(currency)
|
|
735
727
|
.withAmount(amount)
|
|
736
728
|
.execute();
|
|
737
|
-
assertCheckEnrollment3DSV2(
|
|
729
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
738
730
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
739
731
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
740
732
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -747,12 +739,12 @@ test("card holder challenge required - v2 initiate all preference values", async
|
|
|
747
739
|
.withChallengeRequestIndicator(value)
|
|
748
740
|
.withOrderCreateDate(formatedDate)
|
|
749
741
|
.execute();
|
|
750
|
-
|
|
751
|
-
assertInitiate3DSV2(
|
|
742
|
+
expect(response).toBeTruthy();
|
|
743
|
+
assertInitiate3DSV2(response);
|
|
752
744
|
}
|
|
753
745
|
}));
|
|
754
746
|
});
|
|
755
|
-
test("card holder challenge required - v2 initiate all source values", async (
|
|
747
|
+
test.failing("card holder challenge required - v2 initiate all source values", async () => {
|
|
756
748
|
// fails 'MERCHANT_INITIATED and STORED_RECURRING failing, issue raised with UCP team.'
|
|
757
749
|
Promise.all(Object.values(src_1.AuthenticationSource).map(async (value) => {
|
|
758
750
|
const storedCredentials = new src_1.StoredCredential();
|
|
@@ -766,7 +758,7 @@ test("card holder challenge required - v2 initiate all source values", async (t)
|
|
|
766
758
|
.withAuthenticationSource(value)
|
|
767
759
|
.withStoredCredential(storedCredentials)
|
|
768
760
|
.execute();
|
|
769
|
-
assertCheckEnrollment3DSV2(
|
|
761
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
770
762
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
771
763
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
772
764
|
const response = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -779,18 +771,19 @@ test("card holder challenge required - v2 initiate all source values", async (t)
|
|
|
779
771
|
.withOrderCreateDate(formatedDate)
|
|
780
772
|
.withStoredCredential(storedCredentials)
|
|
781
773
|
.execute();
|
|
782
|
-
|
|
783
|
-
assertInitiate3DSV2(
|
|
774
|
+
expect(response).toBeTruthy();
|
|
775
|
+
assertInitiate3DSV2(response);
|
|
784
776
|
}
|
|
785
777
|
}));
|
|
786
778
|
});
|
|
787
|
-
|
|
779
|
+
// failed
|
|
780
|
+
test("card holder enrolled challenge required - frictionless - v2 initiate", async () => {
|
|
788
781
|
card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
|
|
789
782
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
790
783
|
.withCurrency(currency)
|
|
791
784
|
.withAmount(amount)
|
|
792
785
|
.execute();
|
|
793
|
-
assertCheckEnrollment3DSV2(
|
|
786
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
794
787
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
795
788
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
796
789
|
const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
@@ -803,69 +796,71 @@ test("card holder enrolled challenge required - frictionless - v2 initiate", asy
|
|
|
803
796
|
.withShippingMethod(src_1.ShippingMethod.DigitalGoods)
|
|
804
797
|
.withOrderCreateDate(formatedDate)
|
|
805
798
|
.execute();
|
|
806
|
-
|
|
799
|
+
expect(initAuth).toBeTruthy();
|
|
807
800
|
if (initAuth instanceof src_1.ThreeDSecure) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
801
|
+
expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
|
|
802
|
+
expect(initAuth.issuerAcsUrl).toBeTruthy();
|
|
803
|
+
expect(initAuth.payerAuthenticationRequest).toBeTruthy();
|
|
804
|
+
expect(initAuth.acsTransactionId).toBeTruthy();
|
|
805
|
+
expect(initAuth.providerServerTransRef).toBeTruthy();
|
|
806
|
+
expect(initAuth.acsReferenceNumber).toBeTruthy();
|
|
807
|
+
expect("05").toBe(String(initAuth.eci));
|
|
808
|
+
expect("2.2.0").toBe(initAuth.messageVersion);
|
|
816
809
|
}
|
|
817
810
|
}
|
|
818
811
|
});
|
|
819
|
-
test("card holder enrolled challenge required - frictionless - v2 initiate without payment method", async (
|
|
812
|
+
test("card holder enrolled challenge required - frictionless - v2 initiate without payment method", async () => {
|
|
820
813
|
const card = new src_1.CreditCardData();
|
|
821
814
|
const secureEcom = new src_1.ThreeDSecure();
|
|
822
815
|
secureEcom.serverTransactionId = "AUT_" + src_1.GenerationUtils.getGuuid();
|
|
823
816
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
824
|
-
|
|
825
|
-
.
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
817
|
+
try {
|
|
818
|
+
await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
819
|
+
.withAmount(amount)
|
|
820
|
+
.withCurrency(currency)
|
|
821
|
+
.withAuthenticationSource(src_1.AuthenticationSource.Browser)
|
|
822
|
+
.withBrowserData(browserData)
|
|
823
|
+
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
824
|
+
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
825
|
+
.withShippingMethod(src_1.ShippingMethod.DigitalGoods)
|
|
826
|
+
.withOrderCreateDate(formatedDate)
|
|
827
|
+
.execute();
|
|
828
|
+
}
|
|
829
|
+
catch (error) {
|
|
830
|
+
expect(error).toBeTruthy();
|
|
831
|
+
expect("40005").toBe(error.responseCode);
|
|
832
|
+
expect(error.responseMessage.includes("Request expects the following fields number")).toBe(true);
|
|
833
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
840
834
|
}
|
|
841
835
|
});
|
|
842
|
-
test("card holder enrolled challenge required - v2 initiate non existent id", async (
|
|
836
|
+
test("card holder enrolled challenge required - v2 initiate non existent id", async () => {
|
|
843
837
|
const secureEcom = new src_1.ThreeDSecure();
|
|
844
838
|
secureEcom.serverTransactionId = "AUT_" + src_1.GenerationUtils.getGuuid();
|
|
845
839
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
846
|
-
|
|
847
|
-
.
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
840
|
+
try {
|
|
841
|
+
await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
842
|
+
.withAmount(amount)
|
|
843
|
+
.withCurrency(currency)
|
|
844
|
+
.withAuthenticationSource(src_1.AuthenticationSource.Browser)
|
|
845
|
+
.withBrowserData(browserData)
|
|
846
|
+
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
847
|
+
.withOrderCreateDate(formatedDate)
|
|
848
|
+
.execute();
|
|
849
|
+
}
|
|
850
|
+
catch (error) {
|
|
851
|
+
expect(error).toBeTruthy();
|
|
852
|
+
expect("40118").toBe(error.responseCode);
|
|
853
|
+
expect(error.responseMessage.includes(`Authentication ${secureEcom.serverTransactionId} not found at this location.`)).toBe(true);
|
|
854
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
860
855
|
}
|
|
861
856
|
});
|
|
862
|
-
test("challenge required v2 - initiate with mobile sdk", async (
|
|
857
|
+
test("challenge required v2 - initiate with mobile sdk", async () => {
|
|
863
858
|
card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
|
|
864
859
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
865
860
|
.withCurrency(currency)
|
|
866
861
|
.withAmount(amount)
|
|
867
862
|
.execute();
|
|
868
|
-
assertCheckEnrollment3DSV2(
|
|
863
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
869
864
|
const mobileData = new src_1.MobileData();
|
|
870
865
|
mobileData.encodedData =
|
|
871
866
|
"ew0KCSJEViI6ICIxLjAiLA0KCSJERCI6IHsNCgkJIkMwMDEiOiAiQW5kcm9pZCIsDQoJCSJDMDAyIjogIkhUQyBPbmVfTTgiLA0KCQkiQzAwNCI6ICI1LjAuMSIsDQoJCSJDMDA1IjogImVuX1VTIiwNCgkJIkMwMDYiOiAiRWFzdGVybiBTdGFuZGFyZCBUaW1lIiwNCgkJIkMwMDciOiAiMDY3OTc5MDMtZmI2MS00MWVkLTk0YzItNGQyYjc0ZTI3ZDE4IiwNCgkJIkMwMDkiOiAiSm9obidzIEFuZHJvaWQgRGV2aWNlIg0KCX0sDQoJIkRQTkEiOiB7DQoJCSJDMDEwIjogIlJFMDEiLA0KCQkiQzAxMSI6ICJSRTAzIg0KCX0sDQoJIlNXIjogWyJTVzAxIiwgIlNXMDQiXQ0KfQ0K";
|
|
@@ -892,22 +887,22 @@ test("challenge required v2 - initiate with mobile sdk", async (t) => {
|
|
|
892
887
|
.withOrderCreateDate(formatedDate)
|
|
893
888
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
894
889
|
.execute();
|
|
895
|
-
|
|
896
|
-
assertInitiate3DSV2(
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
890
|
+
expect(response).toBeTruthy();
|
|
891
|
+
assertInitiate3DSV2(response);
|
|
892
|
+
expect(response.payerAuthenticationRequest).toBeTruthy();
|
|
893
|
+
expect(response.acsInterface).toBeTruthy();
|
|
894
|
+
expect(response.acsUiTemplate).toBeTruthy();
|
|
895
|
+
expect(response.providerServerTransRef).toBeTruthy();
|
|
896
|
+
expect("NATIVE").toBe(response.acsInterface);
|
|
897
|
+
expect("OUT_OF_BAND").toBe(response.acsUiTemplate);
|
|
903
898
|
}
|
|
904
899
|
});
|
|
905
|
-
test("challenge required v2 - initiate with mobile data and browser data", async (
|
|
900
|
+
test("challenge required v2 - initiate with mobile data and browser data", async () => {
|
|
906
901
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
907
902
|
.withCurrency(currency)
|
|
908
903
|
.withAmount(amount)
|
|
909
904
|
.execute();
|
|
910
|
-
assertCheckEnrollment3DSV2(
|
|
905
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
911
906
|
const mobileData = new src_1.MobileData();
|
|
912
907
|
mobileData.encodedData =
|
|
913
908
|
"ew0KCSJEViI6ICIxLjAiLA0KCSJERCI6IHsNCgkJIkMwMDEiOiAiQW5kcm9pZCIsDQoJCSJDMDAyIjogIkhUQyBPbmVfTTgiLA0KCQkiQzAwNCI6ICI1LjAuMSIsDQoJCSJDMDA1IjogImVuX1VTIiwNCgkJIkMwMDYiOiAiRWFzdGVybiBTdGFuZGFyZCBUaW1lIiwNCgkJIkMwMDciOiAiMDY3OTc5MDMtZmI2MS00MWVkLTk0YzItNGQyYjc0ZTI3ZDE4IiwNCgkJIkMwMDkiOiAiSm9obidzIEFuZHJvaWQgRGV2aWNlIg0KCX0sDQoJIkRQTkEiOiB7DQoJCSJDMDEwIjogIlJFMDEiLA0KCQkiQzAxMSI6ICJSRTAzIg0KCX0sDQoJIlNXIjogWyJTVzAxIiwgIlNXMDQiXQ0KfQ0K";
|
|
@@ -935,16 +930,16 @@ test("challenge required v2 - initiate with mobile data and browser data", async
|
|
|
935
930
|
.withBrowserData(browserData)
|
|
936
931
|
.withAddress(shippingAddress, src_1.AddressType.Shipping)
|
|
937
932
|
.execute();
|
|
938
|
-
|
|
939
|
-
assertInitiate3DSV2(
|
|
933
|
+
expect(response).toBeTruthy();
|
|
934
|
+
assertInitiate3DSV2(response);
|
|
940
935
|
}
|
|
941
936
|
});
|
|
942
|
-
test("challenge required v2 - initiate with mobile data and source browser", async (
|
|
937
|
+
test("challenge required v2 - initiate with mobile data and source browser", async () => {
|
|
943
938
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
944
939
|
.withCurrency(currency)
|
|
945
940
|
.withAmount(amount)
|
|
946
941
|
.execute();
|
|
947
|
-
assertCheckEnrollment3DSV2(
|
|
942
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
948
943
|
const mobileData = new src_1.MobileData();
|
|
949
944
|
mobileData.encodedData =
|
|
950
945
|
"ew0KCSJEViI6ICIxLjAiLA0KCSJERCI6IHsNCgkJIkMwMDEiOiAiQW5kcm9pZCIsDQoJCSJDMDAyIjogIkhUQyBPbmVfTTgiLA0KCQkiQzAwNCI6ICI1LjAuMSIsDQoJCSJDMDA1IjogImVuX1VTIiwNCgkJIkMwMDYiOiAiRWFzdGVybiBTdGFuZGFyZCBUaW1lIiwNCgkJIkMwMDciOiAiMDY3OTc5MDMtZmI2MS00MWVkLTk0YzItNGQyYjc0ZTI3ZDE4IiwNCgkJIkMwMDkiOiAiSm9obidzIEFuZHJvaWQgRGV2aWNlIg0KCX0sDQoJIkRQTkEiOiB7DQoJCSJDMDEwIjogIlJFMDEiLA0KCQkiQzAxMSI6ICJSRTAzIg0KCX0sDQoJIlNXIjogWyJTVzAxIiwgIlNXMDQiXQ0KfQ0K";
|
|
@@ -962,68 +957,70 @@ test("challenge required v2 - initiate with mobile data and source browser", asy
|
|
|
962
957
|
mobileData.sdkTransReference = "b2385523-a66c-4907-ac3c-91848e8c0067";
|
|
963
958
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
964
959
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
965
|
-
|
|
966
|
-
.
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
960
|
+
try {
|
|
961
|
+
await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
962
|
+
.withAmount(amount)
|
|
963
|
+
.withCurrency(currency)
|
|
964
|
+
.withAuthenticationSource(src_1.AuthenticationSource.Browser)
|
|
965
|
+
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
966
|
+
.withOrderCreateDate(formatedDate)
|
|
967
|
+
.withMobileData(mobileData)
|
|
968
|
+
.execute();
|
|
969
|
+
}
|
|
970
|
+
catch (error) {
|
|
971
|
+
expect(error).toBeTruthy();
|
|
972
|
+
expect("40233").toBe(error.responseCode);
|
|
973
|
+
expect(error.responseMessage.includes("Required Data Element browser_data")).toBe(true);
|
|
974
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
979
975
|
}
|
|
980
976
|
}
|
|
981
977
|
});
|
|
982
|
-
test("challenge required v2 - initiate with source mobile SDK without mobile data", async (
|
|
978
|
+
test("challenge required v2 - initiate with source mobile SDK without mobile data", async () => {
|
|
983
979
|
const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
|
|
984
980
|
.withCurrency(currency)
|
|
985
981
|
.withAmount(amount)
|
|
986
982
|
.execute();
|
|
987
|
-
assertCheckEnrollment3DSV2(
|
|
983
|
+
assertCheckEnrollment3DSV2(secureEcom);
|
|
988
984
|
if (secureEcom instanceof src_1.ThreeDSecure) {
|
|
989
985
|
const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
990
|
-
|
|
991
|
-
.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
986
|
+
try {
|
|
987
|
+
await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
|
|
988
|
+
.withAmount(amount)
|
|
989
|
+
.withCurrency(currency)
|
|
990
|
+
.withAuthenticationSource(src_1.AuthenticationSource.MobileSdk)
|
|
991
|
+
.withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
|
|
992
|
+
.withOrderCreateDate(formatedDate)
|
|
993
|
+
.execute();
|
|
994
|
+
}
|
|
995
|
+
catch (error) {
|
|
996
|
+
expect(error).toBeTruthy();
|
|
997
|
+
expect("40233").toBe(error.responseCode);
|
|
998
|
+
expect(error.responseMessage.includes("Required Data Element sdk_information")).toBe(true);
|
|
999
|
+
expect(error instanceof src_1.GatewayError).toBe(true);
|
|
1003
1000
|
}
|
|
1004
1001
|
}
|
|
1005
1002
|
});
|
|
1006
|
-
const assertCheckEnrollment3DSV2 = (
|
|
1007
|
-
|
|
1003
|
+
const assertCheckEnrollment3DSV2 = (secureEcom) => {
|
|
1004
|
+
expect(secureEcom).toBeTruthy();
|
|
1008
1005
|
if (!(secureEcom instanceof src_1.Transaction)) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1006
|
+
expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
|
|
1007
|
+
expect(src_1.Secure3dVersion.TWO).toBe(secureEcom?.getVersion());
|
|
1008
|
+
expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
|
|
1009
|
+
expect(secureEcom.issuerAcsUrl).toBeTruthy();
|
|
1010
|
+
expect(secureEcom.payerAuthenticationRequest).toBeTruthy();
|
|
1011
|
+
expect(secureEcom.eci).toBeFalsy();
|
|
1015
1012
|
}
|
|
1016
1013
|
};
|
|
1017
|
-
const assertInitiate3DSV2 = (
|
|
1018
|
-
|
|
1014
|
+
const assertInitiate3DSV2 = (initAuth) => {
|
|
1015
|
+
expect(initAuth).toBeTruthy();
|
|
1019
1016
|
if (!(initAuth instanceof src_1.Transaction)) {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1017
|
+
expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
|
|
1018
|
+
expect("2.1.0").toBe(initAuth.messageVersion);
|
|
1019
|
+
expect(initAuth.issuerAcsUrl).toBeTruthy();
|
|
1020
|
+
expect(initAuth.payerAuthenticationRequest).toBeTruthy();
|
|
1021
|
+
expect(initAuth.acsTransactionId).toBeTruthy();
|
|
1022
|
+
expect(initAuth.eci).toBeFalsy();
|
|
1026
1023
|
}
|
|
1027
1024
|
};
|
|
1028
|
-
|
|
1029
|
-
//# sourceMappingURL=
|
|
1025
|
+
afterAll(() => Data_1.BaseGpApiTestConfig.resetGpApiConfig());
|
|
1026
|
+
//# sourceMappingURL=3DS2.test.js.map
|