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.
Files changed (311) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/LICENSE.md +257 -257
  3. package/README.md +141 -141
  4. package/lib/src/Builders/BaseBuilder/Validations.js +1 -1
  5. package/lib/src/Builders/BaseBuilder/Validations.js.map +1 -1
  6. package/lib/src/Builders/ManagementBuilder.d.ts +26 -6
  7. package/lib/src/Builders/ManagementBuilder.js +66 -34
  8. package/lib/src/Builders/ManagementBuilder.js.map +1 -1
  9. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +19 -0
  10. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -1
  11. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.d.ts +2 -0
  12. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js +86 -0
  13. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js.map +1 -1
  14. package/lib/src/Builders/TransactionReportBuilder.d.ts +5 -2
  15. package/lib/src/Builders/TransactionReportBuilder.js +19 -0
  16. package/lib/src/Builders/TransactionReportBuilder.js.map +1 -1
  17. package/lib/src/Entities/AdditionalTaxDetails.d.ts +5 -0
  18. package/lib/src/Entities/AdditionalTaxDetails.js +10 -0
  19. package/lib/src/Entities/AdditionalTaxDetails.js.map +1 -0
  20. package/lib/src/Entities/CommercialData.d.ts +26 -0
  21. package/lib/src/Entities/CommercialData.js +36 -0
  22. package/lib/src/Entities/CommercialData.js.map +1 -0
  23. package/lib/src/Entities/CommercialLineItem.d.ts +21 -0
  24. package/lib/src/Entities/CommercialLineItem.js +24 -0
  25. package/lib/src/Entities/CommercialLineItem.js.map +1 -0
  26. package/lib/src/Entities/DiscountDetails.d.ts +8 -0
  27. package/lib/src/Entities/DiscountDetails.js +13 -0
  28. package/lib/src/Entities/DiscountDetails.js.map +1 -0
  29. package/lib/src/Entities/DisputeDocument.d.ts +5 -0
  30. package/lib/src/Entities/DisputeDocument.js +10 -0
  31. package/lib/src/Entities/DisputeDocument.js.map +1 -0
  32. package/lib/src/Entities/Document.d.ts +10 -0
  33. package/lib/src/Entities/Document.js +13 -0
  34. package/lib/src/Entities/Document.js.map +1 -0
  35. package/lib/src/Entities/Enums/DisputeSortProperty.d.ts +12 -0
  36. package/lib/src/Entities/Enums/DisputeSortProperty.js +17 -0
  37. package/lib/src/Entities/Enums/DisputeSortProperty.js.map +1 -0
  38. package/lib/src/Entities/Enums/DisputeStage.d.ts +11 -0
  39. package/lib/src/Entities/Enums/DisputeStage.js +16 -0
  40. package/lib/src/Entities/Enums/DisputeStage.js.map +1 -0
  41. package/lib/src/Entities/Enums/DisputeStatus.d.ts +7 -0
  42. package/lib/src/Entities/Enums/DisputeStatus.js +12 -0
  43. package/lib/src/Entities/Enums/DisputeStatus.js.map +1 -0
  44. package/lib/src/Entities/Enums/DocumentCategory.d.ts +5 -0
  45. package/lib/src/Entities/Enums/DocumentCategory.js +10 -0
  46. package/lib/src/Entities/Enums/DocumentCategory.js.map +1 -0
  47. package/lib/src/Entities/Enums/FileType.d.ts +11 -0
  48. package/lib/src/Entities/Enums/FileType.js +16 -0
  49. package/lib/src/Entities/Enums/FileType.js.map +1 -0
  50. package/lib/src/Entities/Enums.d.ts +17 -1
  51. package/lib/src/Entities/Enums.js +20 -2
  52. package/lib/src/Entities/Enums.js.map +1 -1
  53. package/lib/src/Entities/HostedPaymentData.d.ts +3 -0
  54. package/lib/src/Entities/HostedPaymentData.js +3 -0
  55. package/lib/src/Entities/HostedPaymentData.js.map +1 -1
  56. package/lib/src/Entities/Reporting/DisputeSummary.d.ts +53 -0
  57. package/lib/src/Entities/Reporting/DisputeSummary.js +64 -0
  58. package/lib/src/Entities/Reporting/DisputeSummary.js.map +1 -0
  59. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.d.ts +4 -2
  60. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js +2 -0
  61. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js.map +1 -1
  62. package/lib/src/Entities/Reporting/index.d.ts +1 -0
  63. package/lib/src/Entities/Reporting/index.js +1 -0
  64. package/lib/src/Entities/Reporting/index.js.map +1 -1
  65. package/lib/src/Entities/Transaction.js +3 -0
  66. package/lib/src/Entities/Transaction.js.map +1 -1
  67. package/lib/src/Entities/TransactionSummary.d.ts +1 -0
  68. package/lib/src/Entities/TransactionSummary.js +1 -0
  69. package/lib/src/Entities/TransactionSummary.js.map +1 -1
  70. package/lib/src/Entities/index.d.ts +7 -0
  71. package/lib/src/Entities/index.js +7 -0
  72. package/lib/src/Entities/index.js.map +1 -1
  73. package/lib/src/Gateways/GpApiConnector.js +3 -0
  74. package/lib/src/Gateways/GpApiConnector.js.map +1 -1
  75. package/lib/src/Gateways/GpEcomConnector.js +9 -0
  76. package/lib/src/Gateways/GpEcomConnector.js.map +1 -1
  77. package/lib/src/Gateways/PayPlanConnector.d.ts +1 -1
  78. package/lib/src/Gateways/PorticoConnector.d.ts +3 -3
  79. package/lib/src/Gateways/PorticoConnector.js +117 -4
  80. package/lib/src/Gateways/PorticoConnector.js.map +1 -1
  81. package/lib/src/Mapping/GpApiMapping.d.ts +2 -1
  82. package/lib/src/Mapping/GpApiMapping.js +75 -2
  83. package/lib/src/Mapping/GpApiMapping.js.map +1 -1
  84. package/lib/src/Services/ReportingService.d.ts +6 -1
  85. package/lib/src/Services/ReportingService.js +15 -0
  86. package/lib/src/Services/ReportingService.js.map +1 -1
  87. package/lib/test/Integration/Gateways/GpApiConnector/{3DS2Test.js → 3DS2.test.js} +338 -341
  88. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js.map +1 -0
  89. package/lib/test/Integration/Gateways/GpApiConnector/{3DSecureTest.js → 3DSecure.test.js} +167 -173
  90. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js.map +1 -0
  91. package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js +130 -0
  92. package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js.map +1 -0
  93. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js +1070 -0
  94. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js.map +1 -0
  95. package/lib/test/Integration/Gateways/GpApiConnector/{DebitCardTest.js → DebitCard.test.js} +27 -33
  96. package/lib/test/Integration/Gateways/GpApiConnector/DebitCard.test.js.map +1 -0
  97. package/lib/test/Integration/Gateways/GpApiConnector/{GpApiCertificationTest.js → GpApiCertification.test.js} +211 -208
  98. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertification.test.js.map +1 -0
  99. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js +151 -0
  100. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js.map +1 -0
  101. package/lib/test/Integration/Gateways/GpApiConnector/{ReportingDepositsTest.js → ReportingDeposits.test.js} +103 -103
  102. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDeposits.test.js.map +1 -0
  103. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js +571 -0
  104. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js.map +1 -0
  105. package/lib/test/Integration/Gateways/GpApiConnector/{ReportingSettlementTransactionsTest.js → ReportingSettlementTransactions.test.js} +104 -108
  106. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactions.test.js.map +1 -0
  107. package/lib/test/Integration/Gateways/GpApiConnector/{ReportingStoredPaymentMethodsTest.js → ReportingStoredPaymentMethods.test.js} +75 -76
  108. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethods.test.js.map +1 -0
  109. package/lib/test/Integration/Gateways/GpApiConnector/{ReportingTransactionsTest.js → ReportingTransactions.test.js} +97 -95
  110. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactions.test.js.map +1 -0
  111. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AuthTest.js → Auth.test.js} +441 -461
  112. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Auth.test.js.map +1 -0
  113. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AvsTest.js → Avs.test.js} +274 -218
  114. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Avs.test.js.map +1 -0
  115. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{CreditTest.js → Credit.test.js} +317 -321
  116. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Credit.test.js.map +1 -0
  117. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{HoldTest.js → Hold.test.js} +290 -257
  118. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Hold.test.js.map +1 -0
  119. package/lib/test/Integration/Gateways/GpEcomConnector/{CreditTest.js → Credit.test.js} +76 -84
  120. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
  121. package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js +137 -0
  122. package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js.map +1 -0
  123. package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js +124 -0
  124. package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js.map +1 -0
  125. package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js +54 -0
  126. package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js.map +1 -0
  127. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js +357 -0
  128. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js.map +1 -0
  129. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceTest.js → Ecommerce.test.js} +403 -459
  130. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js.map +1 -0
  131. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceCheckTest.js → EcommerceCheck.test.js} +17 -23
  132. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheck.test.js.map +1 -0
  133. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoTest.js → Moto.test.js} +377 -650
  134. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Moto.test.js.map +1 -0
  135. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoCheckTest.js → MotoCheck.test.js} +16 -22
  136. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheck.test.js.map +1 -0
  137. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js +393 -0
  138. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js.map +1 -0
  139. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RetailTest.js → Retail.test.js} +481 -600
  140. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Retail.test.js.map +1 -0
  141. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +433 -0
  142. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -0
  143. package/lib/test/Integration/Gateways/PorticoConnector/{DebitTest.js → Debit.test.js} +32 -37
  144. package/lib/test/Integration/Gateways/PorticoConnector/Debit.test.js.map +1 -0
  145. package/lib/test/Integration/Gateways/PorticoConnector/{EbtTest.js → Ebt.test.js} +30 -39
  146. package/lib/test/Integration/Gateways/PorticoConnector/Ebt.test.js.map +1 -0
  147. package/lib/test/Integration/Gateways/PorticoConnector/{EcommerceTest.js → Ecommerce.test.js} +38 -45
  148. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js.map +1 -0
  149. package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js +121 -0
  150. package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js.map +1 -0
  151. package/lib/test/Integration/Gateways/PorticoConnector/{PorticoManagementTokenTest.js → PorticoManagementToken.test.js} +8 -16
  152. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementToken.test.js.map +1 -0
  153. package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js +87 -0
  154. package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js.map +1 -0
  155. package/lib/test/Integration/Gateways/PorticoConnector/{ReportingTest.js → Reporting.test.js} +12 -18
  156. package/lib/test/Integration/Gateways/PorticoConnector/Reporting.test.js.map +1 -0
  157. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{GetInformationCertificationTest.js → GetInformationCertification.test.js} +12 -18
  158. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertification.test.js.map +1 -0
  159. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayAccountCertificationTest.js → ProPayAccountCertification.test.js} +49 -64
  160. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertification.test.js.map +1 -0
  161. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayFundCertificationTest.js → ProPayFundCertification.test.js} +14 -22
  162. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertification.test.js.map +1 -0
  163. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayInNetworkTransactionCertificationTest.js → ProPayInNetworkTransactionCertification.test.js} +18 -26
  164. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertification.test.js.map +1 -0
  165. package/lib/test/Integration/Gateways/ProPayConnector/{GetInformationTest.js → GetInformation.test.js} +11 -18
  166. package/lib/test/Integration/Gateways/ProPayConnector/GetInformation.test.js.map +1 -0
  167. package/lib/test/Integration/Gateways/ProPayConnector/{ProPayAccountTest.js → ProPayAccount.test.js} +63 -83
  168. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccount.test.js.map +1 -0
  169. package/lib/test/Integration/Gateways/ProPayConnector/{ProPayFundsTest.js → ProPayFunds.test.js} +15 -22
  170. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFunds.test.js.map +1 -0
  171. package/lib/test/Integration/Gateways/ProPayConnector/{ProPayInNetworkTransactionTest.js → ProPayInNetworkTransaction.test.js} +17 -25
  172. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransaction.test.js.map +1 -0
  173. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js +165 -0
  174. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js.map +1 -0
  175. package/lib/test/Integration/Services/{CheckServiceTest.js → CheckService.test.js} +11 -18
  176. package/lib/test/Integration/Services/CheckService.test.js.map +1 -0
  177. package/lib/test/Integration/Services/{CreditServiceTest.js → CreditService.test.js} +48 -64
  178. package/lib/test/Integration/Services/CreditService.test.js.map +1 -0
  179. package/lib/test/Integration/Services/{DebitServiceTest.js → DebitService.test.js} +28 -32
  180. package/lib/test/Integration/Services/DebitService.test.js.map +1 -0
  181. package/lib/test/Integration/Services/{EBTServiceTest.js → EBTService.test.js} +16 -26
  182. package/lib/test/Integration/Services/EBTService.test.js.map +1 -0
  183. package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js +122 -0
  184. package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js.map +1 -0
  185. package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js +66 -0
  186. package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js.map +1 -0
  187. package/lib/test/Unit/Gateways/GpEcomConnector/{CreditTest.js → Credit.test.js} +13 -15
  188. package/lib/test/Unit/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
  189. package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js +128 -0
  190. package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js.map +1 -0
  191. package/package.json +7 -17
  192. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +0 -1
  193. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +0 -1
  194. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +0 -109
  195. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +0 -1
  196. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +0 -1025
  197. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +0 -1
  198. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +0 -439
  199. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +0 -1
  200. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +0 -1
  201. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +0 -1
  202. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +0 -149
  203. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +0 -1
  204. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +0 -1
  205. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +0 -1
  206. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +0 -1
  207. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +0 -1
  208. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +0 -1
  209. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +0 -1
  210. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +0 -1
  211. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +0 -1
  212. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  213. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +0 -99
  214. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +0 -1
  215. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +0 -133
  216. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +0 -1
  217. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -59
  218. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +0 -1
  219. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -378
  220. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +0 -1
  221. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +0 -1
  222. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +0 -1
  223. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +0 -1
  224. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +0 -1
  225. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -420
  226. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +0 -1
  227. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +0 -1
  228. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -392
  229. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +0 -1
  230. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +0 -1
  231. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +0 -1
  232. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +0 -1
  233. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -147
  234. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +0 -1
  235. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +0 -1
  236. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -101
  237. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +0 -1
  238. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +0 -1
  239. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +0 -1
  240. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +0 -1
  241. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +0 -1
  242. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +0 -1
  243. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +0 -1
  244. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +0 -1
  245. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +0 -1
  246. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +0 -1
  247. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +0 -149
  248. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +0 -1
  249. package/lib/test/Integration/Services/CheckServiceTest.js.map +0 -1
  250. package/lib/test/Integration/Services/CreditServiceTest.js.map +0 -1
  251. package/lib/test/Integration/Services/DebitServiceTest.js.map +0 -1
  252. package/lib/test/Integration/Services/EBTServiceTest.js.map +0 -1
  253. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -111
  254. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +0 -1
  255. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -62
  256. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +0 -1
  257. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  258. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -125
  259. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +0 -1
  260. /package/lib/test/Integration/Gateways/GpApiConnector/{3DS2Test.d.ts → 3DS2.test.d.ts} +0 -0
  261. /package/lib/test/Integration/Gateways/GpApiConnector/{3DSecureTest.d.ts → 3DSecure.test.d.ts} +0 -0
  262. /package/lib/test/Integration/Gateways/GpApiConnector/{AccessTokenTest.d.ts → AccessToken.test.d.ts} +0 -0
  263. /package/lib/test/Integration/Gateways/GpApiConnector/{CreditCardNotPresentTest.d.ts → CreditCardNotPresent.test.d.ts} +0 -0
  264. /package/lib/test/Integration/Gateways/GpApiConnector/{CreditCardPresentTest.d.ts → DebitCard.test.d.ts} +0 -0
  265. /package/lib/test/Integration/Gateways/GpApiConnector/{DebitCardTest.d.ts → GpApiCertification.test.d.ts} +0 -0
  266. /package/lib/test/Integration/Gateways/GpApiConnector/{GpApiCertificationTest.d.ts → GpApiTokenManagement.test.d.ts} +0 -0
  267. /package/lib/test/Integration/Gateways/GpApiConnector/{GpApiTokenManagementTest.d.ts → ReportingDeposits.test.d.ts} +0 -0
  268. /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingDepositsTest.d.ts → ReportingDisputes.test.d.ts} +0 -0
  269. /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingSettlementTransactionsTest.d.ts → ReportingSettlementTransactions.test.d.ts} +0 -0
  270. /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingStoredPaymentMethodsTest.d.ts → ReportingStoredPaymentMethods.test.d.ts} +0 -0
  271. /package/lib/test/Integration/Gateways/GpApiConnector/{ReportingTransactionsTest.d.ts → ReportingTransactions.test.d.ts} +0 -0
  272. /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AuthTest.d.ts → Auth.test.d.ts} +0 -0
  273. /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{AvsTest.d.ts → Avs.test.d.ts} +0 -0
  274. /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
  275. /package/lib/test/Integration/Gateways/GpEcomConnector/Certification/{HoldTest.d.ts → Hold.test.d.ts} +0 -0
  276. /package/lib/test/Integration/Gateways/GpEcomConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
  277. /package/lib/test/Integration/Gateways/GpEcomConnector/{HppTest.d.ts → Hpp.test.d.ts} +0 -0
  278. /package/lib/test/Integration/Gateways/GpEcomConnector/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
  279. /package/lib/test/Integration/Gateways/PorticoConnector/{AchTest.d.ts → Ach.test.d.ts} +0 -0
  280. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{CheckTest.d.ts → Check.test.d.ts} +0 -0
  281. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceCheckTest.d.ts → Ecommerce.test.d.ts} +0 -0
  282. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{EcommerceTest.d.ts → EcommerceCheck.test.d.ts} +0 -0
  283. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoCheckTest.d.ts → Moto.test.d.ts} +0 -0
  284. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{MotoTest.d.ts → MotoCheck.test.d.ts} +0 -0
  285. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
  286. /package/lib/test/Integration/Gateways/PorticoConnector/Certifications/{RetailTest.d.ts → Retail.test.d.ts} +0 -0
  287. /package/lib/test/Integration/Gateways/PorticoConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
  288. /package/lib/test/Integration/Gateways/PorticoConnector/{DebitTest.d.ts → Debit.test.d.ts} +0 -0
  289. /package/lib/test/Integration/Gateways/PorticoConnector/{EbtTest.d.ts → Ebt.test.d.ts} +0 -0
  290. /package/lib/test/Integration/Gateways/PorticoConnector/{EcommerceTest.d.ts → Ecommerce.test.d.ts} +0 -0
  291. /package/lib/test/Integration/Gateways/PorticoConnector/{GiftTest.d.ts → Gift.test.d.ts} +0 -0
  292. /package/lib/test/Integration/Gateways/PorticoConnector/{PorticoManagementTokenTest.d.ts → PorticoManagementToken.test.d.ts} +0 -0
  293. /package/lib/test/Integration/Gateways/PorticoConnector/{RecurringTest.d.ts → Recurring.test.d.ts} +0 -0
  294. /package/lib/test/Integration/Gateways/PorticoConnector/{ReportingTest.d.ts → Reporting.test.d.ts} +0 -0
  295. /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{GetInformationCertificationTest.d.ts → GetInformationCertification.test.d.ts} +0 -0
  296. /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayAccountCertificationTest.d.ts → ProPayAccountCertification.test.d.ts} +0 -0
  297. /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayFundCertificationTest.d.ts → ProPayFundCertification.test.d.ts} +0 -0
  298. /package/lib/test/Integration/Gateways/ProPayConnector/Certifications/{ProPayInNetworkTransactionCertificationTest.d.ts → ProPayInNetworkTransactionCertification.test.d.ts} +0 -0
  299. /package/lib/test/Integration/Gateways/ProPayConnector/{GetInformationTest.d.ts → GetInformation.test.d.ts} +0 -0
  300. /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayAccountTest.d.ts → ProPayAccount.test.d.ts} +0 -0
  301. /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayFundsTest.d.ts → ProPayFunds.test.d.ts} +0 -0
  302. /package/lib/test/Integration/Gateways/ProPayConnector/{ProPayInNetworkTransactionTest.d.ts → ProPayInNetworkTransaction.test.d.ts} +0 -0
  303. /package/lib/test/Integration/Gateways/Terminals/UPA/{UpaMicTest.d.ts → UpaMic.test.d.ts} +0 -0
  304. /package/lib/test/Integration/Services/{CheckServiceTest.d.ts → CheckService.test.d.ts} +0 -0
  305. /package/lib/test/Integration/Services/{CreditServiceTest.d.ts → CreditService.test.d.ts} +0 -0
  306. /package/lib/test/Integration/Services/{DebitServiceTest.d.ts → DebitService.test.d.ts} +0 -0
  307. /package/lib/test/Integration/Services/{EBTServiceTest.d.ts → EBTService.test.d.ts} +0 -0
  308. /package/lib/test/Unit/Builders/AuthorizationBuilder/{ValidationTest.d.ts → Validation.test.d.ts} +0 -0
  309. /package/lib/test/Unit/Builders/ReportBuilder/{ValidationTest.d.ts → Validation.test.d.ts} +0 -0
  310. /package/lib/test/Unit/Gateways/GpEcomConnector/{CreditTest.d.ts → Credit.test.d.ts} +0 -0
  311. /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
- test.before(() => {
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
- test.beforeEach(() => {
42
+ beforeEach(() => {
49
43
  card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1;
50
44
  });
51
- test("full cycle v2 frictionless", async (t) => {
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(t, secureEcom);
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
- t.truthy(initAuth);
63
+ expect(initAuth).toBeTruthy();
70
64
  initAuth instanceof src_1.ThreeDSecure &&
71
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, initAuth.status) &&
72
- t.is("YES", initAuth.liabilityShift);
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
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, secureEcom2.status);
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
- t.truthy(transaction);
85
- t.is("SUCCESS", transaction.responseCode);
86
- t.is(src_1.TransactionStatus.CAPTURED, transaction.responseMessage);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(initAuth);
101
+ expect(initAuth).toBeTruthy();
108
102
  initAuth instanceof src_1.ThreeDSecure &&
109
- t.is(src_1.Secure3dStatus.NotAuthenticated, initAuth.status) &&
110
- t.not("YES", initAuth.liabilityShift);
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
- t.is(src_1.Secure3dStatus.NotAuthenticated, secureEcom2.status);
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
- t.truthy(transaction);
123
- t.is("SUCCESS", transaction.responseCode);
124
- t.is(src_1.TransactionStatus.CAPTURED, transaction.responseMessage);
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 (t) => {
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(t, secureEcom);
139
- t.truthy(secureEcom.payerAuthenticationRequest);
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
- t.truthy(initAuth);
145
+ expect(initAuth).toBeTruthy();
152
146
  initAuth instanceof src_1.ThreeDSecure &&
153
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, initAuth.status) &&
154
- t.is("YES", initAuth.liabilityShift);
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
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, secureEcom2.status);
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
- t.truthy(transaction);
167
- t.is("SUCCESS", transaction.responseCode);
168
- t.is(src_1.TransactionStatus.CAPTURED, transaction.responseMessage);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(response);
190
- assertInitiate3DSV2(t, response);
191
- t.is(src_1.Secure3dStatus.ChallengeRequired, response.status);
192
- t.truthy(response.payerAuthenticationRequest);
193
- t.truthy(response.issuerAcsUrl);
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
- t.true(authResponse.getStatus());
199
- t.truthy(authResponse.getMerchantData());
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
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, secureEcom2.status);
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
- t.truthy(transaction);
212
- t.is("SUCCESS", transaction.responseCode);
213
- t.is(src_1.TransactionStatus.CAPTURED, transaction.responseMessage);
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 (t) => {
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(t, secureEcom);
217
+ assertCheckEnrollment3DSV2(secureEcom);
224
218
  });
225
- test("card holder enrolled challenge required v2 - with idempotency key", async (t) => {
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(t, secureEcom);
234
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.checkEnrollment(card)
235
- .withCurrency(currency)
236
- .withIdempotencyKey(idempotencyKey)
237
- .withAmount(amount)
238
- .execute(), {
239
- instanceOf: src_1.GatewayError,
240
- });
241
- t.truthy(error);
242
- if (error) {
243
- t.is("40039", error.responseCode);
244
- t.is(error.responseMessage.includes("Idempotency Key seen before"), true);
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 (t) => {
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(t, secureEcom);
251
+ assertCheckEnrollment3DSV2(secureEcom);
257
252
  });
258
- test("card holder enrolled challenge required v2 - all preference value", async (t) => {
259
- Promise.all(Object.values(src_1.ChallengeRequestIndicator).map(async (value) => {
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(t, secureEcom);
266
- }));
260
+ assertCheckEnrollment3DSV2(secureEcom);
261
+ }
267
262
  });
268
- test("card holder enrolled challenge required v2 - stored credentials", async (t) => {
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(t, secureEcom);
274
+ assertCheckEnrollment3DSV2(secureEcom);
280
275
  });
281
- test("card holder enrolled challenge required v2 - all sources", async (t) => {
282
- Promise.all(Object.values(src_1.AuthenticationSource).map(async (value) => {
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(t, secureEcom);
289
- }));
283
+ assertCheckEnrollment3DSV2(secureEcom);
284
+ }
290
285
  });
291
- test("card holder enrolled challenge required v2 - with null payment method", async (t) => {
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.checkEnrollment(card)
298
- .withCurrency(currency)
299
- .withPaymentMethod(null)
300
- .withAmount(amount)
301
- .execute(), {
302
- instanceOf: src_1.BuilderError,
303
- });
304
- t.truthy(error);
305
- if (error) {
306
- // t.is("40007", error?.responseCode);
307
- // t.is(
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 (t) => {
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(t, secureEcom);
311
+ assertCheckEnrollment3DSV2(secureEcom);
323
312
  });
324
- test("card holder enrolled frictionless v2 - with idempotency key", async (t) => {
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(t, secureEcom);
333
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.checkEnrollment(card)
334
- .withCurrency(currency)
335
- .withIdempotencyKey(idempotencyKey)
336
- .withAmount(amount)
337
- .execute(), {
338
- instanceOf: src_1.GatewayError,
339
- });
340
- t.truthy(error);
341
- if (error) {
342
- t.is("40039", error.responseCode);
343
- t.is(error.responseMessage.includes("Idempotency Key seen before"), true);
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 (t) => {
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(t, secureEcom);
345
+ assertCheckEnrollment3DSV2(secureEcom);
357
346
  });
358
- test("card holder enrolled frictionless v2 - all preference values", async (t) => {
347
+ test("card holder enrolled frictionless v2 - all preference values", async () => {
359
348
  card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
360
- Promise.all(Object.values(src_1.ChallengeRequestIndicator).map(async (value) => {
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(t, secureEcom);
367
- }));
355
+ assertCheckEnrollment3DSV2(secureEcom);
356
+ }
368
357
  });
369
- test("card holder enrolled frictionless v2 - stored credentials", async (t) => {
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(t, secureEcom);
370
+ assertCheckEnrollment3DSV2(secureEcom);
382
371
  });
383
- test("card holder enrolled frictionless v2 - all sources", async (t) => {
384
- Promise.all(Object.values(src_1.AuthenticationSource).map(async (value) => {
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(t, secureEcom);
391
- }));
379
+ assertCheckEnrollment3DSV2(secureEcom);
380
+ }
392
381
  });
393
- test("card holder challenge required - post result", async (t) => {
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(t, secureEcom);
387
+ assertCheckEnrollment3DSV2(secureEcom);
399
388
  if (!(secureEcom instanceof src_1.Transaction)) {
400
- t.is(src_1.Secure3dStatus.Enrolled, secureEcom?.enrolled);
401
- t.is(src_1.Secure3dVersion.TWO, secureEcom.getVersion());
402
- t.is(src_1.Secure3dStatus.Available, secureEcom.status);
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
- t.truthy(initAuth);
402
+ expect(initAuth).toBeTruthy();
414
403
  if (initAuth instanceof src_1.ThreeDSecure) {
415
- t.is(src_1.Secure3dStatus.ChallengeRequired, initAuth.status);
416
- t.truthy(initAuth.issuerAcsUrl);
417
- t.truthy(initAuth.payerAuthenticationRequest);
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
- t.true(authResponse.getStatus());
423
- t.truthy(authResponse.getMerchantData());
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
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, secureEcom2.status);
431
- t.is("05", String(secureEcom2.eci));
432
- t.is("2.1.0", secureEcom2.messageVersion);
433
- t.truthy(secureEcom2.acsTransactionId);
434
- t.truthy(secureEcom2.serverTransactionId);
435
- t.truthy(secureEcom2.directoryServerTransactionId);
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 (t) => {
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(t, secureEcom);
436
+ assertCheckEnrollment3DSV2(secureEcom);
448
437
  if (!(secureEcom instanceof src_1.Transaction)) {
449
- t.is(src_1.Secure3dStatus.Enrolled, secureEcom?.enrolled);
450
- t.is(src_1.Secure3dVersion.TWO, secureEcom.getVersion());
451
- t.is(src_1.Secure3dStatus.Available, secureEcom.status);
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
- t.truthy(initAuth);
451
+ expect(initAuth).toBeTruthy();
463
452
  if (initAuth instanceof src_1.ThreeDSecure) {
464
- t.is(src_1.Secure3dStatus.ChallengeRequired, initAuth.status);
465
- t.truthy(initAuth.issuerAcsUrl);
466
- t.truthy(initAuth.payerAuthenticationRequest);
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
- t.true(authResponse.getStatus());
472
- t.truthy(authResponse.getMerchantData());
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
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, secureEcom2.status);
481
- t.is("05", String(secureEcom2.eci));
482
- t.is("2.1.0", secureEcom2.messageVersion);
483
- t.truthy(secureEcom2.acsTransactionId);
484
- t.truthy(secureEcom2.serverTransactionId);
485
- t.truthy(secureEcom2.directoryServerTransactionId);
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.getAuthenticationData()
488
- .withServerTransactionId(secureEcom2.serverTransactionId)
489
- .withIdempotencyKey(idempotencyKey)
490
- .execute(), {
491
- instanceOf: src_1.GatewayError,
492
- });
493
- t.truthy(error);
494
- if (error) {
495
- t.is("40039", error.responseCode);
496
- t.is(error.responseMessage.includes("Idempotency Key seen before"), true);
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 (t) => {
491
+ test("card holder challenge required - post result non existent id", async () => {
503
492
  const transactionId = "AUT_" + src_1.GenerationUtils.getGuuid();
504
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.getAuthenticationData()
505
- .withServerTransactionId(transactionId)
506
- .execute(), {
507
- instanceOf: src_1.GatewayError,
508
- });
509
- t.truthy(error);
510
- if (error) {
511
- t.is("40118", error.responseCode);
512
- t.is(error.responseMessage.includes(`Authentication ${transactionId} not found at this location.`), true);
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
- test("card holder challenge required - v2 initiate", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
533
- assertInitiate3DSV2(t, response);
523
+ expect(response).toBeTruthy();
524
+ assertInitiate3DSV2(response);
534
525
  }
535
526
  });
536
- test("card holder challenge required - v2 initiate with idempotency key", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
556
- assertInitiate3DSV2(t, response);
557
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
558
- .withAmount(amount)
559
- .withCurrency(currency)
560
- .withAuthenticationSource(src_1.AuthenticationSource.Browser)
561
- .withBrowserData(browserData)
562
- .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
563
- .withOrderCreateDate(formatedDate)
564
- .withAddress(shippingAddress, src_1.AddressType.Shipping)
565
- .withIdempotencyKey(idempotencyKey)
566
- .execute(), {
567
- instanceOf: src_1.GatewayError,
568
- });
569
- t.truthy(error);
570
- if (error) {
571
- t.is("40039", error.responseCode);
572
- t.is(error.responseMessage.includes("Idempotency Key seen before"), true);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(response);
597
- assertInitiate3DSV2(t, response);
588
+ expect(response).toBeTruthy();
589
+ assertInitiate3DSV2(response);
598
590
  }
599
591
  });
600
- test("card holder challenge required - v2 initiate method url set no", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
618
- assertInitiate3DSV2(t, response);
609
+ expect(response).toBeTruthy();
610
+ assertInitiate3DSV2(response);
619
611
  }
620
612
  });
621
- test("card holder challenge required - v2 initiate method url set unavailable", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
639
- assertInitiate3DSV2(t, response);
630
+ expect(response).toBeTruthy();
631
+ assertInitiate3DSV2(response);
640
632
  }
641
633
  });
642
- test("card holder challenge required - v2 initiate without shipping address", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
659
- assertInitiate3DSV2(t, response);
650
+ expect(response).toBeTruthy();
651
+ assertInitiate3DSV2(response);
660
652
  }
661
653
  });
662
- test("card holder challenge required - v2 initiate with gift card", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
683
- assertInitiate3DSV2(t, response);
674
+ expect(response).toBeTruthy();
675
+ assertInitiate3DSV2(response);
684
676
  }
685
677
  });
686
- test("card holder challenge required - v2 initiate with shipping method", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
705
- assertInitiate3DSV2(t, response);
696
+ expect(response).toBeTruthy();
697
+ assertInitiate3DSV2(response);
706
698
  }
707
699
  });
708
- test("card holder challenge required - v2 initiate with delivery email", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
728
- assertInitiate3DSV2(t, response);
719
+ expect(response).toBeTruthy();
720
+ assertInitiate3DSV2(response);
729
721
  }
730
722
  });
731
- test("card holder challenge required - v2 initiate all preference values", async (t) => {
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(t, secureEcom);
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
- t.truthy(response);
751
- assertInitiate3DSV2(t, response);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(response);
783
- assertInitiate3DSV2(t, response);
774
+ expect(response).toBeTruthy();
775
+ assertInitiate3DSV2(response);
784
776
  }
785
777
  }));
786
778
  });
787
- test("card holder enrolled challenge required - frictionless - v2 initiate", async (t) => {
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(t, secureEcom);
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
- t.truthy(initAuth);
799
+ expect(initAuth).toBeTruthy();
807
800
  if (initAuth instanceof src_1.ThreeDSecure) {
808
- t.is(src_1.Secure3dStatus.SuccessAuthenticated, initAuth.status);
809
- t.truthy(initAuth.issuerAcsUrl);
810
- t.truthy(initAuth.payerAuthenticationRequest);
811
- t.truthy(initAuth.acsTransactionId);
812
- t.truthy(initAuth.providerServerTransRef);
813
- t.truthy(initAuth.acsReferenceNumber);
814
- t.is("05", String(initAuth.eci));
815
- t.is("2.2.0", initAuth.messageVersion);
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 (t) => {
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
825
- .withAmount(amount)
826
- .withCurrency(currency)
827
- .withAuthenticationSource(src_1.AuthenticationSource.Browser)
828
- .withBrowserData(browserData)
829
- .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
830
- .withAddress(shippingAddress, src_1.AddressType.Shipping)
831
- .withShippingMethod(src_1.ShippingMethod.DigitalGoods)
832
- .withOrderCreateDate(formatedDate)
833
- .execute(), {
834
- instanceOf: src_1.GatewayError,
835
- });
836
- t.truthy(error);
837
- if (error) {
838
- t.is("40005", error.responseCode);
839
- t.is(error.responseMessage.includes("Request expects the following fields number"), true);
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 (t) => {
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
847
- .withAmount(amount)
848
- .withCurrency(currency)
849
- .withAuthenticationSource(src_1.AuthenticationSource.Browser)
850
- .withBrowserData(browserData)
851
- .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
852
- .withOrderCreateDate(formatedDate)
853
- .execute(), {
854
- instanceOf: src_1.GatewayError,
855
- });
856
- t.truthy(error);
857
- if (error) {
858
- t.is("40118", error.responseCode);
859
- t.is(error.responseMessage.includes(`Authentication ${secureEcom.serverTransactionId} not found at this location.`), true);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(response);
896
- assertInitiate3DSV2(t, response);
897
- t.truthy(response.payerAuthenticationRequest);
898
- t.truthy(response.acsInterface);
899
- t.truthy(response.acsUiTemplate);
900
- t.truthy(response.providerServerTransRef);
901
- t.is("NATIVE", response.acsInterface);
902
- t.is("OUT_OF_BAND", response.acsUiTemplate);
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 (t) => {
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(t, secureEcom);
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
- t.truthy(response);
939
- assertInitiate3DSV2(t, response);
933
+ expect(response).toBeTruthy();
934
+ assertInitiate3DSV2(response);
940
935
  }
941
936
  });
942
- test("challenge required v2 - initiate with mobile data and source browser", async (t) => {
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(t, secureEcom);
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
966
- .withAmount(amount)
967
- .withCurrency(currency)
968
- .withAuthenticationSource(src_1.AuthenticationSource.Browser)
969
- .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
970
- .withOrderCreateDate(formatedDate)
971
- .withMobileData(mobileData)
972
- .execute(), {
973
- instanceOf: src_1.GatewayError,
974
- });
975
- t.truthy(error);
976
- if (error) {
977
- t.is("40233", error.responseCode);
978
- t.is(error.responseMessage.includes("Required Data Element browser_data"), true);
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 (t) => {
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(t, secureEcom);
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
- const error = await t.throwsAsync(async () => await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
991
- .withAmount(amount)
992
- .withCurrency(currency)
993
- .withAuthenticationSource(src_1.AuthenticationSource.MobileSdk)
994
- .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
995
- .withOrderCreateDate(formatedDate)
996
- .execute(), {
997
- instanceOf: src_1.GatewayError,
998
- });
999
- t.truthy(error);
1000
- if (error) {
1001
- t.is("40233", error.responseCode);
1002
- t.is(error.responseMessage.includes("Required Data Element sdk_information"), true);
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 = (t, secureEcom) => {
1007
- t.truthy(secureEcom);
1003
+ const assertCheckEnrollment3DSV2 = (secureEcom) => {
1004
+ expect(secureEcom).toBeTruthy();
1008
1005
  if (!(secureEcom instanceof src_1.Transaction)) {
1009
- t.is(src_1.Secure3dStatus.Enrolled, secureEcom?.enrolled);
1010
- t.is(src_1.Secure3dVersion.TWO, secureEcom?.getVersion());
1011
- t.is(src_1.Secure3dStatus.Available, secureEcom.status);
1012
- t.truthy(secureEcom.issuerAcsUrl);
1013
- t.truthy(secureEcom.payerAuthenticationRequest);
1014
- t.falsy(secureEcom.eci);
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 = (t, initAuth) => {
1018
- t.truthy(initAuth);
1014
+ const assertInitiate3DSV2 = (initAuth) => {
1015
+ expect(initAuth).toBeTruthy();
1019
1016
  if (!(initAuth instanceof src_1.Transaction)) {
1020
- t.is(src_1.Secure3dStatus.ChallengeRequired, initAuth.status);
1021
- t.is("2.1.0", initAuth.messageVersion);
1022
- t.truthy(initAuth.issuerAcsUrl);
1023
- t.truthy(initAuth.payerAuthenticationRequest);
1024
- t.truthy(initAuth.acsTransactionId);
1025
- t.falsy(initAuth.eci);
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
- test.after(() => Data_1.BaseGpApiTestConfig.resetGpApiConfig());
1029
- //# sourceMappingURL=3DS2Test.js.map
1025
+ afterAll(() => Data_1.BaseGpApiTestConfig.resetGpApiConfig());
1026
+ //# sourceMappingURL=3DS2.test.js.map