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,1487 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const src_1 = require("../../../../../src");
4
+ const Data_1 = require("../../../../Data");
5
+ const ecom = new src_1.EcommerceInfo();
6
+ ecom.channel = src_1.EcommerceChannel.Moto;
7
+ const config = new src_1.PorticoConfig();
8
+ config.secretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
9
+ const BATCH_NOT_OPEN = "Transaction was rejected because it requires a batch to be open.";
10
+ const BATCH_EMPTY = "Batch close was rejected because no transactions are associated with the currently open batch";
11
+ const useTokens = false;
12
+ const usePrepaid = false;
13
+ let visaToken = "";
14
+ let mastercardToken = "";
15
+ let discoverToken = "";
16
+ let amexToken = "";
17
+ beforeAll(() => {
18
+ src_1.ServicesContainer.configureService(config);
19
+ });
20
+ beforeAll(() => {
21
+ return new Promise((resolve, reject) => {
22
+ src_1.BatchService.closeBatch()
23
+ .then((response) => {
24
+ expect(response).toBeTruthy();
25
+ resolve();
26
+ })
27
+ .catch((e) => {
28
+ if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
29
+ e.message.indexOf(BATCH_EMPTY) !== -1) {
30
+ resolve();
31
+ return;
32
+ }
33
+ reject(e);
34
+ });
35
+ });
36
+ });
37
+ /// CARD VERIFY
38
+ /// Account verification
39
+ test.failing("001 - verify visa", () => {
40
+ const card = Data_1.TestCards.visaManual();
41
+ return new Promise((resolve, reject) => {
42
+ card
43
+ .verify()
44
+ .withRequestMultiUseToken(useTokens)
45
+ .withAllowDuplicates(true)
46
+ .execute()
47
+ .then((response) => {
48
+ expect(response).toBeTruthy();
49
+ expect(response.responseCode).toBe("00");
50
+ resolve();
51
+ })
52
+ .catch(reject);
53
+ });
54
+ });
55
+ test.failing("002 - verify mastercard", () => {
56
+ const card = Data_1.TestCards.masterCardManual();
57
+ return new Promise((resolve, reject) => {
58
+ card
59
+ .verify()
60
+ .withRequestMultiUseToken(useTokens)
61
+ .withAllowDuplicates(true)
62
+ .execute()
63
+ .then((response) => {
64
+ expect(response).toBeTruthy();
65
+ expect(response.responseCode).toBe("00");
66
+ resolve();
67
+ })
68
+ .catch(reject);
69
+ });
70
+ });
71
+ test("003 - verify discover", () => {
72
+ const card = Data_1.TestCards.discoverManual();
73
+ const address = new src_1.Address();
74
+ address.postalCode = "75024";
75
+ return new Promise((resolve, reject) => {
76
+ card
77
+ .verify()
78
+ .withAddress(address)
79
+ .withRequestMultiUseToken(useTokens)
80
+ .withAllowDuplicates(true)
81
+ .execute()
82
+ .then((response) => {
83
+ expect(response).toBeTruthy();
84
+ expect(response.responseCode).toBe("00");
85
+ resolve();
86
+ })
87
+ .catch(reject);
88
+ });
89
+ });
90
+ /// Address verification
91
+ test("004 - verify amex", () => {
92
+ const card = Data_1.TestCards.amexManual();
93
+ const address = new src_1.Address();
94
+ address.postalCode = "75024";
95
+ return new Promise((resolve, reject) => {
96
+ card
97
+ .verify()
98
+ .withAddress(address)
99
+ .withRequestMultiUseToken(useTokens)
100
+ .withAllowDuplicates(true)
101
+ .execute()
102
+ .then((response) => {
103
+ expect(response).toBeTruthy();
104
+ expect(response.responseCode).toBe("00");
105
+ resolve();
106
+ })
107
+ .catch(reject);
108
+ });
109
+ });
110
+ /// Balance Inquiry (for prepaid cards)
111
+ test("005 - balance inquiry visa", () => {
112
+ const card = Data_1.TestCards.visaSwipe();
113
+ return new Promise((resolve, reject) => {
114
+ card
115
+ .balanceInquiry()
116
+ .execute()
117
+ .then((response) => {
118
+ expect(response).toBeTruthy();
119
+ expect(response.responseCode).toBe("00");
120
+ resolve();
121
+ })
122
+ .catch(reject);
123
+ });
124
+ });
125
+ /// CREDIT SALE (for multi-use tokens only)
126
+ test("006 - charge visa token", () => {
127
+ const card = Data_1.TestCards.visaManual();
128
+ const address = new src_1.Address();
129
+ address.streetAddress1 = "6860 Dallas Pkwy";
130
+ address.postalCode = "75024";
131
+ return new Promise((resolve, reject) => {
132
+ card
133
+ .charge()
134
+ .withCurrency("USD")
135
+ .withAmount("13.01")
136
+ .withAddress(address)
137
+ .withRequestMultiUseToken(true)
138
+ .withAllowDuplicates(true)
139
+ .withEcommerceInfo(ecom)
140
+ .execute()
141
+ .then((response) => {
142
+ expect(response).toBeTruthy();
143
+ expect(response.responseCode).toBe("00");
144
+ expect(response.token).toBeTruthy();
145
+ visaToken = response.token;
146
+ resolve();
147
+ })
148
+ .catch(reject);
149
+ });
150
+ });
151
+ test("007 - charge mastercard token", () => {
152
+ const card = Data_1.TestCards.masterCardManual();
153
+ const address = new src_1.Address();
154
+ address.streetAddress1 = "6860";
155
+ address.postalCode = "75024";
156
+ return new Promise((resolve, reject) => {
157
+ card
158
+ .charge()
159
+ .withCurrency("USD")
160
+ .withAmount("13.02")
161
+ .withAddress(address)
162
+ .withRequestMultiUseToken(true)
163
+ .withAllowDuplicates(true)
164
+ .withEcommerceInfo(ecom)
165
+ .execute()
166
+ .then((response) => {
167
+ expect(response).toBeTruthy();
168
+ expect(response.responseCode).toBe("00");
169
+ expect(response.token).toBeTruthy();
170
+ mastercardToken = response.token;
171
+ resolve();
172
+ })
173
+ .catch(reject);
174
+ });
175
+ });
176
+ test("008 - charge discover token", () => {
177
+ const card = Data_1.TestCards.discoverManual();
178
+ const address = new src_1.Address();
179
+ address.streetAddress1 = "6860 Dallas Pkwy";
180
+ address.postalCode = "75024";
181
+ return new Promise((resolve, reject) => {
182
+ card
183
+ .charge()
184
+ .withCurrency("USD")
185
+ .withAmount("13.03")
186
+ .withAddress(address)
187
+ .withRequestMultiUseToken(true)
188
+ .withAllowDuplicates(true)
189
+ .withEcommerceInfo(ecom)
190
+ .execute()
191
+ .then((response) => {
192
+ expect(response).toBeTruthy();
193
+ expect(response.responseCode).toBe("00");
194
+ expect(response.token).toBeTruthy();
195
+ discoverToken = response.token;
196
+ resolve();
197
+ })
198
+ .catch(reject);
199
+ });
200
+ });
201
+ test("009 - charge amex token", () => {
202
+ const card = Data_1.TestCards.amexManual();
203
+ const address = new src_1.Address();
204
+ address.streetAddress1 = "6860 Dallas Pkwy";
205
+ address.postalCode = "75024";
206
+ return new Promise((resolve, reject) => {
207
+ card
208
+ .charge()
209
+ .withCurrency("USD")
210
+ .withAmount("13.04")
211
+ .withAddress(address)
212
+ .withRequestMultiUseToken(true)
213
+ .withAllowDuplicates(true)
214
+ .withEcommerceInfo(ecom)
215
+ .execute()
216
+ .then((response) => {
217
+ expect(response).toBeTruthy();
218
+ expect(response.responseCode).toBe("00");
219
+ expect(response.token).toBeTruthy();
220
+ amexToken = response.token;
221
+ resolve();
222
+ })
223
+ .catch(reject);
224
+ });
225
+ });
226
+ /// CREDIT SALE
227
+ test("010 - charge visa", () => {
228
+ let card = Data_1.TestCards.visaManual();
229
+ const address = new src_1.Address();
230
+ address.streetAddress1 = "6860 Dallas Pkwy";
231
+ address.postalCode = "75024";
232
+ if (useTokens) {
233
+ card = new src_1.CreditCardData();
234
+ card.token = visaToken;
235
+ }
236
+ return new Promise((resolve) => {
237
+ card
238
+ .charge()
239
+ .withCurrency("USD")
240
+ .withAmount("17.01")
241
+ .withAddress(address)
242
+ .withInvoiceNumber("123456")
243
+ .withAllowDuplicates(true)
244
+ .withEcommerceInfo(ecom)
245
+ .execute()
246
+ .then((response) => {
247
+ expect(response).toBeTruthy();
248
+ expect(response.responseCode).toBe("00");
249
+ resolve();
250
+ });
251
+ });
252
+ });
253
+ test.failing("011 - charge mastercard", () => {
254
+ let card = Data_1.TestCards.masterCardManual();
255
+ const address = new src_1.Address();
256
+ address.streetAddress1 = "6860";
257
+ address.postalCode = "75024";
258
+ if (useTokens) {
259
+ card = new src_1.CreditCardData();
260
+ card.token = mastercardToken;
261
+ }
262
+ return new Promise((resolve, reject) => {
263
+ card
264
+ .charge()
265
+ .withCurrency("USD")
266
+ .withAmount("17.02")
267
+ .withAddress(address)
268
+ .withInvoiceNumber("123456")
269
+ .withAllowDuplicates(true)
270
+ .withEcommerceInfo(ecom)
271
+ .execute()
272
+ .then((response) => {
273
+ expect(response).toBeTruthy();
274
+ expect(response.responseCode).toBe("00");
275
+ resolve();
276
+ })
277
+ .catch(reject);
278
+ });
279
+ });
280
+ test.failing("012 - charge discover", () => {
281
+ let card = Data_1.TestCards.discoverManual();
282
+ const address = new src_1.Address();
283
+ address.streetAddress1 = "6860";
284
+ address.postalCode = "750241234";
285
+ if (useTokens) {
286
+ card = new src_1.CreditCardData();
287
+ card.token = discoverToken;
288
+ }
289
+ return new Promise((resolve, reject) => {
290
+ card
291
+ .charge()
292
+ .withCurrency("USD")
293
+ .withAmount("17.03")
294
+ .withAddress(address)
295
+ .withInvoiceNumber("123456")
296
+ .withAllowDuplicates(true)
297
+ .withEcommerceInfo(ecom)
298
+ .execute()
299
+ .then((response) => {
300
+ expect(response).toBeTruthy();
301
+ expect(response.responseCode).toBe("00");
302
+ resolve();
303
+ })
304
+ .catch(reject);
305
+ });
306
+ });
307
+ test.failing("013 - charge amex", () => {
308
+ let card = Data_1.TestCards.amexManual();
309
+ const address = new src_1.Address();
310
+ address.streetAddress1 = "6860 Dallas Pkwy";
311
+ address.postalCode = "75024";
312
+ if (useTokens) {
313
+ card = new src_1.CreditCardData();
314
+ card.token = amexToken;
315
+ }
316
+ return new Promise((resolve, reject) => {
317
+ card
318
+ .charge()
319
+ .withCurrency("USD")
320
+ .withAmount("17.04")
321
+ .withAddress(address)
322
+ .withInvoiceNumber("123456")
323
+ .withAllowDuplicates(true)
324
+ .withEcommerceInfo(ecom)
325
+ .execute()
326
+ .then((response) => {
327
+ expect(response).toBeTruthy();
328
+ expect(response.responseCode).toBe("00");
329
+ resolve();
330
+ })
331
+ .catch(reject);
332
+ });
333
+ });
334
+ test.failing("014 - charge jcb", () => {
335
+ const card = Data_1.TestCards.jcbManual();
336
+ const address = new src_1.Address();
337
+ address.streetAddress1 = "6860 Dallas Pkwy";
338
+ address.postalCode = "75024";
339
+ return new Promise((resolve, reject) => {
340
+ card
341
+ .charge()
342
+ .withCurrency("USD")
343
+ .withAmount("17.04")
344
+ .withAddress(address)
345
+ .withInvoiceNumber("123456")
346
+ .withAllowDuplicates(true)
347
+ .withEcommerceInfo(ecom)
348
+ .execute()
349
+ .then((response) => {
350
+ expect(response).toBeTruthy();
351
+ expect(response.responseCode).toBe("00");
352
+ resolve();
353
+ })
354
+ .catch(reject);
355
+ });
356
+ });
357
+ /// AUTHORIZATION
358
+ test.failing("015 - authorization visa", () => {
359
+ // test 015a Authorization
360
+ const card = Data_1.TestCards.visaManual();
361
+ const address = new src_1.Address();
362
+ address.streetAddress1 = "6860 Dallas Pkwy";
363
+ address.postalCode = "75024";
364
+ return new Promise((resolve) => {
365
+ card
366
+ .authorize("17.06")
367
+ .withCurrency("USD")
368
+ .withAddress(address)
369
+ .withInvoiceNumber("123456")
370
+ .withAllowDuplicates(true)
371
+ .withEcommerceInfo(ecom)
372
+ .execute()
373
+ .then((response) => {
374
+ expect(response).toBeTruthy();
375
+ expect(response.responseCode).toBe("00");
376
+ resolve();
377
+ });
378
+ });
379
+ });
380
+ test.failing("016 - authorization mastercard", () => {
381
+ // test 016a Authorization
382
+ const card = Data_1.TestCards.masterCardManual();
383
+ const address = new src_1.Address();
384
+ address.streetAddress1 = "6860 Dallas Pkwy";
385
+ address.postalCode = "750241234";
386
+ return new Promise((resolve) => {
387
+ card
388
+ .authorize("17.07")
389
+ .withCurrency("USD")
390
+ .withAddress(address)
391
+ .withInvoiceNumber("123456")
392
+ .withAllowDuplicates(true)
393
+ .withEcommerceInfo(ecom)
394
+ .execute()
395
+ .then((response) => {
396
+ expect(response).toBeTruthy();
397
+ expect(response.responseCode).toBe("00");
398
+ resolve();
399
+ });
400
+ });
401
+ });
402
+ test.failing("017 - authorization discover", () => {
403
+ // test 017a Authorization
404
+ const card = Data_1.TestCards.discoverManual();
405
+ const address = new src_1.Address();
406
+ address.streetAddress1 = "6860";
407
+ address.postalCode = "75024";
408
+ return new Promise((resolve, reject) => {
409
+ card
410
+ .authorize("17.08")
411
+ .withCurrency("USD")
412
+ .withAddress(address)
413
+ .withInvoiceNumber("123456")
414
+ .withAllowDuplicates(true)
415
+ .withEcommerceInfo(ecom)
416
+ .execute()
417
+ .then((response) => {
418
+ expect(response).toBeTruthy();
419
+ expect(response.responseCode).toBe("00");
420
+ return response;
421
+ })
422
+ .then(() => {
423
+ // test 017b Capture/AddToBatch
424
+ // do not capture
425
+ resolve();
426
+ })
427
+ .catch(reject);
428
+ });
429
+ });
430
+ /// PARTIALLY APPROVED SALE
431
+ test.failing("018 - partial approval visa", () => {
432
+ const address = new src_1.Address();
433
+ address.streetAddress1 = "6860";
434
+ address.postalCode = "75024";
435
+ const card = Data_1.TestCards.visaManual();
436
+ return new Promise((resolve, reject) => {
437
+ card
438
+ .charge(130)
439
+ .withCurrency("USD")
440
+ .withAddress(address)
441
+ .withInvoiceNumber("123456")
442
+ .withAllowPartialAuth(true)
443
+ .withAllowDuplicates(true)
444
+ .withEcommerceInfo(ecom)
445
+ .execute()
446
+ .then((response) => {
447
+ expect(response).toBeTruthy();
448
+ expect(response.responseCode).toBe("10");
449
+ expect(response.authorizedAmount).toBeTruthy();
450
+ expect(response.authorizedAmount).toBe("110.00");
451
+ resolve();
452
+ })
453
+ .catch(reject);
454
+ });
455
+ });
456
+ test.failing("019 - partial approval discover", () => {
457
+ const address = new src_1.Address();
458
+ address.streetAddress1 = "6860";
459
+ address.postalCode = "75024";
460
+ const card = Data_1.TestCards.discoverManual();
461
+ return new Promise((resolve, reject) => {
462
+ card
463
+ .charge(145)
464
+ .withCurrency("USD")
465
+ .withAddress(address)
466
+ .withInvoiceNumber("123456")
467
+ .withAllowPartialAuth(true)
468
+ .withAllowDuplicates(true)
469
+ .withEcommerceInfo(ecom)
470
+ .execute()
471
+ .then((response) => {
472
+ expect(response).toBeTruthy();
473
+ expect(response.responseCode).toBe("10");
474
+ expect(response.authorizedAmount).toBeTruthy();
475
+ expect(response.authorizedAmount).toBe("65.00");
476
+ resolve();
477
+ })
478
+ .catch(reject);
479
+ });
480
+ });
481
+ test.failing("020 - partial approval mastercard", () => {
482
+ const address = new src_1.Address();
483
+ address.streetAddress1 = "6860";
484
+ address.postalCode = "75024";
485
+ const card = Data_1.TestCards.masterCardManual();
486
+ return new Promise((resolve, reject) => {
487
+ card
488
+ .charge(155)
489
+ .withCurrency("USD")
490
+ .withAddress(address)
491
+ .withInvoiceNumber("123456")
492
+ .withAllowPartialAuth(true)
493
+ .withAllowDuplicates(true)
494
+ .withEcommerceInfo(ecom)
495
+ .execute()
496
+ .then((response) => {
497
+ expect(response).toBeTruthy();
498
+ expect(response.responseCode).toBe("10");
499
+ expect(response.authorizedAmount).toBeTruthy();
500
+ expect(response.authorizedAmount).toBe("100.00");
501
+ resolve();
502
+ })
503
+ .catch(reject);
504
+ });
505
+ });
506
+ /// LEVEL II CORPORATE PURCHASE CARD
507
+ test.failing("021 - level ii response b", () => {
508
+ const address = new src_1.Address();
509
+ address.streetAddress1 = "6860 Dallas Pkwy";
510
+ address.postalCode = "750241234";
511
+ const card = Data_1.TestCards.visaManual();
512
+ return new Promise((resolve) => {
513
+ card
514
+ .charge(112.34)
515
+ .withCurrency("USD")
516
+ .withAddress(address)
517
+ .withCommercialRequest(true)
518
+ .withAllowDuplicates(true)
519
+ .withEcommerceInfo(ecom)
520
+ .execute()
521
+ .then((response) => {
522
+ expect(response).toBeTruthy();
523
+ expect(response.responseCode).toBe("00");
524
+ expect(response.commercialIndicator).toBe("B");
525
+ resolve();
526
+ });
527
+ });
528
+ });
529
+ test.failing("022 - level ii response b", () => {
530
+ const address = new src_1.Address();
531
+ address.streetAddress1 = "6860";
532
+ address.postalCode = "750241234";
533
+ const card = Data_1.TestCards.visaManual();
534
+ return new Promise((resolve) => {
535
+ card
536
+ .charge(112.34)
537
+ .withCurrency("USD")
538
+ .withAddress(address)
539
+ .withCommercialRequest(true)
540
+ .withAllowDuplicates(true)
541
+ .withEcommerceInfo(ecom)
542
+ .execute()
543
+ .then((response) => {
544
+ expect(response).toBeTruthy();
545
+ expect(response.responseCode).toBe("00");
546
+ expect(response.commercialIndicator).toBe("B");
547
+ resolve();
548
+ });
549
+ });
550
+ });
551
+ test.failing("023 - level ii response r", () => {
552
+ const address = new src_1.Address();
553
+ address.streetAddress1 = "6860";
554
+ address.postalCode = "75024";
555
+ const card = Data_1.TestCards.visaManual();
556
+ return new Promise((resolve) => {
557
+ card
558
+ .charge(123.45)
559
+ .withCurrency("USD")
560
+ .withAddress(address)
561
+ .withCommercialRequest(true)
562
+ .withAllowDuplicates(true)
563
+ .withEcommerceInfo(ecom)
564
+ .execute()
565
+ .then((response) => {
566
+ expect(response).toBeTruthy();
567
+ expect(response.responseCode).toBe("00");
568
+ expect(response.commercialIndicator).toBe("R");
569
+ resolve();
570
+ });
571
+ });
572
+ });
573
+ test.failing("024 - level ii response s", () => {
574
+ const address = new src_1.Address();
575
+ address.streetAddress1 = "6860";
576
+ address.postalCode = "75024";
577
+ const card = Data_1.TestCards.visaManual();
578
+ return new Promise((resolve) => {
579
+ card
580
+ .charge(134.56)
581
+ .withCurrency("USD")
582
+ .withAddress(address)
583
+ .withCommercialRequest(true)
584
+ .withAllowDuplicates(true)
585
+ .withEcommerceInfo(ecom)
586
+ .execute()
587
+ .then((response) => {
588
+ expect(response).toBeTruthy();
589
+ expect(response.responseCode).toBe("00");
590
+ expect(response.commercialIndicator).toBe("S");
591
+ resolve();
592
+ });
593
+ });
594
+ });
595
+ test.failing("025 - level ii response s", () => {
596
+ const address = new src_1.Address();
597
+ address.streetAddress1 = "6860";
598
+ address.postalCode = "75024";
599
+ const card = Data_1.TestCards.masterCardManual();
600
+ return new Promise((resolve) => {
601
+ card
602
+ .charge(111.06)
603
+ .withCurrency("USD")
604
+ .withAddress(address)
605
+ .withCommercialRequest(true)
606
+ .withAllowDuplicates(true)
607
+ .withEcommerceInfo(ecom)
608
+ .execute()
609
+ .then((response) => {
610
+ expect(response).toBeTruthy();
611
+ expect(response.responseCode).toBe("00");
612
+ expect(response.commercialIndicator).toBe("S");
613
+ resolve();
614
+ });
615
+ });
616
+ });
617
+ test.failing("026 - level ii response s", () => {
618
+ const address = new src_1.Address();
619
+ address.streetAddress1 = "6860";
620
+ address.postalCode = "75024";
621
+ const card = Data_1.TestCards.masterCardManual();
622
+ return new Promise((resolve) => {
623
+ card
624
+ .charge(111.07)
625
+ .withCurrency("USD")
626
+ .withAddress(address)
627
+ .withCommercialRequest(true)
628
+ .withAllowDuplicates(true)
629
+ .withEcommerceInfo(ecom)
630
+ .execute()
631
+ .then((response) => {
632
+ expect(response).toBeTruthy();
633
+ expect(response.responseCode).toBe("00");
634
+ expect(response.commercialIndicator).toBe("S");
635
+ resolve();
636
+ });
637
+ });
638
+ });
639
+ test.failing("027 - level ii response s", () => {
640
+ const address = new src_1.Address();
641
+ address.streetAddress1 = "6860";
642
+ address.postalCode = "75024";
643
+ const card = Data_1.TestCards.masterCardManual();
644
+ return new Promise((resolve) => {
645
+ card
646
+ .charge(111.08)
647
+ .withCurrency("USD")
648
+ .withAddress(address)
649
+ .withCommercialRequest(true)
650
+ .withAllowDuplicates(true)
651
+ .withEcommerceInfo(ecom)
652
+ .execute()
653
+ .then((response) => {
654
+ expect(response).toBeTruthy();
655
+ expect(response.responseCode).toBe("00");
656
+ expect(response.commercialIndicator).toBe("S");
657
+ resolve();
658
+ });
659
+ });
660
+ });
661
+ test.failing("028 - level ii response s", () => {
662
+ const address = new src_1.Address();
663
+ address.streetAddress1 = "6860";
664
+ address.postalCode = "75024";
665
+ const card = Data_1.TestCards.masterCardManual();
666
+ return new Promise((resolve) => {
667
+ card
668
+ .charge(111.09)
669
+ .withCurrency("USD")
670
+ .withAddress(address)
671
+ .withCommercialRequest(true)
672
+ .withAllowDuplicates(true)
673
+ .withEcommerceInfo(ecom)
674
+ .execute()
675
+ .then((response) => {
676
+ expect(response).toBeTruthy();
677
+ expect(response.responseCode).toBe("00");
678
+ expect(response.commercialIndicator).toBe("S");
679
+ resolve();
680
+ });
681
+ });
682
+ });
683
+ test.failing("029 - level ii no response", () => {
684
+ const address = new src_1.Address();
685
+ address.streetAddress1 = "6860";
686
+ address.postalCode = "75024";
687
+ const card = Data_1.TestCards.amexManual();
688
+ return new Promise((resolve) => {
689
+ card
690
+ .charge(111.1)
691
+ .withCurrency("USD")
692
+ .withAddress(address)
693
+ .withCommercialRequest(true)
694
+ .withAllowDuplicates(true)
695
+ .withEcommerceInfo(ecom)
696
+ .execute()
697
+ .then((response) => {
698
+ expect(response).toBeTruthy();
699
+ expect(response.responseCode).toBe("00");
700
+ expect(response.commercialIndicator).toBe("0");
701
+ resolve();
702
+ });
703
+ });
704
+ });
705
+ test.failing("030 - level ii no response", () => {
706
+ const address = new src_1.Address();
707
+ address.streetAddress1 = "6860";
708
+ address.postalCode = "750241234";
709
+ const card = Data_1.TestCards.amexManual();
710
+ return new Promise((resolve) => {
711
+ card
712
+ .charge(111.11)
713
+ .withCurrency("USD")
714
+ .withAddress(address)
715
+ .withCommercialRequest(true)
716
+ .withAllowDuplicates(true)
717
+ .withEcommerceInfo(ecom)
718
+ .execute()
719
+ .then((response) => {
720
+ expect(response).toBeTruthy();
721
+ expect(response.responseCode).toBe("00");
722
+ expect(response.commercialIndicator).toBe("0");
723
+ resolve();
724
+ });
725
+ });
726
+ });
727
+ test.failing("031 - level ii no response", () => {
728
+ const address = new src_1.Address();
729
+ address.streetAddress1 = "6860";
730
+ address.postalCode = "75024";
731
+ const card = Data_1.TestCards.amexManual();
732
+ return new Promise((resolve) => {
733
+ card
734
+ .charge(111.12)
735
+ .withCurrency("USD")
736
+ .withAddress(address)
737
+ .withCommercialRequest(true)
738
+ .withAllowDuplicates(true)
739
+ .withEcommerceInfo(ecom)
740
+ .execute()
741
+ .then((response) => {
742
+ expect(response).toBeTruthy();
743
+ expect(response.responseCode).toBe("00");
744
+ expect(response.commercialIndicator).toBe("0");
745
+ resolve();
746
+ });
747
+ });
748
+ });
749
+ test.failing("032 - level ii no response", () => {
750
+ const address = new src_1.Address();
751
+ address.streetAddress1 = "6860";
752
+ address.postalCode = "75024";
753
+ const card = Data_1.TestCards.amexManual();
754
+ return new Promise((resolve, reject) => {
755
+ card
756
+ .charge(111.13)
757
+ .withCurrency("USD")
758
+ .withAddress(address)
759
+ .withCommercialRequest(true)
760
+ .withAllowDuplicates(true)
761
+ .withEcommerceInfo(ecom)
762
+ .execute()
763
+ .then((response) => {
764
+ expect(response).toBeTruthy();
765
+ expect(response.responseCode).toBe("00");
766
+ expect(response.commercialIndicator).toBe("0");
767
+ return response;
768
+ })
769
+ .then((response) => {
770
+ response
771
+ .edit()
772
+ .withPoNumber("9876543210")
773
+ .withTaxType(src_1.TaxType.TaxExempt)
774
+ .execute()
775
+ .then((cpcResponse) => {
776
+ expect(cpcResponse).toBeTruthy();
777
+ expect(cpcResponse.responseCode).toBe("00");
778
+ resolve();
779
+ })
780
+ .catch(reject);
781
+ })
782
+ .catch(reject);
783
+ });
784
+ });
785
+ /// PRIOR / VOICE AUTHORIZATION
786
+ test.failing("033 - offline sale", () => {
787
+ const card = Data_1.TestCards.visaManual();
788
+ return new Promise((resolve, reject) => {
789
+ card
790
+ .charge(17.01)
791
+ .withCurrency("USD")
792
+ .withModifier(src_1.TransactionModifier.Offline)
793
+ .withOfflineAuthCode("654321")
794
+ .withInvoiceNumber("123456")
795
+ .withAllowDuplicates(true)
796
+ .withEcommerceInfo(ecom)
797
+ .execute()
798
+ .then((response) => {
799
+ expect(response).toBeTruthy();
800
+ expect(response.responseCode).toBe("00");
801
+ resolve();
802
+ })
803
+ .catch(reject);
804
+ });
805
+ });
806
+ test.failing("033 - offline authorization", () => {
807
+ const card = Data_1.TestCards.visaManual();
808
+ return new Promise((resolve, reject) => {
809
+ card
810
+ .authorize(17.1)
811
+ .withCurrency("USD")
812
+ .withModifier(src_1.TransactionModifier.Offline)
813
+ .withOfflineAuthCode("654321")
814
+ .withInvoiceNumber("123456")
815
+ .withAllowDuplicates(true)
816
+ .withEcommerceInfo(ecom)
817
+ .execute()
818
+ .then((response) => {
819
+ expect(response).toBeTruthy();
820
+ expect(response.responseCode).toBe("00");
821
+ resolve();
822
+ })
823
+ .catch(reject);
824
+ });
825
+ });
826
+ /// RETURN
827
+ test.failing("034 - offline return", () => {
828
+ const card = Data_1.TestCards.visaManual();
829
+ return new Promise((resolve, reject) => {
830
+ card
831
+ .refund(15.15)
832
+ .withCurrency("USD")
833
+ .withInvoiceNumber("123456")
834
+ .withAllowDuplicates(true)
835
+ .withEcommerceInfo(ecom)
836
+ .execute()
837
+ .then((response) => {
838
+ expect(response).toBeTruthy();
839
+ expect(response.responseCode).toBe("00");
840
+ resolve();
841
+ })
842
+ .catch(reject);
843
+ });
844
+ });
845
+ /// ONLINE VOID / REVERSAL
846
+ /// ADVANCED FRAUD SCREENING
847
+ test.failing("037 - fraud prevention sale", () => {
848
+ const card = Data_1.TestCards.visaManual();
849
+ return new Promise((resolve, reject) => {
850
+ card
851
+ .charge(15000)
852
+ .withCurrency("USD")
853
+ .withAllowDuplicates(true)
854
+ .withEcommerceInfo(ecom)
855
+ .execute()
856
+ .then((response) => {
857
+ expect(response).toBeTruthy();
858
+ expect(response.responseCode).toBe("FR");
859
+ resolve();
860
+ })
861
+ .catch(reject);
862
+ });
863
+ });
864
+ test.failing("038 - fraud prevention return", () => {
865
+ const card = Data_1.TestCards.visaManual();
866
+ return new Promise((resolve, reject) => {
867
+ card
868
+ .refund(15000)
869
+ .withCurrency("USD")
870
+ .withAllowDuplicates(true)
871
+ .withEcommerceInfo(ecom)
872
+ .execute()
873
+ .then((response) => {
874
+ expect(response).toBeTruthy();
875
+ expect(response.responseCode).toBe("41");
876
+ resolve();
877
+ })
878
+ .catch(reject);
879
+ });
880
+ });
881
+ /// ONE CARD - GSB CARD FUNCTIONS
882
+ /// BALANCE INQUIRY
883
+ describe("037 - balance inquiry gsb", () => {
884
+ (usePrepaid ? test : test.skip)("037 - balance inquiry gsb", () => {
885
+ const address = new src_1.Address();
886
+ address.streetAddress1 = "6860";
887
+ address.postalCode = "75024";
888
+ const card = Data_1.TestCards.gsbManual();
889
+ return new Promise((resolve, reject) => {
890
+ card
891
+ .balanceInquiry()
892
+ .withAddress(address)
893
+ .execute()
894
+ .then((response) => {
895
+ expect(response).toBeTruthy();
896
+ expect(response.responseCode).toBe("00");
897
+ resolve();
898
+ })
899
+ .catch(reject);
900
+ });
901
+ });
902
+ });
903
+ /// ADD VALUE
904
+ describe("038 - add value gsb", () => {
905
+ (usePrepaid ? test : test.skip)("038 - add value gsb", () => {
906
+ const address = new src_1.Address();
907
+ address.streetAddress1 = "6860";
908
+ address.postalCode = "75024";
909
+ const card = new src_1.CreditTrackData();
910
+ card.value =
911
+ "%B6277220572999800^/^49121010557010000016000000?F;6277220572999800=49121010557010000016?";
912
+ return new Promise((resolve, reject) => {
913
+ card
914
+ .addValue(15.0)
915
+ .withCurrency("USD")
916
+ .withAllowDuplicates(true)
917
+ .withEcommerceInfo(ecom)
918
+ .execute()
919
+ .then((response) => {
920
+ expect(response).toBeTruthy();
921
+ expect(response.responseCode).toBe("00");
922
+ resolve();
923
+ })
924
+ .catch(reject);
925
+ });
926
+ });
927
+ });
928
+ /// SALE
929
+ describe("039 - charge gsb", () => {
930
+ (usePrepaid ? test : test.skip)("039 - charge gsb", () => {
931
+ const address = new src_1.Address();
932
+ address.streetAddress1 = "6860";
933
+ address.postalCode = "75024";
934
+ const card = Data_1.TestCards.gsbManual();
935
+ return new Promise((resolve, reject) => {
936
+ card
937
+ .charge(2.05)
938
+ .withCurrency("USD")
939
+ .withAddress(address)
940
+ .withInvoiceNumber("123456")
941
+ .withAllowDuplicates(true)
942
+ .withEcommerceInfo(ecom)
943
+ .execute()
944
+ .then((response) => {
945
+ expect(response).toBeTruthy();
946
+ expect(response.responseCode).toBe("00");
947
+ return response;
948
+ })
949
+ .then((response) => {
950
+ response
951
+ .void()
952
+ .execute()
953
+ .then((voidResponse) => {
954
+ expect(voidResponse).toBeTruthy();
955
+ expect(voidResponse.responseCode).toBe("00");
956
+ resolve();
957
+ })
958
+ .catch(reject);
959
+ })
960
+ .catch(reject);
961
+ });
962
+ });
963
+ });
964
+ describe("040 - charge gsb", () => {
965
+ (usePrepaid ? test : test.skip)("040 - charge gsb", () => {
966
+ const address = new src_1.Address();
967
+ address.streetAddress1 = "6860";
968
+ address.postalCode = "75024";
969
+ const card = Data_1.TestCards.gsbManual();
970
+ return new Promise((resolve, reject) => {
971
+ card
972
+ .charge(2.1)
973
+ .withCurrency("USD")
974
+ .withAddress(address)
975
+ .withInvoiceNumber("123456")
976
+ .withAllowDuplicates(true)
977
+ .withEcommerceInfo(ecom)
978
+ .execute()
979
+ .then((response) => {
980
+ expect(response).toBeTruthy();
981
+ expect(response.responseCode).toBe("00");
982
+ resolve();
983
+ })
984
+ .catch(reject);
985
+ });
986
+ });
987
+ });
988
+ /// ONLINE VOID / REVERSAL
989
+ /// HMS GIFT - REWARDS
990
+ /// ACTIVATE
991
+ test.failing("042 - activate gift 1", () => {
992
+ const card = Data_1.TestCards.giftCard1Swipe();
993
+ return new Promise((resolve, reject) => {
994
+ card
995
+ .activate(6.0)
996
+ .withCurrency("USD")
997
+ .execute()
998
+ .then((response) => {
999
+ expect(response).toBeTruthy();
1000
+ expect(response.responseCode).toBe("00");
1001
+ resolve();
1002
+ })
1003
+ .catch(reject);
1004
+ });
1005
+ });
1006
+ test.failing("043 - activate gift 2", () => {
1007
+ const card = Data_1.TestCards.giftCard2Manual();
1008
+ return new Promise((resolve, reject) => {
1009
+ card
1010
+ .activate(7.0)
1011
+ .withCurrency("USD")
1012
+ .execute()
1013
+ .then((response) => {
1014
+ expect(response).toBeTruthy();
1015
+ expect(response.responseCode).toBe("00");
1016
+ resolve();
1017
+ })
1018
+ .catch(reject);
1019
+ });
1020
+ });
1021
+ /// LOAD / ADD VALUE
1022
+ test.failing("044 - add value gift 1", () => {
1023
+ const card = Data_1.TestCards.giftCard1Swipe();
1024
+ return new Promise((resolve, reject) => {
1025
+ card
1026
+ .addValue(8.0)
1027
+ .withCurrency("USD")
1028
+ .execute()
1029
+ .then((response) => {
1030
+ expect(response).toBeTruthy();
1031
+ expect(response.responseCode).toBe("00");
1032
+ resolve();
1033
+ })
1034
+ .catch(reject);
1035
+ });
1036
+ });
1037
+ test.failing("045 - add value gift 2", () => {
1038
+ const card = Data_1.TestCards.giftCard2Manual();
1039
+ return new Promise((resolve, reject) => {
1040
+ card
1041
+ .addValue(9.0)
1042
+ .withCurrency("USD")
1043
+ .execute()
1044
+ .then((response) => {
1045
+ expect(response).toBeTruthy();
1046
+ expect(response.responseCode).toBe("00");
1047
+ resolve();
1048
+ })
1049
+ .catch(reject);
1050
+ });
1051
+ });
1052
+ /// BALANCE INQUIRY
1053
+ test.failing("046 - balance inquiry gift 1", () => {
1054
+ const card = Data_1.TestCards.giftCard1Swipe();
1055
+ return new Promise((resolve, reject) => {
1056
+ card
1057
+ .balanceInquiry()
1058
+ .execute()
1059
+ .then((response) => {
1060
+ expect(response).toBeTruthy();
1061
+ expect(response.responseCode).toBe("00");
1062
+ expect(response.balanceAmount).toBe("10.00");
1063
+ resolve();
1064
+ })
1065
+ .catch(reject);
1066
+ });
1067
+ });
1068
+ test.failing("047 - balance inquiry gift 2", () => {
1069
+ const card = Data_1.TestCards.giftCard2Manual();
1070
+ return new Promise((resolve, reject) => {
1071
+ card
1072
+ .balanceInquiry()
1073
+ .execute()
1074
+ .then((response) => {
1075
+ expect(response).toBeTruthy();
1076
+ expect(response.responseCode).toBe("00");
1077
+ expect(response.balanceAmount).toBe("10.00");
1078
+ resolve();
1079
+ })
1080
+ .catch(reject);
1081
+ });
1082
+ });
1083
+ /// REPLACE / TRANSFER
1084
+ test.failing("048 - replace gift 1", () => {
1085
+ const card = Data_1.TestCards.giftCard1Swipe();
1086
+ return new Promise((resolve, reject) => {
1087
+ card
1088
+ .replaceWith(Data_1.TestCards.giftCard2Manual())
1089
+ .execute()
1090
+ .then((response) => {
1091
+ expect(response).toBeTruthy();
1092
+ expect(response.responseCode).toBe("00");
1093
+ resolve();
1094
+ })
1095
+ .catch(reject);
1096
+ });
1097
+ });
1098
+ test.failing("049 - replace gift 2", () => {
1099
+ const card = Data_1.TestCards.giftCard2Manual();
1100
+ return new Promise((resolve, reject) => {
1101
+ card
1102
+ .replaceWith(Data_1.TestCards.giftCard1Swipe())
1103
+ .execute()
1104
+ .then((response) => {
1105
+ expect(response).toBeTruthy();
1106
+ expect(response.responseCode).toBe("00");
1107
+ resolve();
1108
+ })
1109
+ .catch(reject);
1110
+ });
1111
+ });
1112
+ /// SALE
1113
+ test.failing("050 - sale gift 1", () => {
1114
+ const card = Data_1.TestCards.giftCard1Swipe();
1115
+ return new Promise((resolve, reject) => {
1116
+ card
1117
+ .charge(1.0)
1118
+ .withCurrency("USD")
1119
+ .execute()
1120
+ .then((response) => {
1121
+ expect(response).toBeTruthy();
1122
+ expect(response.responseCode).toBe("00");
1123
+ resolve();
1124
+ })
1125
+ .catch(reject);
1126
+ });
1127
+ });
1128
+ test.failing("051 - sale gift 2", () => {
1129
+ const card = Data_1.TestCards.giftCard2Manual();
1130
+ return new Promise((resolve, reject) => {
1131
+ card
1132
+ .charge(2.0)
1133
+ .withCurrency("USD")
1134
+ .execute()
1135
+ .then((response) => {
1136
+ expect(response).toBeTruthy();
1137
+ expect(response.responseCode).toBe("00");
1138
+ resolve();
1139
+ })
1140
+ .catch(reject);
1141
+ });
1142
+ });
1143
+ test.failing("052 - sale gift 1 void", () => {
1144
+ const card = Data_1.TestCards.giftCard1Swipe();
1145
+ return new Promise((resolve, reject) => {
1146
+ card
1147
+ .charge(3.0)
1148
+ .withCurrency("USD")
1149
+ .execute()
1150
+ .then((response) => {
1151
+ expect(response).toBeTruthy();
1152
+ expect(response.responseCode).toBe("00");
1153
+ return response;
1154
+ })
1155
+ .then((response) => {
1156
+ response
1157
+ .void()
1158
+ .execute()
1159
+ .then((voidResponse) => {
1160
+ expect(voidResponse).toBeTruthy();
1161
+ expect(voidResponse.responseCode).toBe("00");
1162
+ resolve();
1163
+ })
1164
+ .catch(reject);
1165
+ })
1166
+ .catch(reject);
1167
+ });
1168
+ });
1169
+ test.failing("053 - sale gift 2 void", () => {
1170
+ const card = Data_1.TestCards.giftCard2Manual();
1171
+ return new Promise((resolve, reject) => {
1172
+ card
1173
+ .charge(4.0)
1174
+ .withCurrency("USD")
1175
+ .execute()
1176
+ .then((response) => {
1177
+ expect(response).toBeTruthy();
1178
+ expect(response.responseCode).toBe("00");
1179
+ return response;
1180
+ })
1181
+ .then((response) => {
1182
+ response
1183
+ .reverse(4.0)
1184
+ .execute()
1185
+ .then((reversalResponse) => {
1186
+ expect(reversalResponse).toBeTruthy();
1187
+ expect(reversalResponse.responseCode).toBe("00");
1188
+ resolve();
1189
+ })
1190
+ .catch(reject);
1191
+ })
1192
+ .catch(reject);
1193
+ });
1194
+ });
1195
+ /// VOID
1196
+ // /// REVERSAL
1197
+ test.failing("056 - reversal gift 2", () => {
1198
+ const card = Data_1.TestCards.giftCard2Manual();
1199
+ return new Promise((resolve, reject) => {
1200
+ // setup
1201
+ card
1202
+ .charge(2.0)
1203
+ .withCurrency("USD")
1204
+ .execute()
1205
+ .then((response) => {
1206
+ expect(response).toBeTruthy();
1207
+ expect(response.responseCode).toBe("00");
1208
+ })
1209
+ .then(() => {
1210
+ // reverse based on card, not transaction id
1211
+ card
1212
+ .reverse(2.0)
1213
+ .execute()
1214
+ .then((response) => {
1215
+ expect(response).toBeTruthy();
1216
+ expect(response.responseCode).toBe("00");
1217
+ resolve();
1218
+ })
1219
+ .catch(reject);
1220
+ })
1221
+ .catch(reject);
1222
+ });
1223
+ });
1224
+ /// DEACTIVATE
1225
+ test.failing("057 - deactivate gift 1", () => {
1226
+ const card = Data_1.TestCards.giftCard1Swipe();
1227
+ return new Promise((resolve, reject) => {
1228
+ card
1229
+ .deactivate()
1230
+ .execute()
1231
+ .then((response) => {
1232
+ expect(response).toBeTruthy();
1233
+ expect(response.responseCode).toBe("00");
1234
+ resolve();
1235
+ })
1236
+ .catch(reject);
1237
+ });
1238
+ });
1239
+ /// RECEIPTS MESSAGING
1240
+ /// REWARD
1241
+ /// BALANCE INQUIRY
1242
+ test.failing("059 - balance inquiry rewards 1", () => {
1243
+ const card = Data_1.TestCards.giftCard1Swipe();
1244
+ return new Promise((resolve, reject) => {
1245
+ card
1246
+ .balanceInquiry()
1247
+ .execute()
1248
+ .then((response) => {
1249
+ expect(response).toBeTruthy();
1250
+ expect(response.responseCode).toBe("00");
1251
+ expect(response.pointsBalanceAmount > "0").toBeTruthy();
1252
+ resolve();
1253
+ })
1254
+ .catch(reject);
1255
+ });
1256
+ });
1257
+ test.failing("060 - balance inquiry rewards 2", () => {
1258
+ const card = Data_1.TestCards.giftCard2Manual();
1259
+ return new Promise((resolve, reject) => {
1260
+ card
1261
+ .balanceInquiry()
1262
+ .execute()
1263
+ .then((response) => {
1264
+ expect(response).toBeTruthy();
1265
+ expect(response.responseCode).toBe("00");
1266
+ expect(response.pointsBalanceAmount > "0").toBeTruthy();
1267
+ resolve();
1268
+ })
1269
+ .catch(reject);
1270
+ });
1271
+ });
1272
+ /// ALIAS
1273
+ test.failing("061 - create alias gift 1", () => {
1274
+ return new Promise((resolve, reject) => {
1275
+ src_1.GiftCard.create("9725550100")
1276
+ .then((response) => {
1277
+ expect(response).toBeTruthy();
1278
+ resolve();
1279
+ })
1280
+ .catch(reject);
1281
+ });
1282
+ });
1283
+ test.failing("062 - create alias gift 2", () => {
1284
+ return new Promise((resolve, reject) => {
1285
+ src_1.GiftCard.create("9725550100")
1286
+ .then((response) => {
1287
+ expect(response).toBeTruthy();
1288
+ resolve();
1289
+ })
1290
+ .catch(reject);
1291
+ });
1292
+ });
1293
+ test.failing("063 - add alias gift 1", () => {
1294
+ const card = Data_1.TestCards.giftCard1Swipe();
1295
+ return new Promise((resolve, reject) => {
1296
+ card
1297
+ .addAlias("9725550100")
1298
+ .execute()
1299
+ .then((response) => {
1300
+ expect(response).toBeTruthy();
1301
+ expect(response.responseCode).toBe("00");
1302
+ resolve();
1303
+ })
1304
+ .catch(reject);
1305
+ });
1306
+ });
1307
+ test.failing("064 - add alias gift 2", () => {
1308
+ const card = Data_1.TestCards.giftCard2Manual();
1309
+ return new Promise((resolve, reject) => {
1310
+ card
1311
+ .addAlias("9725550100")
1312
+ .execute()
1313
+ .then((response) => {
1314
+ expect(response).toBeTruthy();
1315
+ expect(response.responseCode).toBe("00");
1316
+ resolve();
1317
+ })
1318
+ .catch(reject);
1319
+ });
1320
+ });
1321
+ test.failing("065 - delete alias gift 1", () => {
1322
+ const card = Data_1.TestCards.giftCard1Swipe();
1323
+ return new Promise((resolve, reject) => {
1324
+ card
1325
+ .removeAlias("9725550100")
1326
+ .execute()
1327
+ .then((response) => {
1328
+ expect(response).toBeTruthy();
1329
+ expect(response.responseCode).toBe("00");
1330
+ resolve();
1331
+ })
1332
+ .catch(reject);
1333
+ });
1334
+ });
1335
+ /// SALE
1336
+ test.failing("066 - redeem points gift 1", () => {
1337
+ const card = Data_1.TestCards.giftCard1Swipe();
1338
+ return new Promise((resolve, reject) => {
1339
+ card
1340
+ .charge(100)
1341
+ .withCurrency("points")
1342
+ .execute()
1343
+ .then((response) => {
1344
+ expect(response).toBeTruthy();
1345
+ expect(response.responseCode).toBe("00");
1346
+ resolve();
1347
+ })
1348
+ .catch(reject);
1349
+ });
1350
+ });
1351
+ test.failing("067 - redeem points gift 2", () => {
1352
+ const card = Data_1.TestCards.giftCard2Manual();
1353
+ return new Promise((resolve, reject) => {
1354
+ card
1355
+ .charge(200)
1356
+ .withCurrency("points")
1357
+ .execute()
1358
+ .then((response) => {
1359
+ expect(response).toBeTruthy();
1360
+ expect(response.responseCode).toBe("00");
1361
+ resolve();
1362
+ })
1363
+ .catch(reject);
1364
+ });
1365
+ });
1366
+ test.failing("068 - redeem points gift 2", () => {
1367
+ const card = new src_1.GiftCard();
1368
+ card.alias = "9725550100";
1369
+ return new Promise((resolve, reject) => {
1370
+ card
1371
+ .charge(300)
1372
+ .withCurrency("points")
1373
+ .execute()
1374
+ .then((response) => {
1375
+ expect(response).toBeTruthy();
1376
+ expect(response.responseCode).toBe("00");
1377
+ resolve();
1378
+ })
1379
+ .catch(reject);
1380
+ });
1381
+ });
1382
+ /// REWARDS
1383
+ test.failing("069 - rewards gift 1", () => {
1384
+ const card = Data_1.TestCards.giftCard1Swipe();
1385
+ return new Promise((resolve, reject) => {
1386
+ card
1387
+ .rewards(10)
1388
+ .execute()
1389
+ .then((response) => {
1390
+ expect(response).toBeTruthy();
1391
+ expect(response.responseCode).toBe("00");
1392
+ resolve();
1393
+ })
1394
+ .catch(reject);
1395
+ });
1396
+ });
1397
+ test.failing("070 - rewards gift 2", () => {
1398
+ const card = Data_1.TestCards.giftCard2Manual();
1399
+ return new Promise((resolve, reject) => {
1400
+ card
1401
+ .rewards(11)
1402
+ .execute()
1403
+ .then((response) => {
1404
+ expect(response).toBeTruthy();
1405
+ expect(response.responseCode).toBe("00");
1406
+ resolve();
1407
+ })
1408
+ .catch(reject);
1409
+ });
1410
+ });
1411
+ /// REPLACE / TRANSFER
1412
+ test.failing("071 - replace rewards 1", () => {
1413
+ const card = Data_1.TestCards.giftCard1Swipe();
1414
+ return new Promise((resolve, reject) => {
1415
+ card
1416
+ .replaceWith(Data_1.TestCards.giftCard2Manual())
1417
+ .execute()
1418
+ .then((response) => {
1419
+ expect(response).toBeTruthy();
1420
+ expect(response.responseCode).toBe("00");
1421
+ resolve();
1422
+ })
1423
+ .catch(reject);
1424
+ });
1425
+ });
1426
+ test.failing("072 - replace rewards 2", () => {
1427
+ const card = Data_1.TestCards.giftCard2Manual();
1428
+ return new Promise((resolve, reject) => {
1429
+ card
1430
+ .replaceWith(Data_1.TestCards.giftCard1Swipe())
1431
+ .execute()
1432
+ .then((response) => {
1433
+ expect(response).toBeTruthy();
1434
+ expect(response.responseCode).toBe("00");
1435
+ resolve();
1436
+ })
1437
+ .catch(reject);
1438
+ });
1439
+ });
1440
+ /// DEACTIVATE
1441
+ test.failing("073 - deactivate rewards 1", () => {
1442
+ const card = Data_1.TestCards.giftCard1Swipe();
1443
+ return new Promise((resolve, reject) => {
1444
+ card
1445
+ .deactivate()
1446
+ .execute()
1447
+ .then((response) => {
1448
+ expect(response).toBeTruthy();
1449
+ expect(response.responseCode).toBe("00");
1450
+ resolve();
1451
+ })
1452
+ .catch(reject);
1453
+ });
1454
+ });
1455
+ test.failing("074 - deactivate rewards 2", () => {
1456
+ const card = Data_1.TestCards.giftCard2Manual();
1457
+ return new Promise((resolve, reject) => {
1458
+ card
1459
+ .deactivate()
1460
+ .execute()
1461
+ .then((response) => {
1462
+ expect(response).toBeTruthy();
1463
+ expect(response.responseCode).toBe("00");
1464
+ resolve();
1465
+ })
1466
+ .catch(reject);
1467
+ });
1468
+ });
1469
+ /// RECEIPTS MESSAGING;
1470
+ afterAll(() => {
1471
+ return new Promise((resolve, reject) => {
1472
+ src_1.BatchService.closeBatch()
1473
+ .then((response) => {
1474
+ expect(response).toBeTruthy();
1475
+ resolve();
1476
+ })
1477
+ .catch((e) => {
1478
+ if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
1479
+ e.message.indexOf(BATCH_EMPTY) !== -1) {
1480
+ resolve();
1481
+ return;
1482
+ }
1483
+ reject(e);
1484
+ });
1485
+ });
1486
+ });
1487
+ //# sourceMappingURL=Moto.test.js.map