globalpayments-api 3.6.2 → 3.8.0

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 (424) hide show
  1. package/CHANGELOG.md +143 -125
  2. package/lib/src/Builders/AuthorizationBuilder.d.ts +9 -1
  3. package/lib/src/Builders/AuthorizationBuilder.js +10 -1
  4. package/lib/src/Builders/AuthorizationBuilder.js.map +1 -1
  5. package/lib/src/Builders/BaseBuilder/Validations.d.ts +3 -1
  6. package/lib/src/Builders/BaseBuilder/Validations.js +5 -5
  7. package/lib/src/Builders/BaseBuilder/Validations.js.map +1 -1
  8. package/lib/src/Builders/ManagementBuilder.d.ts +17 -1
  9. package/lib/src/Builders/ManagementBuilder.js +22 -0
  10. package/lib/src/Builders/ManagementBuilder.js.map +1 -1
  11. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +19 -0
  12. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -1
  13. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.d.ts +2 -0
  14. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js +120 -0
  15. package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js.map +1 -1
  16. package/lib/src/Builders/TransactionReportBuilder.d.ts +7 -2
  17. package/lib/src/Builders/TransactionReportBuilder.js +28 -0
  18. package/lib/src/Builders/TransactionReportBuilder.js.map +1 -1
  19. package/lib/src/Entities/DisputeDocument.d.ts +5 -0
  20. package/lib/src/Entities/DisputeDocument.js +10 -0
  21. package/lib/src/Entities/DisputeDocument.js.map +1 -0
  22. package/lib/src/Entities/Document.d.ts +10 -0
  23. package/lib/src/Entities/Document.js +13 -0
  24. package/lib/src/Entities/Document.js.map +1 -0
  25. package/lib/src/Entities/Enums/DepositSortProperty.d.ts +6 -0
  26. package/lib/src/Entities/Enums/DepositSortProperty.js +11 -0
  27. package/lib/src/Entities/Enums/DepositSortProperty.js.map +1 -0
  28. package/lib/src/Entities/Enums/DisputeSortProperty.d.ts +12 -0
  29. package/lib/src/Entities/Enums/DisputeSortProperty.js +17 -0
  30. package/lib/src/Entities/Enums/DisputeSortProperty.js.map +1 -0
  31. package/lib/src/Entities/Enums/DisputeStage.d.ts +11 -0
  32. package/lib/src/Entities/Enums/DisputeStage.js +16 -0
  33. package/lib/src/Entities/Enums/DisputeStage.js.map +1 -0
  34. package/lib/src/Entities/Enums/DisputeStatus.d.ts +7 -0
  35. package/lib/src/Entities/Enums/DisputeStatus.js +12 -0
  36. package/lib/src/Entities/Enums/DisputeStatus.js.map +1 -0
  37. package/lib/src/Entities/Enums/DocumentCategory.d.ts +5 -0
  38. package/lib/src/Entities/Enums/DocumentCategory.js +10 -0
  39. package/lib/src/Entities/Enums/DocumentCategory.js.map +1 -0
  40. package/lib/src/Entities/Enums/FileType.d.ts +11 -0
  41. package/lib/src/Entities/Enums/FileType.js +16 -0
  42. package/lib/src/Entities/Enums/FileType.js.map +1 -0
  43. package/lib/src/Entities/Enums.d.ts +8 -0
  44. package/lib/src/Entities/Enums.js +8 -0
  45. package/lib/src/Entities/Enums.js.map +1 -1
  46. package/lib/src/Entities/HostedPaymentData.d.ts +3 -0
  47. package/lib/src/Entities/HostedPaymentData.js +3 -0
  48. package/lib/src/Entities/HostedPaymentData.js.map +1 -1
  49. package/lib/src/Entities/Reporting/DepositSummary.d.ts +29 -0
  50. package/lib/src/Entities/Reporting/DepositSummary.js +34 -0
  51. package/lib/src/Entities/Reporting/DepositSummary.js.map +1 -0
  52. package/lib/src/Entities/Reporting/DisputeSummary.d.ts +53 -0
  53. package/lib/src/Entities/Reporting/DisputeSummary.js +64 -0
  54. package/lib/src/Entities/Reporting/DisputeSummary.js.map +1 -0
  55. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.d.ts +4 -2
  56. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js +2 -0
  57. package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js.map +1 -1
  58. package/lib/src/Entities/Reporting/index.d.ts +2 -0
  59. package/lib/src/Entities/Reporting/index.js +2 -0
  60. package/lib/src/Entities/Reporting/index.js.map +1 -1
  61. package/lib/src/Entities/Transaction.d.ts +15 -1
  62. package/lib/src/Entities/Transaction.js +34 -0
  63. package/lib/src/Entities/Transaction.js.map +1 -1
  64. package/lib/src/Entities/index.d.ts +8 -0
  65. package/lib/src/Entities/index.js +8 -0
  66. package/lib/src/Entities/index.js.map +1 -1
  67. package/lib/src/Gateways/GpApiConnector.js +3 -0
  68. package/lib/src/Gateways/GpApiConnector.js.map +1 -1
  69. package/lib/src/Gateways/GpEcomConnector.js +9 -0
  70. package/lib/src/Gateways/GpEcomConnector.js.map +1 -1
  71. package/lib/src/Gateways/PorticoConnector.js +5 -0
  72. package/lib/src/Gateways/PorticoConnector.js.map +1 -1
  73. package/lib/src/Mapping/GpApiMapping.d.ts +3 -0
  74. package/lib/src/Mapping/GpApiMapping.js +128 -13
  75. package/lib/src/Mapping/GpApiMapping.js.map +1 -1
  76. package/lib/src/Services/ReportingService.d.ts +8 -1
  77. package/lib/src/Services/ReportingService.js +21 -0
  78. package/lib/src/Services/ReportingService.js.map +1 -1
  79. package/lib/test/Data/BaseGpApiTestConfig.d.ts +14 -0
  80. package/lib/test/Data/BaseGpApiTestConfig.js +50 -0
  81. package/lib/test/Data/BaseGpApiTestConfig.js.map +1 -0
  82. package/lib/test/Data/GpApi3DSTestCards.d.ts +17 -0
  83. package/lib/test/Data/GpApi3DSTestCards.js +22 -0
  84. package/lib/test/Data/GpApi3DSTestCards.js.map +1 -0
  85. package/lib/test/Data/TestCards.d.ts +24 -0
  86. package/lib/test/Data/TestCards.js +220 -0
  87. package/lib/test/Data/TestCards.js.map +1 -0
  88. package/lib/test/Data/TestChecks.d.ts +4 -0
  89. package/lib/test/Data/TestChecks.js +27 -0
  90. package/lib/test/Data/TestChecks.js.map +1 -0
  91. package/lib/test/Data/index.d.ts +4 -0
  92. package/lib/test/Data/index.js +21 -0
  93. package/lib/test/Data/index.js.map +1 -0
  94. package/lib/test/Integration/Gateways/AcsResponse.d.ts +12 -0
  95. package/lib/test/Integration/Gateways/AcsResponse.js +33 -0
  96. package/lib/test/Integration/Gateways/AcsResponse.js.map +1 -0
  97. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.d.ts +1 -0
  98. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +1026 -0
  99. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js.map +1 -0
  100. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.d.ts +1 -0
  101. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js +1029 -0
  102. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +1 -0
  103. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.d.ts +1 -0
  104. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +643 -0
  105. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js.map +1 -0
  106. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.d.ts +1 -0
  107. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js +649 -0
  108. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +1 -0
  109. package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.d.ts +1 -0
  110. package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js +130 -0
  111. package/lib/test/Integration/Gateways/GpApiConnector/AccessToken.test.js.map +1 -0
  112. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.d.ts +1 -0
  113. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +109 -0
  114. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +1 -0
  115. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.d.ts +1 -0
  116. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js +1070 -0
  117. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresent.test.js.map +1 -0
  118. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.d.ts +1 -0
  119. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +1025 -0
  120. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +1 -0
  121. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.d.ts +1 -0
  122. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +439 -0
  123. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +1 -0
  124. package/lib/test/Integration/Gateways/GpApiConnector/DebitCard.test.d.ts +1 -0
  125. package/lib/test/Integration/Gateways/GpApiConnector/DebitCard.test.js +137 -0
  126. package/lib/test/Integration/Gateways/GpApiConnector/DebitCard.test.js.map +1 -0
  127. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.d.ts +1 -0
  128. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js +143 -0
  129. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +1 -0
  130. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertification.test.d.ts +1 -0
  131. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertification.test.js +642 -0
  132. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertification.test.js.map +1 -0
  133. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.d.ts +1 -0
  134. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js +639 -0
  135. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +1 -0
  136. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.d.ts +1 -0
  137. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js +151 -0
  138. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagement.test.js.map +1 -0
  139. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.d.ts +1 -0
  140. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +149 -0
  141. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +1 -0
  142. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDeposits.test.d.ts +1 -0
  143. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDeposits.test.js +226 -0
  144. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDeposits.test.js.map +1 -0
  145. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.d.ts +1 -0
  146. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js +226 -0
  147. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +1 -0
  148. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.d.ts +1 -0
  149. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js +571 -0
  150. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDisputes.test.js.map +1 -0
  151. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactions.test.d.ts +1 -0
  152. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactions.test.js +430 -0
  153. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactions.test.js.map +1 -0
  154. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.d.ts +1 -0
  155. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js +434 -0
  156. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +1 -0
  157. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethods.test.d.ts +1 -0
  158. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethods.test.js +216 -0
  159. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethods.test.js.map +1 -0
  160. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +1 -0
  161. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +217 -0
  162. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +1 -0
  163. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactions.test.d.ts +1 -0
  164. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactions.test.js +340 -0
  165. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactions.test.js.map +1 -0
  166. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.d.ts +1 -0
  167. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js +338 -0
  168. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +1 -0
  169. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Auth.test.d.ts +1 -0
  170. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Auth.test.js +2426 -0
  171. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Auth.test.js.map +1 -0
  172. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.d.ts +1 -0
  173. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js +2446 -0
  174. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +1 -0
  175. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Avs.test.d.ts +1 -0
  176. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Avs.test.js +562 -0
  177. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Avs.test.js.map +1 -0
  178. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.d.ts +1 -0
  179. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js +506 -0
  180. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +1 -0
  181. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Credit.test.d.ts +1 -0
  182. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Credit.test.js +1292 -0
  183. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Credit.test.js.map +1 -0
  184. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.d.ts +1 -0
  185. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js +1296 -0
  186. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +1 -0
  187. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Hold.test.d.ts +1 -0
  188. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Hold.test.js +880 -0
  189. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/Hold.test.js.map +1 -0
  190. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.d.ts +1 -0
  191. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js +847 -0
  192. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +1 -0
  193. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.d.ts +1 -0
  194. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +207 -0
  195. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
  196. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.d.ts +1 -0
  197. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js +215 -0
  198. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +1 -0
  199. package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.d.ts +1 -0
  200. package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js +137 -0
  201. package/lib/test/Integration/Gateways/GpEcomConnector/Hpp.test.js.map +1 -0
  202. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.d.ts +1 -0
  203. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +99 -0
  204. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +1 -0
  205. package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.d.ts +1 -0
  206. package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js +124 -0
  207. package/lib/test/Integration/Gateways/GpEcomConnector/Recurring.test.js.map +1 -0
  208. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.d.ts +1 -0
  209. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +133 -0
  210. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +1 -0
  211. package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.d.ts +1 -0
  212. package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js +54 -0
  213. package/lib/test/Integration/Gateways/PorticoConnector/Ach.test.js.map +1 -0
  214. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +1 -0
  215. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +59 -0
  216. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +1 -0
  217. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.d.ts +1 -0
  218. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js +357 -0
  219. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Check.test.js.map +1 -0
  220. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +1 -0
  221. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +378 -0
  222. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +1 -0
  223. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.d.ts +1 -0
  224. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js +1667 -0
  225. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js.map +1 -0
  226. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheck.test.d.ts +1 -0
  227. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheck.test.js +80 -0
  228. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheck.test.js.map +1 -0
  229. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +1 -0
  230. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +86 -0
  231. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +1 -0
  232. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +1 -0
  233. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +1723 -0
  234. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +1 -0
  235. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Moto.test.d.ts +1 -0
  236. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Moto.test.js +1487 -0
  237. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Moto.test.js.map +1 -0
  238. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheck.test.d.ts +1 -0
  239. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheck.test.js +80 -0
  240. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheck.test.js.map +1 -0
  241. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +1 -0
  242. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +86 -0
  243. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +1 -0
  244. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +1 -0
  245. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +1760 -0
  246. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +1 -0
  247. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.d.ts +1 -0
  248. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js +393 -0
  249. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Recurring.test.js.map +1 -0
  250. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +1 -0
  251. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +420 -0
  252. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +1 -0
  253. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Retail.test.d.ts +1 -0
  254. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Retail.test.js +2102 -0
  255. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Retail.test.js.map +1 -0
  256. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +1 -0
  257. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +2221 -0
  258. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +1 -0
  259. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.d.ts +1 -0
  260. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +367 -0
  261. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -0
  262. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +1 -0
  263. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +392 -0
  264. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +1 -0
  265. package/lib/test/Integration/Gateways/PorticoConnector/Debit.test.d.ts +1 -0
  266. package/lib/test/Integration/Gateways/PorticoConnector/Debit.test.js +83 -0
  267. package/lib/test/Integration/Gateways/PorticoConnector/Debit.test.js.map +1 -0
  268. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +1 -0
  269. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +88 -0
  270. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +1 -0
  271. package/lib/test/Integration/Gateways/PorticoConnector/Ebt.test.d.ts +1 -0
  272. package/lib/test/Integration/Gateways/PorticoConnector/Ebt.test.js +63 -0
  273. package/lib/test/Integration/Gateways/PorticoConnector/Ebt.test.js.map +1 -0
  274. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +1 -0
  275. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +72 -0
  276. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +1 -0
  277. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.d.ts +1 -0
  278. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +136 -0
  279. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js.map +1 -0
  280. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +1 -0
  281. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +143 -0
  282. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +1 -0
  283. package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.d.ts +1 -0
  284. package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js +121 -0
  285. package/lib/test/Integration/Gateways/PorticoConnector/Gift.test.js.map +1 -0
  286. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +1 -0
  287. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +147 -0
  288. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +1 -0
  289. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementToken.test.d.ts +1 -0
  290. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementToken.test.js +40 -0
  291. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementToken.test.js.map +1 -0
  292. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.d.ts +1 -0
  293. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js +48 -0
  294. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +1 -0
  295. package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.d.ts +1 -0
  296. package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js +87 -0
  297. package/lib/test/Integration/Gateways/PorticoConnector/Recurring.test.js.map +1 -0
  298. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +1 -0
  299. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +101 -0
  300. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +1 -0
  301. package/lib/test/Integration/Gateways/PorticoConnector/Reporting.test.d.ts +1 -0
  302. package/lib/test/Integration/Gateways/PorticoConnector/Reporting.test.js +44 -0
  303. package/lib/test/Integration/Gateways/PorticoConnector/Reporting.test.js.map +1 -0
  304. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +1 -0
  305. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +50 -0
  306. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +1 -0
  307. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertification.test.d.ts +1 -0
  308. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertification.test.js +38 -0
  309. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertification.test.js.map +1 -0
  310. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.d.ts +1 -0
  311. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js +44 -0
  312. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +1 -0
  313. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertification.test.d.ts +1 -0
  314. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertification.test.js +206 -0
  315. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertification.test.js.map +1 -0
  316. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.d.ts +1 -0
  317. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js +221 -0
  318. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +1 -0
  319. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertification.test.d.ts +1 -0
  320. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertification.test.js +52 -0
  321. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertification.test.js.map +1 -0
  322. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.d.ts +1 -0
  323. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js +60 -0
  324. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +1 -0
  325. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertification.test.d.ts +1 -0
  326. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertification.test.js +72 -0
  327. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertification.test.js.map +1 -0
  328. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.d.ts +1 -0
  329. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js +80 -0
  330. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +1 -0
  331. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.d.ts +39 -0
  332. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.js +393 -0
  333. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.js.map +1 -0
  334. package/lib/test/Integration/Gateways/ProPayConnector/GetInformation.test.d.ts +1 -0
  335. package/lib/test/Integration/Gateways/ProPayConnector/GetInformation.test.js +37 -0
  336. package/lib/test/Integration/Gateways/ProPayConnector/GetInformation.test.js.map +1 -0
  337. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.d.ts +1 -0
  338. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js +44 -0
  339. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +1 -0
  340. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccount.test.d.ts +1 -0
  341. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccount.test.js +310 -0
  342. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccount.test.js.map +1 -0
  343. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.d.ts +1 -0
  344. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js +330 -0
  345. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +1 -0
  346. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFunds.test.d.ts +1 -0
  347. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFunds.test.js +53 -0
  348. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFunds.test.js.map +1 -0
  349. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.d.ts +1 -0
  350. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js +60 -0
  351. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +1 -0
  352. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransaction.test.d.ts +1 -0
  353. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransaction.test.js +72 -0
  354. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransaction.test.js.map +1 -0
  355. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.d.ts +1 -0
  356. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js +80 -0
  357. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +1 -0
  358. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.d.ts +34 -0
  359. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.js +322 -0
  360. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.js.map +1 -0
  361. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.d.ts +4 -0
  362. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.js +28 -0
  363. package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.js.map +1 -0
  364. package/lib/test/Integration/Gateways/Terminals/RequestIdProvider.d.ts +4 -0
  365. package/lib/test/Integration/Gateways/Terminals/RequestIdProvider.js +10 -0
  366. package/lib/test/Integration/Gateways/Terminals/RequestIdProvider.js.map +1 -0
  367. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.d.ts +1 -0
  368. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js +165 -0
  369. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMic.test.js.map +1 -0
  370. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.d.ts +1 -0
  371. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +149 -0
  372. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +1 -0
  373. package/lib/test/Integration/Gateways/ThreeDSecureAsClient.d.ts +16 -0
  374. package/lib/test/Integration/Gateways/ThreeDSecureAsClient.js +212 -0
  375. package/lib/test/Integration/Gateways/ThreeDSecureAsClient.js.map +1 -0
  376. package/lib/test/Integration/Services/CheckService.test.d.ts +1 -0
  377. package/lib/test/Integration/Services/CheckService.test.js +38 -0
  378. package/lib/test/Integration/Services/CheckService.test.js.map +1 -0
  379. package/lib/test/Integration/Services/CheckServiceTest.d.ts +1 -0
  380. package/lib/test/Integration/Services/CheckServiceTest.js +45 -0
  381. package/lib/test/Integration/Services/CheckServiceTest.js.map +1 -0
  382. package/lib/test/Integration/Services/CreditService.test.d.ts +1 -0
  383. package/lib/test/Integration/Services/CreditService.test.js +158 -0
  384. package/lib/test/Integration/Services/CreditService.test.js.map +1 -0
  385. package/lib/test/Integration/Services/CreditServiceTest.d.ts +1 -0
  386. package/lib/test/Integration/Services/CreditServiceTest.js +174 -0
  387. package/lib/test/Integration/Services/CreditServiceTest.js.map +1 -0
  388. package/lib/test/Integration/Services/DebitService.test.d.ts +1 -0
  389. package/lib/test/Integration/Services/DebitService.test.js +77 -0
  390. package/lib/test/Integration/Services/DebitService.test.js.map +1 -0
  391. package/lib/test/Integration/Services/DebitServiceTest.d.ts +1 -0
  392. package/lib/test/Integration/Services/DebitServiceTest.js +81 -0
  393. package/lib/test/Integration/Services/DebitServiceTest.js.map +1 -0
  394. package/lib/test/Integration/Services/EBTService.test.d.ts +1 -0
  395. package/lib/test/Integration/Services/EBTService.test.js +54 -0
  396. package/lib/test/Integration/Services/EBTService.test.js.map +1 -0
  397. package/lib/test/Integration/Services/EBTServiceTest.d.ts +1 -0
  398. package/lib/test/Integration/Services/EBTServiceTest.js +64 -0
  399. package/lib/test/Integration/Services/EBTServiceTest.js.map +1 -0
  400. package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.d.ts +1 -0
  401. package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js +122 -0
  402. package/lib/test/Unit/Builders/AuthorizationBuilder/Validation.test.js.map +1 -0
  403. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +1 -0
  404. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +111 -0
  405. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +1 -0
  406. package/lib/test/Unit/Builders/ReportBuilder/Validation.test.d.ts +1 -0
  407. package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js +66 -0
  408. package/lib/test/Unit/Builders/ReportBuilder/Validation.test.js.map +1 -0
  409. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +1 -0
  410. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +62 -0
  411. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +1 -0
  412. package/lib/test/Unit/Gateways/GpEcomConnector/Credit.test.d.ts +1 -0
  413. package/lib/test/Unit/Gateways/GpEcomConnector/Credit.test.js +32 -0
  414. package/lib/test/Unit/Gateways/GpEcomConnector/Credit.test.js.map +1 -0
  415. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.d.ts +1 -0
  416. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js +34 -0
  417. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +1 -0
  418. package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.d.ts +1 -0
  419. package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js +128 -0
  420. package/lib/test/Unit/Gateways/PorticoConnector/InputValidation.test.js.map +1 -0
  421. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +1 -0
  422. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +125 -0
  423. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +1 -0
  424. package/package.json +62 -71
@@ -0,0 +1,643 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const src_1 = require("../../../../src");
4
+ const Data_1 = require("../../../Data");
5
+ const ThreeDSecureAsClient_1 = require("../ThreeDSecureAsClient");
6
+ const AcsResponse_1 = require("../AcsResponse");
7
+ const currency = "GBP";
8
+ const amount = "10.01";
9
+ const date = new Date();
10
+ let gatewayProvider;
11
+ const card = new src_1.CreditCardData();
12
+ card.number = Data_1.GpApi3DSTestCards.CARDHOLDER_ENROLLED_V1;
13
+ card.expMonth = (date.getMonth() + 1).toString().padStart(2, "0");
14
+ card.expYear = (date.getFullYear() + 1).toString();
15
+ card.cvn = "131";
16
+ card.cardHolderName = "James Mason";
17
+ const shippingAddress = new src_1.Address();
18
+ shippingAddress.streetAddress1 = "Apartment 852";
19
+ shippingAddress.streetAddress2 = "Complex 741";
20
+ shippingAddress.streetAddress3 = "no";
21
+ shippingAddress.city = "Chicago";
22
+ shippingAddress.postalCode = "5001";
23
+ shippingAddress.state = "IL";
24
+ shippingAddress.countryCode = "840";
25
+ const browserData = new src_1.BrowserData();
26
+ browserData.acceptHeader =
27
+ "text/html,application/xhtml+xml,application/xml;q=9,image/webp,img/apng,*/*;q=0.8";
28
+ browserData.colorDepth = src_1.ColorDepth.TwentyFourBits;
29
+ browserData.ipAddress = "123.123.123.123";
30
+ browserData.javaEnabled = true;
31
+ browserData.javaScriptEnabled = true;
32
+ browserData.language = "en";
33
+ browserData.screenHeight = 1080;
34
+ browserData.screenWidth = 1920;
35
+ browserData.challengWindowSize = src_1.ChallengeWindowSize.Windowed600x400;
36
+ browserData.timeZone = "0";
37
+ browserData.userAgent =
38
+ "Mozilla/5.0 (Windows NT 6.1; Win64, x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36";
39
+ beforeAll(() => {
40
+ const config = Data_1.BaseGpApiTestConfig.gpApiSetupConfig(src_1.Channel.CardNotPresent);
41
+ src_1.ServicesContainer.configureService(config);
42
+ gatewayProvider = config.gatewayProvider;
43
+ });
44
+ test("frictionless full cycle v2", async () => {
45
+ const frictionlessSuccessfull3DSV2CardTests = {
46
+ "Frictionless v2.1": [
47
+ Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1,
48
+ src_1.Secure3dStatus.SuccessAuthenticated,
49
+ ],
50
+ "Frictionless no method url v2.1": [
51
+ Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_NO_METHOD_URL_V2_1,
52
+ src_1.Secure3dStatus.SuccessAuthenticated,
53
+ ],
54
+ "Frictionless v2.2": [
55
+ Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2,
56
+ src_1.Secure3dStatus.SuccessAuthenticated,
57
+ ],
58
+ "Frictionless no method url v2.2": [
59
+ Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_NO_METHOD_URL_V2_2,
60
+ src_1.Secure3dStatus.SuccessAuthenticated,
61
+ ],
62
+ };
63
+ for (const testCase of Object.keys(frictionlessSuccessfull3DSV2CardTests)) {
64
+ card.number = frictionlessSuccessfull3DSV2CardTests[testCase][0];
65
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
66
+ .withCurrency(currency)
67
+ .withAmount(amount)
68
+ .execute();
69
+ expect(secureEcom).toBeTruthy();
70
+ if (!(secureEcom instanceof src_1.Transaction)) {
71
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
72
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
73
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
74
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
75
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
76
+ .withAmount(amount)
77
+ .withCurrency(currency)
78
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
79
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
80
+ .withOrderCreateDate(formatedDate)
81
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
82
+ .withOrderTransactionType(src_1.OrderTransactionType.GoodsServicePurchase)
83
+ .withBrowserData(browserData)
84
+ .execute();
85
+ expect(initAuth).toBeTruthy();
86
+ expect(frictionlessSuccessfull3DSV2CardTests[testCase][1]).toBe(initAuth instanceof src_1.ThreeDSecure && initAuth.status);
87
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
88
+ .withServerTransactionId(secureEcom.serverTransactionId)
89
+ .withAmount(amount)
90
+ .execute();
91
+ card.threeDSecure = secureEcom2;
92
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
93
+ expect(frictionlessSuccessfull3DSV2CardTests[testCase][1]).toBe(secureEcom2.status);
94
+ expect("YES").toBe(secureEcom2.liabilityShift);
95
+ }
96
+ const response = await card.verify().withCurrency(currency).execute();
97
+ expect(response).toBeTruthy();
98
+ expect("SUCCESS").toBe(response.responseCode);
99
+ expect("VERIFIED").toBe(response.responseMessage);
100
+ const transaction = await card
101
+ .charge(amount)
102
+ .withCurrency(currency)
103
+ .execute();
104
+ expect(transaction).toBeTruthy();
105
+ expect("SUCCESS").toBe(transaction.responseCode);
106
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
107
+ }
108
+ }
109
+ });
110
+ test("frictionless full cycle v2 - failed", async () => {
111
+ const frictionlessSuccessfull3DSV2CardTests = {
112
+ "Frictionless failed 1": [
113
+ Data_1.GpApi3DSTestCards.CARD_AUTH_ATTEMPTED_BUT_NOT_SUCCESSFUL_V2_1,
114
+ src_1.Secure3dStatus.SuccessAttemptMade,
115
+ ],
116
+ "Frictionless failed 2": [
117
+ Data_1.GpApi3DSTestCards.CARD_AUTH_FAILED_V2_1,
118
+ src_1.Secure3dStatus.NotAuthenticated,
119
+ ],
120
+ "Frictionless failed 3": [
121
+ Data_1.GpApi3DSTestCards.CARD_AUTH_ISSUER_REJECTED_V2_1,
122
+ src_1.Secure3dStatus.Failed,
123
+ ],
124
+ "Frictionless failed 4": [
125
+ Data_1.GpApi3DSTestCards.CARD_AUTH_COULD_NOT_BE_PREFORMED_V2_1,
126
+ src_1.Secure3dStatus.Failed,
127
+ ],
128
+ "Frictionless failed 5": [
129
+ Data_1.GpApi3DSTestCards.CARD_AUTH_ATTEMPTED_BUT_NOT_SUCCESSFUL_V2_2,
130
+ src_1.Secure3dStatus.SuccessAttemptMade,
131
+ ],
132
+ "Frictionless failed 6": [
133
+ Data_1.GpApi3DSTestCards.CARD_AUTH_FAILED_V2_2,
134
+ src_1.Secure3dStatus.NotAuthenticated,
135
+ ],
136
+ "Frictionless failed 7": [
137
+ Data_1.GpApi3DSTestCards.CARD_AUTH_ISSUER_REJECTED_V2_2,
138
+ src_1.Secure3dStatus.Failed,
139
+ ],
140
+ "Frictionless failed 8": [
141
+ Data_1.GpApi3DSTestCards.CARD_AUTH_COULD_NOT_BE_PREFORMED_V2_2,
142
+ src_1.Secure3dStatus.Failed,
143
+ ],
144
+ };
145
+ for (const testCase of Object.keys(frictionlessSuccessfull3DSV2CardTests)) {
146
+ card.number = frictionlessSuccessfull3DSV2CardTests[testCase][0];
147
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
148
+ .withCurrency(currency)
149
+ .withAmount(amount)
150
+ .execute();
151
+ expect(secureEcom).toBeTruthy();
152
+ if (!(secureEcom instanceof src_1.Transaction)) {
153
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
154
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
155
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
156
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
157
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
158
+ .withAmount(amount)
159
+ .withCurrency(currency)
160
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
161
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
162
+ .withOrderCreateDate(formatedDate)
163
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
164
+ .withBrowserData(browserData)
165
+ .execute();
166
+ expect(initAuth).toBeTruthy();
167
+ expect(frictionlessSuccessfull3DSV2CardTests[testCase][1]).toBe(initAuth instanceof src_1.ThreeDSecure && initAuth.status);
168
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
169
+ .withServerTransactionId(secureEcom.serverTransactionId)
170
+ .withAmount(amount)
171
+ .execute();
172
+ const liabilityShift = frictionlessSuccessfull3DSV2CardTests[testCase][1] ==
173
+ src_1.Secure3dStatus.SuccessAttemptMade
174
+ ? "YES"
175
+ : "NO";
176
+ card.threeDSecure = secureEcom2;
177
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
178
+ expect(frictionlessSuccessfull3DSV2CardTests[testCase][1]).toBe(secureEcom2.status);
179
+ expect(liabilityShift).toBe(secureEcom2.liabilityShift);
180
+ }
181
+ const transaction = await card
182
+ .charge(amount)
183
+ .withCurrency(currency)
184
+ .execute();
185
+ expect(transaction).toBeTruthy();
186
+ expect("SUCCESS").toBe(transaction.responseCode);
187
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
188
+ }
189
+ }
190
+ });
191
+ test("card holder enrolled - challenge required - v2", async () => {
192
+ const challengeSuccessful3DSV2CardTests = {
193
+ "Challenge v2.1": [
194
+ Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_1,
195
+ src_1.Secure3dStatus.SuccessAuthenticated,
196
+ ],
197
+ "Challenge v2.2": [
198
+ Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_2,
199
+ src_1.Secure3dStatus.SuccessAuthenticated,
200
+ ],
201
+ };
202
+ for (const testCase of Object.keys(challengeSuccessful3DSV2CardTests)) {
203
+ card.number = challengeSuccessful3DSV2CardTests[testCase][0];
204
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
205
+ .withCurrency(currency)
206
+ .withAmount(amount)
207
+ .execute();
208
+ expect(secureEcom).toBeTruthy();
209
+ if (!(secureEcom instanceof src_1.Transaction)) {
210
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
211
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
212
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
213
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
214
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
215
+ .withAmount(amount)
216
+ .withCurrency(currency)
217
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
218
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
219
+ .withOrderCreateDate(formatedDate)
220
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
221
+ .withBrowserData(browserData)
222
+ .execute();
223
+ expect(initAuth).toBeTruthy();
224
+ if (initAuth instanceof src_1.ThreeDSecure) {
225
+ expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
226
+ expect(initAuth.issuerAcsUrl).toBeTruthy();
227
+ expect(initAuth.payerAuthenticationRequest).toBeTruthy();
228
+ const authClient = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
229
+ authClient.setGatewayProvider(gatewayProvider);
230
+ const authResponse = await authClient.authenticate_v2(initAuth);
231
+ if (authResponse instanceof AcsResponse_1.AcsResponse) {
232
+ expect(authResponse.getStatus()).toBe(true);
233
+ expect(authResponse.getMerchantData()).toBeTruthy();
234
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
235
+ .withServerTransactionId(authResponse.getMerchantData())
236
+ .withAmount(amount)
237
+ .execute();
238
+ card.threeDSecure = secureEcom2;
239
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
240
+ expect(challengeSuccessful3DSV2CardTests[testCase][1]).toBe(secureEcom2.status);
241
+ expect("YES").toBe(secureEcom2.liabilityShift);
242
+ }
243
+ const transaction = await card
244
+ .charge(amount)
245
+ .withCurrency(currency)
246
+ .execute();
247
+ expect(transaction).toBeTruthy();
248
+ expect("SUCCESS").toBe(transaction.responseCode);
249
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
250
+ }
251
+ }
252
+ }
253
+ }
254
+ });
255
+ test("card holder enrolled - challenge required - get results failed - v2", async () => {
256
+ card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_2;
257
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
258
+ .withCurrency(currency)
259
+ .withAmount(amount)
260
+ .execute();
261
+ expect(secureEcom).toBeTruthy();
262
+ if (!(secureEcom instanceof src_1.Transaction)) {
263
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
264
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
265
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
266
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
267
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
268
+ .withAmount(amount)
269
+ .withCurrency(currency)
270
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
271
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
272
+ .withOrderCreateDate(formatedDate)
273
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
274
+ .withBrowserData(browserData)
275
+ .execute();
276
+ expect(initAuth).toBeTruthy();
277
+ if (initAuth instanceof src_1.ThreeDSecure) {
278
+ expect(src_1.Secure3dStatus.Enrolled).toBe(initAuth.enrolled);
279
+ expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
280
+ expect(initAuth.issuerAcsUrl).toBeTruthy();
281
+ expect(initAuth.payerAuthenticationRequest).toBeTruthy();
282
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
283
+ .withServerTransactionId(initAuth.serverTransactionId)
284
+ .withAmount(amount)
285
+ .execute();
286
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
287
+ expect(src_1.Secure3dStatus.ChallengeRequired).toBe(secureEcom2.status);
288
+ }
289
+ }
290
+ }
291
+ });
292
+ test("full cycle with card tokenization v2", async () => {
293
+ card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1;
294
+ const response = await card.tokenize().execute();
295
+ const tokenizedCard = new src_1.CreditCardData();
296
+ tokenizedCard.token = response.token;
297
+ tokenizedCard.cardHolderName = "James Mason";
298
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(tokenizedCard)
299
+ .withCurrency(currency)
300
+ .withAmount(amount)
301
+ .execute();
302
+ expect(secureEcom).toBeTruthy();
303
+ if (!(secureEcom instanceof src_1.Transaction)) {
304
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
305
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
306
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
307
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
308
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
309
+ .withAmount(amount)
310
+ .withCurrency(currency)
311
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
312
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
313
+ .withOrderCreateDate(formatedDate)
314
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
315
+ .withOrderTransactionType(src_1.OrderTransactionType.GoodsServicePurchase)
316
+ .withBrowserData(browserData)
317
+ .execute();
318
+ expect(initAuth).toBeTruthy();
319
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom.status);
320
+ expect("YES").toBe(secureEcom.liabilityShift);
321
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
322
+ .withServerTransactionId(secureEcom.serverTransactionId)
323
+ .withAmount(amount)
324
+ .execute();
325
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
326
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
327
+ expect("YES").toBe(secureEcom2.liabilityShift);
328
+ }
329
+ tokenizedCard.threeDSecure = secureEcom2;
330
+ const response = await card.verify().withCurrency(currency).execute();
331
+ expect(response).toBeTruthy();
332
+ expect("SUCCESS").toBe(response.responseCode);
333
+ expect("VERIFIED").toBe(response.responseMessage);
334
+ const transaction = await card
335
+ .charge(amount)
336
+ .withCurrency(currency)
337
+ .execute();
338
+ expect(transaction).toBeTruthy();
339
+ expect("SUCCESS").toBe(transaction.responseCode);
340
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
341
+ }
342
+ });
343
+ test("frictionless full cycle - different amount - v2", async () => {
344
+ card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1;
345
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
346
+ .withCurrency(currency)
347
+ .withAmount(amount)
348
+ .execute();
349
+ expect(secureEcom).toBeTruthy();
350
+ if (!(secureEcom instanceof src_1.Transaction)) {
351
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
352
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
353
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
354
+ expect(amount).toBe(String(secureEcom.amount));
355
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
356
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
357
+ .withAmount(9)
358
+ .withCurrency(currency)
359
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
360
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
361
+ .withOrderCreateDate(formatedDate)
362
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
363
+ .withBrowserData(browserData)
364
+ .execute();
365
+ expect(initAuth).toBeTruthy();
366
+ if (initAuth instanceof src_1.ThreeDSecure) {
367
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
368
+ expect(amount).toBe(String(initAuth.getAmount()));
369
+ expect("YES").toBe(initAuth.liabilityShift);
370
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
371
+ .withServerTransactionId(initAuth.serverTransactionId)
372
+ .execute();
373
+ card.threeDSecure = initAuth;
374
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
375
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
376
+ expect("YES").toBe(secureEcom2.liabilityShift);
377
+ expect(amount).toBe(String(secureEcom2.getAmount()));
378
+ }
379
+ const transaction = await card
380
+ .charge(amount)
381
+ .withCurrency(currency)
382
+ .execute();
383
+ expect(transaction).toBeTruthy();
384
+ expect("SUCCESS").toBe(transaction.responseCode);
385
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
386
+ }
387
+ }
388
+ });
389
+ test("card holder enrolled - challenge required - v2 duplicate acs request", async () => {
390
+ card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_2;
391
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
392
+ .withCurrency(currency)
393
+ .withAmount(amount)
394
+ .execute();
395
+ expect(secureEcom).toBeTruthy();
396
+ if (!(secureEcom instanceof src_1.Transaction)) {
397
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
398
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
399
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
400
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
401
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
402
+ .withAmount(amount)
403
+ .withCurrency(currency)
404
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
405
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
406
+ .withOrderCreateDate(formatedDate)
407
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
408
+ .withBrowserData(browserData)
409
+ .execute();
410
+ expect(initAuth).toBeTruthy();
411
+ if (initAuth instanceof src_1.ThreeDSecure) {
412
+ expect(src_1.Secure3dStatus.ChallengeRequired).toBe(initAuth.status);
413
+ expect(initAuth.issuerAcsUrl).toBeTruthy();
414
+ expect(initAuth.payerAuthenticationRequest).toBeTruthy();
415
+ const authClient = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
416
+ authClient.setGatewayProvider(gatewayProvider);
417
+ const authResponse = await authClient.authenticate_v2(initAuth);
418
+ if (authResponse instanceof AcsResponse_1.AcsResponse) {
419
+ expect(authResponse.getStatus()).toBe(true);
420
+ expect(authResponse.getMerchantData()).toBeTruthy();
421
+ }
422
+ const authClient2 = new ThreeDSecureAsClient_1.ThreeDSecureAcsClient(secureEcom.issuerAcsUrl);
423
+ authClient2.setGatewayProvider(gatewayProvider);
424
+ const authResponse2 = await authClient2.authenticate_v2(initAuth);
425
+ if (authResponse2 instanceof AcsResponse_1.AcsResponse) {
426
+ expect(authResponse2.getStatus()).toBe(true);
427
+ expect(authResponse2.getMerchantData()).toBeTruthy();
428
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
429
+ .withServerTransactionId(authResponse2.getMerchantData())
430
+ .withAmount(amount)
431
+ .execute();
432
+ card.threeDSecure = secureEcom2;
433
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
434
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
435
+ expect("YES").toBe(secureEcom2.liabilityShift);
436
+ }
437
+ const transaction = await card
438
+ .charge(amount)
439
+ .withCurrency(currency)
440
+ .execute();
441
+ expect(transaction).toBeTruthy();
442
+ expect("SUCCESS").toBe(transaction.responseCode);
443
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
444
+ }
445
+ }
446
+ }
447
+ });
448
+ test("credit sale tokenized with stored credentials recurring", async () => {
449
+ card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1;
450
+ card.entryMethod = src_1.ManualEntryMethod.MOTO;
451
+ const storedCredentials = new src_1.StoredCredential();
452
+ storedCredentials.initiator = src_1.EnumMapping.mapStoredCredentialInitiator(gatewayProvider, src_1.StoredCredentialInitiator.Merchant);
453
+ storedCredentials.type = src_1.StoredCredentialType.RECURRING;
454
+ storedCredentials.sequence = src_1.StoredCredentialSequence.SUBSEQUENT;
455
+ storedCredentials.reason = src_1.StoredCredentialReason.INCREMENTAL;
456
+ const response = await card.tokenize().execute();
457
+ const tokenizedCard = new src_1.CreditCardData();
458
+ tokenizedCard.token = response.token;
459
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(tokenizedCard)
460
+ .withCurrency(currency)
461
+ .withAmount(amount)
462
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
463
+ .execute();
464
+ expect(secureEcom).toBeTruthy();
465
+ if (!(secureEcom instanceof src_1.Transaction)) {
466
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
467
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
468
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
469
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
470
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(tokenizedCard, secureEcom)
471
+ .withAmount(amount)
472
+ .withCurrency(currency)
473
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
474
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
475
+ .withOrderCreateDate(formatedDate)
476
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
477
+ .withBrowserData(browserData)
478
+ .execute();
479
+ expect(initAuth).toBeTruthy();
480
+ if (initAuth instanceof src_1.ThreeDSecure) {
481
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
482
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
483
+ .withServerTransactionId(secureEcom.serverTransactionId)
484
+ .withAmount(amount)
485
+ .execute();
486
+ tokenizedCard.threeDSecure = secureEcom2;
487
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
488
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
489
+ expect("YES").toBe(secureEcom2.liabilityShift);
490
+ }
491
+ const transaction = await tokenizedCard
492
+ .charge(amount)
493
+ .withCurrency(currency)
494
+ .execute();
495
+ expect(transaction).toBeTruthy();
496
+ expect("SUCCESS").toBe(transaction.responseCode);
497
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
498
+ expect(transaction.cardBrandTransactionId).toBeTruthy();
499
+ const recurringPayment = await tokenizedCard
500
+ .charge(amount)
501
+ .withCurrency(currency)
502
+ .withStoredCredentials(storedCredentials)
503
+ .withCardBrandStorage(src_1.StoredCredentialInitiator.Merchant, transaction.cardBrandTransactionId)
504
+ .execute();
505
+ expect(recurringPayment).toBeTruthy();
506
+ expect("SUCCESS").toBe(recurringPayment.responseCode);
507
+ expect(src_1.TransactionStatus.CAPTURED).toBe(recurringPayment.responseMessage);
508
+ expect(recurringPayment.cardBrandTransactionId).toBeTruthy();
509
+ }
510
+ }
511
+ });
512
+ test("frictionless full cycle - v2 - with mobile SDK", async () => {
513
+ card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_2;
514
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(card)
515
+ .withCurrency(currency)
516
+ .withAmount(amount)
517
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
518
+ .execute();
519
+ expect(secureEcom).toBeTruthy();
520
+ if (!(secureEcom instanceof src_1.Transaction)) {
521
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
522
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
523
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
524
+ const mobileData = new src_1.MobileData();
525
+ mobileData.encodedData =
526
+ "ew0KCSJEViI6ICIxLjAiLA0KCSJERCI6IHsNCgkJIkMwMDEiOiAiQW5kcm9pZCIsDQoJCSJDMDAyIjogIkhUQyBPbmVfTTgiLA0KCQkiQzAwNCI6ICI1LjAuMSIsDQoJCSJDMDA1IjogImVuX1VTIiwNCgkJIkMwMDYiOiAiRWFzdGVybiBTdGFuZGFyZCBUaW1lIiwNCgkJIkMwMDciOiAiMDY3OTc5MDMtZmI2MS00MWVkLTk0YzItNGQyYjc0ZTI3ZDE4IiwNCgkJIkMwMDkiOiAiSm9obidzIEFuZHJvaWQgRGV2aWNlIg0KCX0sDQoJIkRQTkEiOiB7DQoJCSJDMDEwIjogIlJFMDEiLA0KCQkiQzAxMSI6ICJSRTAzIg0KCX0sDQoJIlNXIjogWyJTVzAxIiwgIlNXMDQiXQ0KfQ0K";
527
+ mobileData.applicationReference = "f283b3ec-27da-42a1-acea-f3f70e75bbdc";
528
+ mobileData.sdkInterface = src_1.SdkInterface.Browser;
529
+ mobileData.sdkUiTypes = [src_1.SdkUiType.HtmlOther];
530
+ mobileData.ephemeralPublicKey = `{
531
+ "kty": "EC",
532
+ "crv": "P-256",
533
+ "x": "WWcpTjbOqiu_1aODllw5rYTq5oLXE_T0huCPjMIRbkI",
534
+ "y": "Wz_7anIeadV8SJZUfr4drwjzuWoUbOsHp5GdRZBAAiw"
535
+ }`;
536
+ mobileData.maximumTimeout = 50;
537
+ mobileData.referenceNumber = "3DS_LOA_SDK_PPFU_020100_00007";
538
+ mobileData.sdkTransReference = "b2385523-a66c-4907-ac3c-91848e8c0067";
539
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
540
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(card, secureEcom)
541
+ .withAmount(amount)
542
+ .withCurrency(currency)
543
+ .withAuthenticationSource(src_1.AuthenticationSource.MobileSdk)
544
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
545
+ .withOrderCreateDate(formatedDate)
546
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
547
+ .withOrderTransactionType(src_1.OrderTransactionType.GoodsServicePurchase)
548
+ .withMobileData(mobileData)
549
+ .execute();
550
+ expect(initAuth).toBeTruthy();
551
+ if (initAuth instanceof src_1.ThreeDSecure) {
552
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
553
+ expect(initAuth.issuerAcsUrl).toBeTruthy();
554
+ expect(initAuth.payerAuthenticationRequest).toBeTruthy();
555
+ expect(initAuth.acsTransactionId).toBeTruthy();
556
+ expect(initAuth.providerServerTransRef).toBeTruthy();
557
+ expect(initAuth.acsReferenceNumber).toBeTruthy();
558
+ expect("05").toBe(String(initAuth.eci));
559
+ expect("2.2.0").toBe(initAuth.messageVersion);
560
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
561
+ .withServerTransactionId(secureEcom.serverTransactionId)
562
+ .withAmount(amount)
563
+ .execute();
564
+ card.threeDSecure = secureEcom2;
565
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
566
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
567
+ expect("YES").toBe(secureEcom2.liabilityShift);
568
+ }
569
+ const transaction = await card
570
+ .charge(amount)
571
+ .withCurrency(currency)
572
+ .execute();
573
+ expect(transaction).toBeTruthy();
574
+ expect("SUCCESS").toBe(transaction.responseCode);
575
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
576
+ }
577
+ }
578
+ });
579
+ test("decoupled auth", async () => {
580
+ card.number = Data_1.GpApi3DSTestCards.CARD_AUTH_SUCCESSFUL_V2_1;
581
+ const response = await card.tokenize().execute();
582
+ const tokenizedCard = new src_1.CreditCardData();
583
+ tokenizedCard.token = response.token;
584
+ tokenizedCard.cardHolderName = "James Mason";
585
+ const secureEcom = await src_1.Secure3dService.checkEnrollment(tokenizedCard)
586
+ .withCurrency(currency)
587
+ .withAmount(amount)
588
+ .withDecoupledNotificationUrl("https://www.example.com/decoupledNotification")
589
+ .execute();
590
+ expect(secureEcom).toBeTruthy();
591
+ if (!(secureEcom instanceof src_1.Transaction)) {
592
+ expect(src_1.Secure3dStatus.Enrolled).toBe(secureEcom?.enrolled);
593
+ expect(src_1.Secure3dVersion.TWO).toBe(secureEcom.getVersion());
594
+ expect(src_1.Secure3dStatus.Available).toBe(secureEcom.status);
595
+ const formatedDate = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
596
+ const initAuth = await src_1.Secure3dService.initiateAuthentication(tokenizedCard, secureEcom)
597
+ .withAmount(amount)
598
+ .withCurrency(currency)
599
+ .withAuthenticationSource(src_1.AuthenticationSource.Browser)
600
+ .withMethodUrlCompletion(src_1.MethodUrlCompletion.Yes)
601
+ .withOrderCreateDate(formatedDate)
602
+ .withAddress(shippingAddress, src_1.AddressType.Shipping)
603
+ .withBrowserData(browserData)
604
+ .withDecoupledFlowRequest(true)
605
+ .withDecoupledFlowTimeout(9001)
606
+ .withDecoupledNotificationUrl("https://www.example.com/decoupledNotification")
607
+ .execute();
608
+ expect(initAuth).toBeTruthy();
609
+ if (initAuth instanceof src_1.ThreeDSecure) {
610
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(initAuth.status);
611
+ expect("YES").toBe(initAuth.liabilityShift);
612
+ }
613
+ const secureEcom2 = await src_1.Secure3dService.getAuthenticationData()
614
+ .withServerTransactionId(secureEcom.serverTransactionId)
615
+ .withAmount(amount)
616
+ .execute();
617
+ tokenizedCard.threeDSecure = secureEcom2;
618
+ if (secureEcom2 instanceof src_1.ThreeDSecure) {
619
+ expect(src_1.Secure3dStatus.SuccessAuthenticated).toBe(secureEcom2.status);
620
+ expect("YES").toBe(secureEcom2.liabilityShift);
621
+ }
622
+ const transaction = await tokenizedCard
623
+ .charge(amount)
624
+ .withCurrency(currency)
625
+ .execute();
626
+ expect(transaction).toBeTruthy();
627
+ expect("SUCCESS").toBe(transaction.responseCode);
628
+ expect(src_1.TransactionStatus.CAPTURED).toBe(transaction.responseMessage);
629
+ expect(transaction.cardBrandTransactionId).toBeTruthy();
630
+ }
631
+ });
632
+ test("exemption sale transaction", async () => {
633
+ card.number = Data_1.GpApi3DSTestCards.CARD_CHALLENGE_REQUIRED_V2_2;
634
+ const threeDS = new src_1.ThreeDSecure();
635
+ threeDS.exemptStatus = src_1.ExemptStatus.LowValue;
636
+ card.threeDSecure = threeDS;
637
+ const response = await card.charge(amount).withCurrency(currency).execute();
638
+ expect(response).toBeTruthy();
639
+ expect("SUCCESS").toBe(response.responseCode);
640
+ expect(src_1.TransactionStatus.CAPTURED).toBe(response.responseMessage);
641
+ });
642
+ afterAll(() => Data_1.BaseGpApiTestConfig.resetGpApiConfig());
643
+ //# sourceMappingURL=3DSecure.test.js.map