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,2102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const src_1 = require("../../../../../src");
4
+ const Data_1 = require("../../../../Data");
5
+ const config = new src_1.PorticoConfig();
6
+ config.secretApiKey = "skapi_cert_MaePAQBr-1QAqjfckFC8FTbRTT120bVQUlfVOjgCBw";
7
+ const BATCH_NOT_OPEN = "Transaction was rejected because it requires a batch to be open.";
8
+ const BATCH_EMPTY = "Batch close was rejected because no transactions are associated with the currently open batch";
9
+ const useTokens = false;
10
+ let visaToken = "";
11
+ let masterCardToken = "";
12
+ let discoverToken = "";
13
+ let amexToken = "";
14
+ beforeAll(() => {
15
+ src_1.ServicesContainer.configureService(config);
16
+ });
17
+ beforeAll(() => {
18
+ return new Promise((resolve, reject) => {
19
+ src_1.BatchService.closeBatch()
20
+ .then((response) => {
21
+ expect(response).toBeTruthy();
22
+ resolve();
23
+ })
24
+ .catch((e) => {
25
+ if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
26
+ e.message.indexOf(BATCH_EMPTY) !== -1) {
27
+ resolve();
28
+ return;
29
+ }
30
+ reject(e);
31
+ });
32
+ });
33
+ });
34
+ /// CREDIT CARD FUNCTIONS
35
+ /// CARD VERIFY
36
+ /// ACCOUNT VERIFICATION
37
+ test("001 - card verify visa", () => {
38
+ const card = Data_1.TestCards.visaSwipeEncrypted();
39
+ return card
40
+ .verify()
41
+ .withAllowDuplicates(true)
42
+ .withRequestMultiUseToken(useTokens)
43
+ .execute()
44
+ .then((response) => {
45
+ expect(response).toBeTruthy();
46
+ expect(response.responseCode).toBe("00");
47
+ return response;
48
+ })
49
+ .then((response) => {
50
+ if (!useTokens) {
51
+ expect.assertions(2);
52
+ return;
53
+ }
54
+ expect(response.token).toBeTruthy();
55
+ const token = new src_1.CreditCardData();
56
+ token.token = response.token;
57
+ return token
58
+ .charge(15.01)
59
+ .withAllowDuplicates(true)
60
+ .execute()
61
+ .then((chargeResponse) => {
62
+ expect(chargeResponse).toBeTruthy();
63
+ expect(chargeResponse.responseCode).toBe("00");
64
+ });
65
+ });
66
+ });
67
+ test("002 - card verify mastercard", () => {
68
+ const card = Data_1.TestCards.masterCardSwipeEncrypted();
69
+ return card
70
+ .verify()
71
+ .withAllowDuplicates(true)
72
+ .withRequestMultiUseToken(useTokens)
73
+ .execute()
74
+ .then((response) => {
75
+ expect(response).toBeTruthy();
76
+ expect(response.responseCode).toBe("00");
77
+ return response;
78
+ })
79
+ .then((response) => {
80
+ if (!useTokens) {
81
+ expect.assertions(2);
82
+ return;
83
+ }
84
+ expect(response.token).toBeTruthy();
85
+ const token = new src_1.CreditCardData();
86
+ token.token = response.token;
87
+ return token
88
+ .charge(15.02)
89
+ .withAllowDuplicates(true)
90
+ .execute()
91
+ .then((chargeResponse) => {
92
+ expect(chargeResponse).toBeTruthy();
93
+ expect(chargeResponse.responseCode).toBe("00");
94
+ });
95
+ });
96
+ });
97
+ test("003 - card verify discover", () => {
98
+ const card = Data_1.TestCards.discoverSwipeEncrypted();
99
+ return card
100
+ .verify()
101
+ .withAllowDuplicates(true)
102
+ .withRequestMultiUseToken(useTokens)
103
+ .execute()
104
+ .then((response) => {
105
+ expect(response).toBeTruthy();
106
+ expect(response.responseCode).toBe("00");
107
+ return response;
108
+ })
109
+ .then((response) => {
110
+ if (!useTokens) {
111
+ expect.assertions(2);
112
+ return;
113
+ }
114
+ expect(response.token).toBeTruthy();
115
+ const token = new src_1.CreditCardData();
116
+ token.token = response.token;
117
+ return token
118
+ .charge(15.03)
119
+ .withAllowDuplicates(true)
120
+ .execute()
121
+ .then((chargeResponse) => {
122
+ expect(chargeResponse).toBeTruthy();
123
+ expect(chargeResponse.responseCode).toBe("00");
124
+ });
125
+ });
126
+ });
127
+ /// Address Verification
128
+ test("004 - card verify amex", () => {
129
+ const address = new src_1.Address();
130
+ address.postalCode = "75024";
131
+ const card = Data_1.TestCards.amexManual(false, true);
132
+ return card
133
+ .verify()
134
+ .withAllowDuplicates(true)
135
+ .withAddress(address)
136
+ .withRequestMultiUseToken(useTokens)
137
+ .execute()
138
+ .then((response) => {
139
+ expect(response).toBeTruthy();
140
+ expect(response.responseCode).toBe("00");
141
+ return response;
142
+ })
143
+ .then((response) => {
144
+ if (!useTokens) {
145
+ return;
146
+ }
147
+ expect(response.token).toBeTruthy();
148
+ const token = new src_1.CreditCardData();
149
+ token.token = response.token;
150
+ return token
151
+ .charge(15.04)
152
+ .withAllowDuplicates(true)
153
+ .execute()
154
+ .then((chargeResponse) => {
155
+ expect(chargeResponse).toBeTruthy();
156
+ expect(chargeResponse.responseCode).toBe("00");
157
+ });
158
+ });
159
+ });
160
+ /// Balance Inquiry (for Prepaid)
161
+ test("005 - balance inquiry visa", () => {
162
+ const card = Data_1.TestCards.visaSwipeEncrypted();
163
+ return card
164
+ .balanceInquiry()
165
+ .execute()
166
+ .then((response) => {
167
+ expect(response).toBeTruthy();
168
+ expect(response.responseCode).toBe("00");
169
+ });
170
+ });
171
+ /// CREDIT SALE (for multi-use token only)
172
+ test("006 - charge visa swipe token", () => {
173
+ const card = Data_1.TestCards.visaSwipe();
174
+ return card
175
+ .charge(15.01)
176
+ .withCurrency("USD")
177
+ .withRequestMultiUseToken(true)
178
+ .withAllowDuplicates(true)
179
+ .execute()
180
+ .then((response) => {
181
+ expect(response).toBeTruthy();
182
+ expect(response.responseCode).toBe("00");
183
+ visaToken = response.token;
184
+ });
185
+ });
186
+ test("007 - charge mastercard swipe token", () => {
187
+ const card = Data_1.TestCards.masterCardSwipe();
188
+ return card
189
+ .charge(15.02)
190
+ .withCurrency("USD")
191
+ .withRequestMultiUseToken(true)
192
+ .withAllowDuplicates(true)
193
+ .execute()
194
+ .then((response) => {
195
+ expect(response).toBeTruthy();
196
+ expect(response.responseCode).toBe("00");
197
+ masterCardToken = response.token;
198
+ });
199
+ });
200
+ test("008 - charge discover swipe token", () => {
201
+ const card = Data_1.TestCards.discoverSwipe();
202
+ return card
203
+ .charge(15.03)
204
+ .withCurrency("USD")
205
+ .withRequestMultiUseToken(true)
206
+ .withAllowDuplicates(true)
207
+ .execute()
208
+ .then((response) => {
209
+ expect(response).toBeTruthy();
210
+ expect(response.responseCode).toBe("00");
211
+ discoverToken = response.token;
212
+ });
213
+ });
214
+ test("009 - charge amex swipe token", () => {
215
+ const card = Data_1.TestCards.amexSwipe();
216
+ return card
217
+ .charge(15.04)
218
+ .withCurrency("USD")
219
+ .withRequestMultiUseToken(true)
220
+ .withAllowDuplicates(true)
221
+ .execute()
222
+ .then((response) => {
223
+ expect(response).toBeTruthy();
224
+ expect(response.responseCode).toBe("00");
225
+ amexToken = response.token;
226
+ });
227
+ });
228
+ /// CREDIT SALE
229
+ /// SWIPED
230
+ test.skip("010 - charge visa swipe", () => {
231
+ const card = Data_1.TestCards.visaSwipe();
232
+ return card
233
+ .charge(15.01)
234
+ .withCurrency("USD")
235
+ .withAllowDuplicates(true)
236
+ .execute()
237
+ .then((response) => {
238
+ expect(response).toBeTruthy();
239
+ expect(response.responseCode).toBe("00");
240
+ return response;
241
+ })
242
+ .then((response) => {
243
+ // test 059
244
+ return (response
245
+ .reverse(15.01)
246
+ // .withAllowDuplicates(true)
247
+ .execute()
248
+ .then((reverseResponse) => {
249
+ expect(reverseResponse).toBeTruthy();
250
+ expect(reverseResponse.responseCode).toBe("00");
251
+ }));
252
+ });
253
+ });
254
+ test("011 - charge mastercard swipe", () => {
255
+ const card = Data_1.TestCards.masterCardSwipe();
256
+ return card
257
+ .charge(15.02)
258
+ .withCurrency("USD")
259
+ .withAllowDuplicates(true)
260
+ .execute()
261
+ .then((response) => {
262
+ expect(response).toBeTruthy();
263
+ expect(response.responseCode).toBe("00");
264
+ });
265
+ });
266
+ test("012 - charge discover swipe", () => {
267
+ const card = Data_1.TestCards.discoverSwipe();
268
+ return card
269
+ .charge(15.02)
270
+ .withCurrency("USD")
271
+ .withAllowDuplicates(true)
272
+ .execute()
273
+ .then((response) => {
274
+ expect(response).toBeTruthy();
275
+ expect(response.responseCode).toBe("00");
276
+ });
277
+ });
278
+ test("013 - charge amex swipe", () => {
279
+ const card = Data_1.TestCards.amexSwipe();
280
+ return card
281
+ .charge(15.02)
282
+ .withCurrency("USD")
283
+ .withAllowDuplicates(true)
284
+ .execute()
285
+ .then((response) => {
286
+ expect(response).toBeTruthy();
287
+ expect(response.responseCode).toBe("00");
288
+ });
289
+ });
290
+ test.skip("014 - charge jcb swipe", () => {
291
+ const card = Data_1.TestCards.visaSwipe();
292
+ return card
293
+ .charge(15.05)
294
+ .withCurrency("USD")
295
+ .withAllowDuplicates(true)
296
+ .execute()
297
+ .then((response) => {
298
+ expect(response).toBeTruthy();
299
+ expect(response.responseCode).toBe("00");
300
+ return response;
301
+ })
302
+ .then((response) => {
303
+ // test 058
304
+ return (response
305
+ .refund(15.05)
306
+ // .withAllowDuplicates(true)
307
+ .withCurrency("USD")
308
+ .execute()
309
+ .then((refundResponse) => {
310
+ expect(refundResponse).toBeTruthy();
311
+ expect(refundResponse.responseCode).toBe("00");
312
+ }));
313
+ });
314
+ });
315
+ test("014a - charge mastercard 24 swipe", () => {
316
+ const card = Data_1.TestCards.masterCard24Swipe();
317
+ return card
318
+ .charge(15.34)
319
+ .withCurrency("USD")
320
+ .withAllowDuplicates(true)
321
+ .execute()
322
+ .then((response) => {
323
+ expect(response).toBeTruthy();
324
+ expect(response.responseCode).toBe("00");
325
+ });
326
+ });
327
+ test("014b - charge mastercard 25 swipe", () => {
328
+ const card = Data_1.TestCards.masterCard25Swipe();
329
+ return card
330
+ .charge(15.34)
331
+ .withCurrency("USD")
332
+ .withAllowDuplicates(true)
333
+ .execute()
334
+ .then((response) => {
335
+ expect(response).toBeTruthy();
336
+ expect(response.responseCode).toBe("00");
337
+ });
338
+ });
339
+ test.skip("015 - charge visa swipe", () => {
340
+ const card = Data_1.TestCards.visaSwipe();
341
+ return card
342
+ .charge(15.06)
343
+ .withCurrency("USD")
344
+ .withAllowDuplicates(true)
345
+ .execute()
346
+ .then((response) => {
347
+ expect(response).toBeTruthy();
348
+ expect(response.responseCode).toBe("00");
349
+ return response;
350
+ })
351
+ .then((response) => {
352
+ // test 063
353
+ return (response
354
+ .reverse(15.06)
355
+ // .withAllowDuplicates(true)
356
+ .withAuthAmount(5.06)
357
+ .execute()
358
+ .then((reverseResponse) => {
359
+ expect(reverseResponse).toBeTruthy();
360
+ expect(reverseResponse.responseCode).toBe("00");
361
+ }));
362
+ });
363
+ });
364
+ /// Manually Entered - Card Present
365
+ test("016 - charge visa manual card present", () => {
366
+ const address = new src_1.Address();
367
+ address.postalCode = "750241234";
368
+ address.streetAddress1 = "6860 Dallas Pkwy";
369
+ const card = Data_1.TestCards.visaManual(true, true);
370
+ return card
371
+ .charge(16.01)
372
+ .withAllowDuplicates(true)
373
+ .withCurrency("USD")
374
+ .withAddress(address)
375
+ .execute()
376
+ .then((response) => {
377
+ expect(response).toBeTruthy();
378
+ expect(response.responseCode).toBe("00");
379
+ });
380
+ });
381
+ test.skip("017 - charge mastercard manual card present", () => {
382
+ const address = new src_1.Address();
383
+ address.postalCode = "75024";
384
+ address.streetAddress1 = "6860 Dallas Pkwy";
385
+ const card = Data_1.TestCards.masterCardManual(true, true);
386
+ return card
387
+ .charge(16.02)
388
+ .withAllowDuplicates(true)
389
+ .withCurrency("USD")
390
+ .withAddress(address)
391
+ .execute()
392
+ .then((response) => {
393
+ expect(response).toBeTruthy();
394
+ expect(response.responseCode).toBe("00");
395
+ return response;
396
+ })
397
+ .then((response) => {
398
+ // test case 60
399
+ return (response
400
+ .reverse(16.02)
401
+ // .withAllowDuplicates(true)
402
+ .execute()
403
+ .then((reverseResponse) => {
404
+ expect(reverseResponse).toBeTruthy();
405
+ expect(reverseResponse.responseCode).toBe("00");
406
+ }));
407
+ });
408
+ });
409
+ test("018 - charge discover manual card present", () => {
410
+ const address = new src_1.Address();
411
+ address.postalCode = "750241234";
412
+ const card = Data_1.TestCards.discoverManual(true, true);
413
+ return card
414
+ .charge(16.03)
415
+ .withAllowDuplicates(true)
416
+ .withCurrency("USD")
417
+ .withAddress(address)
418
+ .execute()
419
+ .then((response) => {
420
+ expect(response).toBeTruthy();
421
+ expect(response.responseCode).toBe("00");
422
+ });
423
+ });
424
+ test("019 - charge amex manual card present", () => {
425
+ const address = new src_1.Address();
426
+ address.postalCode = "75024";
427
+ address.streetAddress1 = "6860";
428
+ const card = Data_1.TestCards.amexManual(true, true);
429
+ return card
430
+ .charge(16.04)
431
+ .withAllowDuplicates(true)
432
+ .withCurrency("USD")
433
+ .withAddress(address)
434
+ .execute()
435
+ .then((response) => {
436
+ expect(response).toBeTruthy();
437
+ expect(response.responseCode).toBe("00");
438
+ });
439
+ });
440
+ test("020 - charge jcb manual card present", () => {
441
+ const address = new src_1.Address();
442
+ address.postalCode = "75024";
443
+ const card = Data_1.TestCards.jcbManual(true, true);
444
+ return card
445
+ .charge(16.05)
446
+ .withAllowDuplicates(true)
447
+ .withCurrency("USD")
448
+ .withAddress(address)
449
+ .execute()
450
+ .then((response) => {
451
+ expect(response).toBeTruthy();
452
+ expect(response.responseCode).toBe("00");
453
+ });
454
+ });
455
+ test.skip("021 - charge discover manual card present", () => {
456
+ const address = new src_1.Address();
457
+ address.postalCode = "750241234";
458
+ address.streetAddress1 = "6860 Dallas Pkwy";
459
+ const card = Data_1.TestCards.discoverManual(true, true);
460
+ return card
461
+ .charge(16.07)
462
+ .withAllowDuplicates(true)
463
+ .withCurrency("USD")
464
+ .withAddress(address)
465
+ .execute()
466
+ .then((response) => {
467
+ expect(response).toBeTruthy();
468
+ expect(response.responseCode).toBe("00");
469
+ return response;
470
+ })
471
+ .then((response) => {
472
+ // test case 64
473
+ return (response
474
+ .reverse(16.07)
475
+ // .withAllowDuplicates(true)
476
+ .withAuthAmount(6.07)
477
+ .execute()
478
+ .then((reverseResponse) => {
479
+ expect(reverseResponse).toBeTruthy();
480
+ expect(reverseResponse.responseCode).toBe("00");
481
+ }));
482
+ });
483
+ });
484
+ /// Manually Entered - Card Not Present
485
+ test("022 - charge visa manual card not present", () => {
486
+ const address = new src_1.Address();
487
+ address.postalCode = "750241234";
488
+ address.streetAddress1 = "6860 Dallas Pkwy";
489
+ let card;
490
+ if (useTokens) {
491
+ card = new src_1.CreditCardData();
492
+ card.token = visaToken;
493
+ }
494
+ else {
495
+ card = Data_1.TestCards.visaManual(false, true);
496
+ }
497
+ return card
498
+ .charge(17.01)
499
+ .withAllowDuplicates(true)
500
+ .withCurrency("USD")
501
+ .withAddress(address)
502
+ .execute()
503
+ .then((response) => {
504
+ expect(response).toBeTruthy();
505
+ expect(response.responseCode).toBe("00");
506
+ });
507
+ });
508
+ test.skip("023 - charge mastercard manual card not present", () => {
509
+ const address = new src_1.Address();
510
+ address.postalCode = "75024";
511
+ address.streetAddress1 = "6860 Dallas Pkwy";
512
+ let card;
513
+ if (useTokens) {
514
+ card = new src_1.CreditCardData();
515
+ card.token = masterCardToken;
516
+ }
517
+ else {
518
+ card = Data_1.TestCards.masterCardManual(false, true);
519
+ }
520
+ return card
521
+ .charge(17.02)
522
+ .withAllowDuplicates(true)
523
+ .withCurrency("USD")
524
+ .withAddress(address)
525
+ .execute()
526
+ .then((response) => {
527
+ expect(response).toBeTruthy();
528
+ expect(response.responseCode).toBe("00");
529
+ return response;
530
+ })
531
+ .then((response) => {
532
+ // test case 61
533
+ return (response
534
+ .reverse(17.02)
535
+ // .withAllowDuplicates(true)
536
+ .execute()
537
+ .then((reverseResponse) => {
538
+ expect(reverseResponse).toBeTruthy();
539
+ expect(reverseResponse.responseCode).toBe("00");
540
+ }));
541
+ });
542
+ });
543
+ test("024 - charge discover manual card not present", () => {
544
+ const address = new src_1.Address();
545
+ address.postalCode = "750241234";
546
+ let card;
547
+ if (useTokens) {
548
+ card = new src_1.CreditCardData();
549
+ card.token = discoverToken;
550
+ }
551
+ else {
552
+ card = Data_1.TestCards.discoverManual(false, true);
553
+ }
554
+ return card
555
+ .charge(17.03)
556
+ .withAllowDuplicates(true)
557
+ .withCurrency("USD")
558
+ .withAddress(address)
559
+ .execute()
560
+ .then((response) => {
561
+ expect(response).toBeTruthy();
562
+ expect(response.responseCode).toBe("00");
563
+ });
564
+ });
565
+ test("025 - charge amex manual card not present", () => {
566
+ const address = new src_1.Address();
567
+ address.postalCode = "75024";
568
+ address.streetAddress1 = "6860";
569
+ let card;
570
+ if (useTokens) {
571
+ card = new src_1.CreditCardData();
572
+ card.token = amexToken;
573
+ }
574
+ else {
575
+ card = Data_1.TestCards.amexManual(false, true);
576
+ }
577
+ return card
578
+ .charge(17.04)
579
+ .withAllowDuplicates(true)
580
+ .withCurrency("USD")
581
+ .withAddress(address)
582
+ .execute()
583
+ .then((response) => {
584
+ expect(response).toBeTruthy();
585
+ expect(response.responseCode).toBe("00");
586
+ });
587
+ });
588
+ test("026 - charge jcb manual card not present", () => {
589
+ const address = new src_1.Address();
590
+ address.postalCode = "75024";
591
+ const card = Data_1.TestCards.jcbManual(false, true);
592
+ return card
593
+ .charge(17.05)
594
+ .withAllowDuplicates(true)
595
+ .withCurrency("USD")
596
+ .withAddress(address)
597
+ .execute()
598
+ .then((response) => {
599
+ expect(response).toBeTruthy();
600
+ expect(response.responseCode).toBe("00");
601
+ });
602
+ });
603
+ /// Contactless
604
+ test("027 - charge visa contactless", () => {
605
+ const card = Data_1.TestCards.visaSwipe(src_1.EntryMethod.Proximity);
606
+ return card
607
+ .charge(18.01)
608
+ .withAllowDuplicates(true)
609
+ .withCurrency("USD")
610
+ .execute()
611
+ .then((response) => {
612
+ expect(response).toBeTruthy();
613
+ expect(response.responseCode).toBe("00");
614
+ });
615
+ });
616
+ test("028 - charge mastercard contactless", () => {
617
+ const card = Data_1.TestCards.masterCardSwipe(src_1.EntryMethod.Proximity);
618
+ return card
619
+ .charge(18.02)
620
+ .withAllowDuplicates(true)
621
+ .withCurrency("USD")
622
+ .execute()
623
+ .then((response) => {
624
+ expect(response).toBeTruthy();
625
+ expect(response.responseCode).toBe("00");
626
+ });
627
+ });
628
+ test("029 - charge discover contactless", () => {
629
+ const card = Data_1.TestCards.discoverSwipe(src_1.EntryMethod.Proximity);
630
+ return card
631
+ .charge(18.03)
632
+ .withAllowDuplicates(true)
633
+ .withCurrency("USD")
634
+ .execute()
635
+ .then((response) => {
636
+ expect(response).toBeTruthy();
637
+ expect(response.responseCode).toBe("00");
638
+ });
639
+ });
640
+ test("030 - charge amex contactless", () => {
641
+ const card = Data_1.TestCards.amexSwipe(src_1.EntryMethod.Proximity);
642
+ return card
643
+ .charge(18.04)
644
+ .withAllowDuplicates(true)
645
+ .withCurrency("USD")
646
+ .execute()
647
+ .then((response) => {
648
+ expect(response).toBeTruthy();
649
+ expect(response.responseCode).toBe("00");
650
+ });
651
+ });
652
+ /// AUTHORIZATION
653
+ test.skip("031 - authorize visa swipe", () => {
654
+ const card = Data_1.TestCards.visaSwipe();
655
+ // 031a authorize
656
+ return (card
657
+ .authorize(15.08)
658
+ .withAllowDuplicates(true)
659
+ .withCurrency("USD")
660
+ .execute()
661
+ .then((response) => {
662
+ expect(response).toBeTruthy();
663
+ expect(response.responseCode).toBe("00");
664
+ return response;
665
+ })
666
+ // 031b capture
667
+ .then((response) => {
668
+ return response
669
+ .capture()
670
+ .execute()
671
+ .then((captureResponse) => {
672
+ expect(captureResponse).toBeTruthy();
673
+ expect(captureResponse.responseCode).toBe("00");
674
+ });
675
+ }));
676
+ });
677
+ test.skip("032 - authorize visa swipe additional auth", () => {
678
+ const card = Data_1.TestCards.visaSwipe();
679
+ // 032a authorize
680
+ return (card
681
+ .authorize(15.09)
682
+ .withAllowDuplicates(true)
683
+ .withCurrency("USD")
684
+ .execute()
685
+ .then((response) => {
686
+ expect(response).toBeTruthy();
687
+ expect(response.responseCode).toBe("00");
688
+ return response;
689
+ })
690
+ // 032b Additional Auth (restaurant only)
691
+ // 032c Add to batch
692
+ .then((response) => {
693
+ return response
694
+ .capture()
695
+ .execute()
696
+ .then((captureResponse) => {
697
+ expect(captureResponse).toBeTruthy();
698
+ expect(captureResponse.responseCode).toBe("00");
699
+ });
700
+ }));
701
+ });
702
+ test.skip("033 - authorize mastercard swipe", () => {
703
+ const card = Data_1.TestCards.masterCardSwipe();
704
+ // 033a authorize
705
+ return (card
706
+ .authorize(15.1)
707
+ .withAllowDuplicates(true)
708
+ .withCurrency("USD")
709
+ .execute()
710
+ .then((response) => {
711
+ expect(response).toBeTruthy();
712
+ expect(response.responseCode).toBe("00");
713
+ return response;
714
+ })
715
+ // 033b capture
716
+ .then((response) => {
717
+ return response
718
+ .capture()
719
+ .execute()
720
+ .then((captureResponse) => {
721
+ expect(captureResponse).toBeTruthy();
722
+ expect(captureResponse.responseCode).toBe("00");
723
+ });
724
+ }));
725
+ });
726
+ test("033a - authorize discover swipe", () => {
727
+ const card = Data_1.TestCards.discoverSwipe();
728
+ return card
729
+ .authorize(15.1)
730
+ .withCurrency("USD")
731
+ .withAllowDuplicates(true)
732
+ .execute()
733
+ .then((response) => {
734
+ expect(response).toBeTruthy();
735
+ expect(response.responseCode).toBe("00");
736
+ });
737
+ });
738
+ /// AUTHORIZATION - Manually Entered, Card Present
739
+ test.skip("034 - authorize visa manual card present", () => {
740
+ const address = new src_1.Address();
741
+ address.postalCode = "75024";
742
+ address.streetAddress1 = "6860 Dallas Pkwy";
743
+ const card = Data_1.TestCards.visaManual(true, true);
744
+ // 034a authorize
745
+ return (card
746
+ .authorize(16.08)
747
+ .withAllowDuplicates(true)
748
+ .withCurrency("USD")
749
+ .withAddress(address)
750
+ .execute()
751
+ .then((response) => {
752
+ expect(response).toBeTruthy();
753
+ expect(response.responseCode).toBe("00");
754
+ return response;
755
+ })
756
+ // 034b capture
757
+ .then((response) => {
758
+ return response
759
+ .capture()
760
+ .execute()
761
+ .then((captureResponse) => {
762
+ expect(captureResponse).toBeTruthy();
763
+ expect(captureResponse.responseCode).toBe("00");
764
+ });
765
+ }));
766
+ });
767
+ test.skip("035 - authorize visa manual card present additional auth", () => {
768
+ const address = new src_1.Address();
769
+ address.postalCode = "75024";
770
+ address.streetAddress1 = "6860 Dallas Pkwy";
771
+ const card = Data_1.TestCards.visaManual(true, true);
772
+ // 035a authorize
773
+ return (card
774
+ .authorize(16.09)
775
+ .withAllowDuplicates(true)
776
+ .withCurrency("USD")
777
+ .withAddress(address)
778
+ .execute()
779
+ .then((response) => {
780
+ expect(response).toBeTruthy();
781
+ expect(response.responseCode).toBe("00");
782
+ return response;
783
+ })
784
+ // 035b Additional Auth (restaurant only)
785
+ // 035c Add to batch
786
+ .then((response) => {
787
+ return response
788
+ .capture()
789
+ .execute()
790
+ .then((captureResponse) => {
791
+ expect(captureResponse).toBeTruthy();
792
+ expect(captureResponse.responseCode).toBe("00");
793
+ });
794
+ }));
795
+ });
796
+ test.skip("036 - authorize mastercard manual card present", () => {
797
+ const address = new src_1.Address();
798
+ address.postalCode = "75024";
799
+ address.streetAddress1 = "6860 Dallas Pkwy";
800
+ const card = Data_1.TestCards.masterCardManual(true, true);
801
+ // 036a authorize
802
+ return (card
803
+ .authorize(16.1)
804
+ .withAllowDuplicates(true)
805
+ .withCurrency("USD")
806
+ .withAddress(address)
807
+ .execute()
808
+ .then((response) => {
809
+ expect(response).toBeTruthy();
810
+ expect(response.responseCode).toBe("00");
811
+ return response;
812
+ })
813
+ // 036b capture
814
+ .then((response) => {
815
+ return response
816
+ .capture()
817
+ .execute()
818
+ .then((captureResponse) => {
819
+ expect(captureResponse).toBeTruthy();
820
+ expect(captureResponse.responseCode).toBe("00");
821
+ });
822
+ }));
823
+ });
824
+ test("036a - authorize discover manual card present", () => {
825
+ const address = new src_1.Address();
826
+ address.postalCode = "750241234";
827
+ const card = Data_1.TestCards.discoverManual(true, true);
828
+ return card
829
+ .authorize(16.1)
830
+ .withAllowDuplicates(true)
831
+ .withCurrency("USD")
832
+ .withAddress(address)
833
+ .execute()
834
+ .then((response) => {
835
+ expect(response).toBeTruthy();
836
+ expect(response.responseCode).toBe("00");
837
+ });
838
+ });
839
+ /// AUTHORIZATION - Manually Entered, Card Not Present
840
+ test.skip("037 - authorize visa manual", () => {
841
+ const address = new src_1.Address();
842
+ address.postalCode = "750241234";
843
+ address.streetAddress1 = "6860 Dallas Pkwy";
844
+ const card = Data_1.TestCards.visaManual(false, true);
845
+ // 034a authorize
846
+ return (card
847
+ .authorize(17.08)
848
+ .withAllowDuplicates(true)
849
+ .withCurrency("USD")
850
+ .withAddress(address)
851
+ .execute()
852
+ .then((response) => {
853
+ expect(response).toBeTruthy();
854
+ expect(response.responseCode).toBe("00");
855
+ return response;
856
+ })
857
+ // 034b capture
858
+ .then((response) => {
859
+ return response
860
+ .capture()
861
+ .execute()
862
+ .then((captureResponse) => {
863
+ expect(captureResponse).toBeTruthy();
864
+ expect(captureResponse.responseCode).toBe("00");
865
+ });
866
+ }));
867
+ });
868
+ test.skip("038 - authorize mastercard manual", () => {
869
+ const address = new src_1.Address();
870
+ address.postalCode = "750241234";
871
+ address.streetAddress1 = "6860";
872
+ const card = Data_1.TestCards.masterCardManual(false, true);
873
+ // 036a authorize
874
+ return (card
875
+ .authorize(17.09)
876
+ .withAllowDuplicates(true)
877
+ .withCurrency("USD")
878
+ .withAddress(address)
879
+ .execute()
880
+ .then((response) => {
881
+ expect(response).toBeTruthy();
882
+ expect(response.responseCode).toBe("00");
883
+ return response;
884
+ })
885
+ // 036b capture
886
+ .then((response) => {
887
+ return response
888
+ .capture()
889
+ .execute()
890
+ .then((captureResponse) => {
891
+ expect(captureResponse).toBeTruthy();
892
+ expect(captureResponse.responseCode).toBe("00");
893
+ });
894
+ }));
895
+ });
896
+ test("038a - authorize discover manual", () => {
897
+ const address = new src_1.Address();
898
+ address.postalCode = "750241234";
899
+ const card = Data_1.TestCards.discoverManual(false, true);
900
+ return card
901
+ .authorize(17.1)
902
+ .withAllowDuplicates(true)
903
+ .withCurrency("USD")
904
+ .withAddress(address)
905
+ .execute()
906
+ .then((response) => {
907
+ expect(response).toBeTruthy();
908
+ expect(response.responseCode).toBe("00");
909
+ });
910
+ });
911
+ /// PARTIALLY APPROVED SALE (Required)
912
+ test("039 - charge discover swipe partial approval", () => {
913
+ const card = Data_1.TestCards.discoverSwipe();
914
+ return card
915
+ .charge(40.0)
916
+ .withAllowDuplicates(true)
917
+ .withCurrency("USD")
918
+ .withAllowPartialAuth(true)
919
+ .execute()
920
+ .then((response) => {
921
+ expect(response).toBeTruthy();
922
+ expect(response.responseCode).toBe("10");
923
+ expect(response.authorizedAmount).toBe("40.00");
924
+ });
925
+ });
926
+ test("040 - charge visa swipe partial approval", () => {
927
+ const card = Data_1.TestCards.visaSwipe();
928
+ return card
929
+ .charge(130.0)
930
+ .withAllowDuplicates(true)
931
+ .withCurrency("USD")
932
+ .withAllowPartialAuth(true)
933
+ .execute()
934
+ .then((response) => {
935
+ expect(response).toBeTruthy();
936
+ expect(response.responseCode).toBe("10");
937
+ expect(response.authorizedAmount).toBe("110.00");
938
+ });
939
+ });
940
+ test("041 - charge discover manual partial approval", () => {
941
+ const address = new src_1.Address();
942
+ address.postalCode = "75024";
943
+ const card = Data_1.TestCards.discoverManual(true, true);
944
+ return card
945
+ .charge(145.0)
946
+ .withAllowDuplicates(true)
947
+ .withCurrency("USD")
948
+ .withAllowPartialAuth(true)
949
+ .withAddress(address)
950
+ .execute()
951
+ .then((response) => {
952
+ expect(response).toBeTruthy();
953
+ expect(response.responseCode).toBe("10");
954
+ expect(response.authorizedAmount).toBe("65.00");
955
+ });
956
+ });
957
+ test.skip("042 - charge mastercard swipe partial approval", () => {
958
+ const card = Data_1.TestCards.masterCardSwipe();
959
+ return (card
960
+ .charge(155.0)
961
+ .withAllowDuplicates(true)
962
+ .withCurrency("USD")
963
+ .withAllowPartialAuth(true)
964
+ .execute()
965
+ .then((response) => {
966
+ expect(response).toBeTruthy();
967
+ expect(response.responseCode).toBe("10");
968
+ expect(response.authorizedAmount).toBe("100.00");
969
+ return response;
970
+ })
971
+ // test case 62
972
+ .then((response) => {
973
+ return (response
974
+ .reverse(100.0)
975
+ // .withAllowDuplicates(true)
976
+ .execute()
977
+ .then((reverseResponse) => {
978
+ expect(reverseResponse).toBeTruthy();
979
+ expect(reverseResponse.responseCode).toBe("00");
980
+ }));
981
+ }));
982
+ });
983
+ /// SALE WITH GRATUITY
984
+ /// Tip Edit (Tip at Settlement)
985
+ test.skip("043 - charge visa swipe edit gratuity", () => {
986
+ const card = Data_1.TestCards.visaSwipe();
987
+ return card
988
+ .charge(15.12)
989
+ .withAllowDuplicates(true)
990
+ .withCurrency("USD")
991
+ .execute()
992
+ .then((response) => {
993
+ expect(response).toBeTruthy();
994
+ expect(response.responseCode).toBe("00");
995
+ return response;
996
+ })
997
+ .then((response) => {
998
+ return (response
999
+ .edit()
1000
+ // .withAllowDuplicates(true)
1001
+ .withAmount(18.12)
1002
+ .withGratuity(3.0)
1003
+ .execute()
1004
+ .then((editResponse) => {
1005
+ expect(editResponse).toBeTruthy();
1006
+ expect(editResponse.responseCode).toBe("00");
1007
+ }));
1008
+ });
1009
+ });
1010
+ test.skip("044 - charge mastercard manual edit gratuity", () => {
1011
+ const address = new src_1.Address();
1012
+ address.postalCode = "75024";
1013
+ const card = Data_1.TestCards.masterCardManual(true, true);
1014
+ return card
1015
+ .charge(15.13)
1016
+ .withAllowDuplicates(true)
1017
+ .withCurrency("USD")
1018
+ .withAddress(address)
1019
+ .execute()
1020
+ .then((response) => {
1021
+ expect(response).toBeTruthy();
1022
+ expect(response.responseCode).toBe("00");
1023
+ return response;
1024
+ })
1025
+ .then((response) => {
1026
+ return (response
1027
+ .edit()
1028
+ // .withAllowDuplicates(true)
1029
+ .withAmount(18.13)
1030
+ .withGratuity(3.0)
1031
+ .execute()
1032
+ .then((editResponse) => {
1033
+ expect(editResponse).toBeTruthy();
1034
+ expect(editResponse.responseCode).toBe("00");
1035
+ }));
1036
+ });
1037
+ });
1038
+ /// Tip on Purchase
1039
+ test("045 - charge visa manual gratuity", () => {
1040
+ const address = new src_1.Address();
1041
+ address.postalCode = "75024";
1042
+ const card = Data_1.TestCards.visaManual(true, true);
1043
+ return card
1044
+ .charge(18.61)
1045
+ .withAllowDuplicates(true)
1046
+ .withCurrency("USD")
1047
+ .withAddress(address)
1048
+ .withGratuity(3.5)
1049
+ .execute()
1050
+ .then((response) => {
1051
+ expect(response).toBeTruthy();
1052
+ expect(response.responseCode).toBe("00");
1053
+ });
1054
+ });
1055
+ test.skip("046 - charge mastercard swipe gratuity", () => {
1056
+ const card = Data_1.TestCards.masterCardSwipe();
1057
+ return card
1058
+ .charge(18.62)
1059
+ .withAllowDuplicates(true)
1060
+ .withCurrency("USD")
1061
+ .withGratuity(3.5)
1062
+ .execute()
1063
+ .then((response) => {
1064
+ expect(response).toBeTruthy();
1065
+ expect(response.responseCode).toBe("00");
1066
+ return response;
1067
+ })
1068
+ .then((response) => {
1069
+ return (response
1070
+ .edit()
1071
+ // .withAllowDuplicates(true)
1072
+ .withAmount(18.12)
1073
+ .withGratuity(3.0)
1074
+ .execute()
1075
+ .then((editResponse) => {
1076
+ expect(editResponse).toBeTruthy();
1077
+ expect(editResponse.responseCode).toBe("00");
1078
+ }));
1079
+ });
1080
+ });
1081
+ /// LEVEL II CORPORATE PURCHASE CARD
1082
+ test.skip("047 - level ii visa swipe response b", () => {
1083
+ const card = Data_1.TestCards.visaSwipe();
1084
+ return card
1085
+ .charge(112.34)
1086
+ .withAllowDuplicates(true)
1087
+ .withCurrency("USD")
1088
+ .withCommercialRequest(true)
1089
+ .execute()
1090
+ .then((response) => {
1091
+ expect(response).toBeTruthy();
1092
+ expect(response.responseCode).toBe("00");
1093
+ expect(response.commercialIndicator).toBe("B");
1094
+ return response;
1095
+ })
1096
+ .then((response) => {
1097
+ return (response
1098
+ .edit()
1099
+ // .withAllowDuplicates(true)
1100
+ .withTaxType(src_1.TaxType.SalesTax)
1101
+ .withTaxAmount(1)
1102
+ .execute()
1103
+ .then((cpcResponse) => {
1104
+ expect(cpcResponse).toBeTruthy();
1105
+ expect(cpcResponse.responseCode).toBe("00");
1106
+ }));
1107
+ });
1108
+ });
1109
+ test.skip("047a - level ii visa swipe response b", () => {
1110
+ const card = Data_1.TestCards.visaSwipe();
1111
+ return card
1112
+ .charge(112.34)
1113
+ .withAllowDuplicates(true)
1114
+ .withCurrency("USD")
1115
+ .withCommercialRequest(true)
1116
+ .execute()
1117
+ .then((response) => {
1118
+ expect(response).toBeTruthy();
1119
+ expect(response.responseCode).toBe("00");
1120
+ expect(response.commercialIndicator).toBe("B");
1121
+ return response;
1122
+ })
1123
+ .then((response) => {
1124
+ return (response
1125
+ .edit()
1126
+ // .withAllowDuplicates(true)
1127
+ .withTaxType(src_1.TaxType.NotUsed)
1128
+ .execute()
1129
+ .then((cpcResponse) => {
1130
+ expect(cpcResponse).toBeTruthy();
1131
+ expect(cpcResponse.responseCode).toBe("00");
1132
+ }));
1133
+ });
1134
+ });
1135
+ test.skip("048 - level ii visa swipe response r", () => {
1136
+ const card = Data_1.TestCards.visaSwipe();
1137
+ return card
1138
+ .charge(123.45)
1139
+ .withAllowDuplicates(true)
1140
+ .withCurrency("USD")
1141
+ .withCommercialRequest(true)
1142
+ .execute()
1143
+ .then((response) => {
1144
+ expect(response).toBeTruthy();
1145
+ expect(response.responseCode).toBe("00");
1146
+ expect(response.commercialIndicator).toBe("R");
1147
+ return response;
1148
+ })
1149
+ .then((response) => {
1150
+ return (response
1151
+ .edit()
1152
+ // .withAllowDuplicates(true)
1153
+ .withTaxType(src_1.TaxType.TaxExempt)
1154
+ .execute()
1155
+ .then((cpcResponse) => {
1156
+ expect(cpcResponse).toBeTruthy();
1157
+ expect(cpcResponse.responseCode).toBe("00");
1158
+ }));
1159
+ });
1160
+ });
1161
+ test.skip("049 - level ii visa manual response s", () => {
1162
+ const address = new src_1.Address();
1163
+ address.postalCode = "75024";
1164
+ const card = Data_1.TestCards.visaManual(true, true);
1165
+ return card
1166
+ .charge(134.56)
1167
+ .withAllowDuplicates(true)
1168
+ .withCurrency("USD")
1169
+ .withAddress(address)
1170
+ .withCommercialRequest(true)
1171
+ .execute()
1172
+ .then((response) => {
1173
+ expect(response).toBeTruthy();
1174
+ expect(response.responseCode).toBe("00");
1175
+ expect(response.commercialIndicator).toBe("S");
1176
+ return response;
1177
+ })
1178
+ .then((response) => {
1179
+ return (response
1180
+ .edit()
1181
+ // .withAllowDuplicates(true)
1182
+ .withPoNumber("9876543210")
1183
+ .withTaxType(src_1.TaxType.SalesTax)
1184
+ .withTaxAmount(1)
1185
+ .execute()
1186
+ .then((cpcResponse) => {
1187
+ expect(cpcResponse).toBeTruthy();
1188
+ expect(cpcResponse.responseCode).toBe("00");
1189
+ }));
1190
+ });
1191
+ });
1192
+ test.skip("050 - level ii mastercard swipe response s", () => {
1193
+ const card = Data_1.TestCards.masterCardSwipe();
1194
+ return card
1195
+ .charge(111.06)
1196
+ .withAllowDuplicates(true)
1197
+ .withCurrency("USD")
1198
+ .withCommercialRequest(true)
1199
+ .execute()
1200
+ .then((response) => {
1201
+ expect(response).toBeTruthy();
1202
+ expect(response.responseCode).toBe("00");
1203
+ expect(response.commercialIndicator).toBe("S");
1204
+ return response;
1205
+ })
1206
+ .then((response) => {
1207
+ return (response
1208
+ .edit()
1209
+ // .withAllowDuplicates(true)
1210
+ .withPoNumber("9876543210")
1211
+ .withTaxType(src_1.TaxType.NotUsed)
1212
+ .execute()
1213
+ .then((cpcResponse) => {
1214
+ expect(cpcResponse).toBeTruthy();
1215
+ expect(cpcResponse.responseCode).toBe("00");
1216
+ }));
1217
+ });
1218
+ });
1219
+ test.skip("051 - level ii mastercard manual response s", () => {
1220
+ const address = new src_1.Address();
1221
+ address.postalCode = "75024";
1222
+ const card = Data_1.TestCards.masterCardManual(true, true);
1223
+ return card
1224
+ .charge(111.07)
1225
+ .withAllowDuplicates(true)
1226
+ .withCurrency("USD")
1227
+ .withAddress(address)
1228
+ .withCommercialRequest(true)
1229
+ .execute()
1230
+ .then((response) => {
1231
+ expect(response).toBeTruthy();
1232
+ expect(response.responseCode).toBe("00");
1233
+ expect(response.commercialIndicator).toBe("S");
1234
+ return response;
1235
+ })
1236
+ .then((response) => {
1237
+ return (response
1238
+ .edit()
1239
+ // .withAllowDuplicates(true)
1240
+ .withPoNumber("9876543210")
1241
+ .withTaxType(src_1.TaxType.SalesTax)
1242
+ .withTaxAmount(1)
1243
+ .execute()
1244
+ .then((cpcResponse) => {
1245
+ expect(cpcResponse).toBeTruthy();
1246
+ expect(cpcResponse.responseCode).toBe("00");
1247
+ }));
1248
+ });
1249
+ });
1250
+ test.skip("051a - level ii mastercard manual response s", () => {
1251
+ const address = new src_1.Address();
1252
+ address.postalCode = "75024";
1253
+ const card = Data_1.TestCards.masterCardManual(true, true);
1254
+ return card
1255
+ .charge(111.08)
1256
+ .withAllowDuplicates(true)
1257
+ .withCurrency("USD")
1258
+ .withAddress(address)
1259
+ .withCommercialRequest(true)
1260
+ .execute()
1261
+ .then((response) => {
1262
+ expect(response).toBeTruthy();
1263
+ expect(response.responseCode).toBe("00");
1264
+ expect(response.commercialIndicator).toBe("S");
1265
+ return response;
1266
+ })
1267
+ .then((response) => {
1268
+ return (response
1269
+ .edit()
1270
+ // .withAllowDuplicates(true)
1271
+ .withPoNumber("9876543210")
1272
+ .withTaxType(src_1.TaxType.SalesTax)
1273
+ .withTaxAmount(1)
1274
+ .execute()
1275
+ .then((cpcResponse) => {
1276
+ expect(cpcResponse).toBeTruthy();
1277
+ expect(cpcResponse.responseCode).toBe("00");
1278
+ }));
1279
+ });
1280
+ });
1281
+ test.skip("052 - level ii mastercard manual response s", () => {
1282
+ const address = new src_1.Address();
1283
+ address.postalCode = "75024";
1284
+ const card = Data_1.TestCards.masterCardManual(true, true);
1285
+ return card
1286
+ .charge(111.09)
1287
+ .withAllowDuplicates(true)
1288
+ .withCurrency("USD")
1289
+ .withAddress(address)
1290
+ .withCommercialRequest(true)
1291
+ .execute()
1292
+ .then((response) => {
1293
+ expect(response).toBeTruthy();
1294
+ expect(response.responseCode).toBe("00");
1295
+ expect(response.commercialIndicator).toBe("S");
1296
+ return response;
1297
+ })
1298
+ .then((response) => {
1299
+ return (response
1300
+ .edit()
1301
+ // .withAllowDuplicates(true)
1302
+ .withPoNumber("9876543210")
1303
+ .withTaxType(src_1.TaxType.TaxExempt)
1304
+ .execute()
1305
+ .then((cpcResponse) => {
1306
+ expect(cpcResponse).toBeTruthy();
1307
+ expect(cpcResponse.responseCode).toBe("00");
1308
+ }));
1309
+ });
1310
+ });
1311
+ test.skip("053 - level ii amex swipe no response", () => {
1312
+ const card = Data_1.TestCards.amexSwipe();
1313
+ return card
1314
+ .charge(111.1)
1315
+ .withAllowDuplicates(true)
1316
+ .withCurrency("USD")
1317
+ .withCommercialRequest(true)
1318
+ .execute()
1319
+ .then((response) => {
1320
+ expect(response).toBeTruthy();
1321
+ expect(response.responseCode).toBe("00");
1322
+ expect(response.commercialIndicator).toBe("0");
1323
+ return response;
1324
+ })
1325
+ .then((response) => {
1326
+ return (response
1327
+ .edit()
1328
+ // .withAllowDuplicates(true)
1329
+ .withTaxType(src_1.TaxType.SalesTax)
1330
+ .withTaxAmount(1)
1331
+ .execute()
1332
+ .then((cpcResponse) => {
1333
+ expect(cpcResponse).toBeTruthy();
1334
+ expect(cpcResponse.responseCode).toBe("00");
1335
+ }));
1336
+ });
1337
+ });
1338
+ test.skip("054 - level ii amex manual no response", () => {
1339
+ const address = new src_1.Address();
1340
+ address.postalCode = "75024";
1341
+ const card = Data_1.TestCards.amexManual(true, true);
1342
+ return card
1343
+ .charge(111.11)
1344
+ .withAllowDuplicates(true)
1345
+ .withCurrency("USD")
1346
+ .withAddress(address)
1347
+ .withCommercialRequest(true)
1348
+ .execute()
1349
+ .then((response) => {
1350
+ expect(response).toBeTruthy();
1351
+ expect(response.responseCode).toBe("00");
1352
+ expect(response.commercialIndicator).toBe("0");
1353
+ return response;
1354
+ })
1355
+ .then((response) => {
1356
+ return (response
1357
+ .edit()
1358
+ // .withAllowDuplicates(true)
1359
+ .withPoNumber("9876543210")
1360
+ .withTaxType(src_1.TaxType.NotUsed)
1361
+ .execute()
1362
+ .then((cpcResponse) => {
1363
+ expect(cpcResponse).toBeTruthy();
1364
+ expect(cpcResponse.responseCode).toBe("00");
1365
+ }));
1366
+ });
1367
+ });
1368
+ test.skip("055 - level ii amex manual no response", () => {
1369
+ const address = new src_1.Address();
1370
+ address.postalCode = "75024";
1371
+ const card = Data_1.TestCards.amexManual(true, true);
1372
+ return card
1373
+ .charge(111.12)
1374
+ .withAllowDuplicates(true)
1375
+ .withCurrency("USD")
1376
+ .withAddress(address)
1377
+ .withCommercialRequest(true)
1378
+ .execute()
1379
+ .then((response) => {
1380
+ expect(response).toBeTruthy();
1381
+ expect(response.responseCode).toBe("00");
1382
+ expect(response.commercialIndicator).toBe("0");
1383
+ return response;
1384
+ })
1385
+ .then((response) => {
1386
+ return (response
1387
+ .edit()
1388
+ // .withAllowDuplicates(true)
1389
+ .withPoNumber("9876543210")
1390
+ .withTaxType(src_1.TaxType.NotUsed)
1391
+ .execute()
1392
+ .then((cpcResponse) => {
1393
+ expect(cpcResponse).toBeTruthy();
1394
+ expect(cpcResponse.responseCode).toBe("00");
1395
+ }));
1396
+ });
1397
+ });
1398
+ test.skip("055a - level ii amex manual no response", () => {
1399
+ const address = new src_1.Address();
1400
+ address.postalCode = "75024";
1401
+ const card = Data_1.TestCards.amexManual(true, true);
1402
+ return card
1403
+ .charge(111.13)
1404
+ .withAllowDuplicates(true)
1405
+ .withCurrency("USD")
1406
+ .withAddress(address)
1407
+ .withCommercialRequest(true)
1408
+ .execute()
1409
+ .then((response) => {
1410
+ expect(response).toBeTruthy();
1411
+ expect(response.responseCode).toBe("00");
1412
+ expect(response.commercialIndicator).toBe("0");
1413
+ return response;
1414
+ })
1415
+ .then((response) => {
1416
+ return (response
1417
+ .edit()
1418
+ // .withAllowDuplicates(true)
1419
+ .withPoNumber("9876543210")
1420
+ .withTaxType(src_1.TaxType.TaxExempt)
1421
+ .execute()
1422
+ .then((cpcResponse) => {
1423
+ expect(cpcResponse).toBeTruthy();
1424
+ expect(cpcResponse.responseCode).toBe("00");
1425
+ }));
1426
+ });
1427
+ });
1428
+ /// OFFLINE SALE / AUTHORIZATION
1429
+ test("056 - offline charge visa manual", () => {
1430
+ const card = Data_1.TestCards.visaManual(false, true);
1431
+ return card
1432
+ .charge(15.12)
1433
+ .withAllowDuplicates(true)
1434
+ .withCurrency("USD")
1435
+ .withOfflineAuthCode("654321")
1436
+ .execute()
1437
+ .then((response) => {
1438
+ expect(response).toBeTruthy();
1439
+ expect(response.responseCode).toBe("00");
1440
+ });
1441
+ });
1442
+ test("056 - offline auth visa manual", () => {
1443
+ const card = Data_1.TestCards.visaManual(false, true);
1444
+ return card
1445
+ .authorize(15.11)
1446
+ .withAllowDuplicates(true)
1447
+ .withCurrency("USD")
1448
+ .withOfflineAuthCode("654321")
1449
+ .execute()
1450
+ .then((response) => {
1451
+ expect(response).toBeTruthy();
1452
+ expect(response.responseCode).toBe("00");
1453
+ });
1454
+ });
1455
+ /// RETURN
1456
+ test("057 - return mastercard", () => {
1457
+ const card = Data_1.TestCards.masterCardManual(false, true);
1458
+ return card
1459
+ .refund(15.11)
1460
+ .withAllowDuplicates(true)
1461
+ .withCurrency("USD")
1462
+ .execute()
1463
+ .then((response) => {
1464
+ expect(response).toBeTruthy();
1465
+ expect(response.responseCode).toBe("00");
1466
+ });
1467
+ });
1468
+ test("057a - return mastercard swipe", () => {
1469
+ const card = Data_1.TestCards.masterCardSwipe();
1470
+ return card
1471
+ .refund(15.15)
1472
+ .withAllowDuplicates(true)
1473
+ .withCurrency("USD")
1474
+ .execute()
1475
+ .then((response) => {
1476
+ expect(response).toBeTruthy();
1477
+ expect(response.responseCode).toBe("00");
1478
+ });
1479
+ });
1480
+ // test("058 - return jcb transaction id", () => {
1481
+ // // see test 14
1482
+ // });
1483
+ /// ONLINE VOID / REVERSAL (Required)
1484
+ // test("059 - reversal visa", () => {
1485
+ // // see test 10
1486
+ // });
1487
+ // test("060 - reversal mastercard", () => {
1488
+ // // see test case 17
1489
+ // });
1490
+ // test("061 - reversal mastercard", () => {
1491
+ // // see test case 23
1492
+ // });
1493
+ // test("062 - reversal mastercard", () => {
1494
+ // // see test case 42
1495
+ // });
1496
+ // test("063 - reversal visa partial", () => {
1497
+ // // see test case 15
1498
+ // });
1499
+ // test("064 - reversal discover partial", () => {
1500
+ // // see test 21
1501
+ // });
1502
+ /// PIN DEBIT CARD FUNCTIONS
1503
+ test("065 - debit sale visa swipe", () => {
1504
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1505
+ return card
1506
+ .charge(14.01)
1507
+ .withAllowDuplicates(true)
1508
+ .withCurrency("USD")
1509
+ .execute()
1510
+ .then((response) => {
1511
+ expect(response).toBeTruthy();
1512
+ expect(response.responseCode).toBe("00");
1513
+ });
1514
+ });
1515
+ test("066 - debit sale mastercard swipe", () => {
1516
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
1517
+ return card
1518
+ .charge(14.02)
1519
+ .withAllowDuplicates(true)
1520
+ .withCurrency("USD")
1521
+ .execute()
1522
+ .then((response) => {
1523
+ expect(response).toBeTruthy();
1524
+ expect(response.responseCode).toBe("00");
1525
+ return response;
1526
+ })
1527
+ .then(() => {
1528
+ // test case 71
1529
+ return (card
1530
+ .reverse(14.02)
1531
+ // .withAllowDuplicates(true)
1532
+ .execute()
1533
+ .then((reverseResponse) => {
1534
+ expect(reverseResponse).toBeTruthy();
1535
+ expect(reverseResponse.responseCode).toBe("00");
1536
+ }));
1537
+ });
1538
+ });
1539
+ test("067 - debit sale visa swipe cashback", () => {
1540
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1541
+ return card
1542
+ .charge(14.03)
1543
+ .withAllowDuplicates(true)
1544
+ .withCurrency("USD")
1545
+ .withCashBack(5.0)
1546
+ .execute()
1547
+ .then((response) => {
1548
+ expect(response).toBeTruthy();
1549
+ expect(response.responseCode).toBe("00");
1550
+ });
1551
+ });
1552
+ test("067a - debit sale mastercard", () => {
1553
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
1554
+ return card
1555
+ .charge(14.04)
1556
+ .withAllowDuplicates(true)
1557
+ .withCurrency("USD")
1558
+ .execute()
1559
+ .then((response) => {
1560
+ expect(response).toBeTruthy();
1561
+ expect(response.responseCode).toBe("00");
1562
+ });
1563
+ });
1564
+ /// PARTIALLY APPROVED PURCHASE
1565
+ test("068 - debit sale mastercard partial approval", () => {
1566
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
1567
+ return card
1568
+ .charge(33.0)
1569
+ .withAllowDuplicates(true)
1570
+ .withCurrency("USD")
1571
+ .withAllowPartialAuth(true)
1572
+ .execute()
1573
+ .then((response) => {
1574
+ expect(response).toBeTruthy();
1575
+ expect(response.responseCode).toBe("10");
1576
+ expect(response.authorizedAmount).toBe("22.00");
1577
+ });
1578
+ });
1579
+ test.skip("069 - debit sale visa partial approval", () => {
1580
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1581
+ return card
1582
+ .charge(44.0)
1583
+ .withAllowDuplicates(true)
1584
+ .withCurrency("USD")
1585
+ .withAllowPartialAuth(true)
1586
+ .execute()
1587
+ .then((response) => {
1588
+ expect(response).toBeTruthy();
1589
+ expect(response.responseCode).toBe("10");
1590
+ expect(response.authorizedAmount).toBe("33.00");
1591
+ return response;
1592
+ })
1593
+ .then(() => {
1594
+ // test case 72
1595
+ return (card
1596
+ .reverse(33.0)
1597
+ // .withAllowDuplicates(true)
1598
+ .execute()
1599
+ .then((reverseResponse) => {
1600
+ expect(reverseResponse).toBeTruthy();
1601
+ expect(reverseResponse.responseCode).toBe("00");
1602
+ }));
1603
+ });
1604
+ });
1605
+ /// RETURN
1606
+ test.skip("070 - debit return visa swipe", () => {
1607
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1608
+ return card
1609
+ .refund(14.07)
1610
+ .withAllowDuplicates(true)
1611
+ .withCurrency("USD")
1612
+ .execute()
1613
+ .then((response) => {
1614
+ expect(response).toBeTruthy();
1615
+ expect(response.responseCode).toBe("00");
1616
+ });
1617
+ });
1618
+ test("070a - debit return visa swipe", () => {
1619
+ const card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1620
+ return card
1621
+ .refund(14.08)
1622
+ .withAllowDuplicates(true)
1623
+ .withCurrency("USD")
1624
+ .execute()
1625
+ .then((response) => {
1626
+ expect(response).toBeTruthy();
1627
+ expect(response.responseCode).toBe("00");
1628
+ return response;
1629
+ })
1630
+ .then(() => {
1631
+ return (card
1632
+ .reverse(14.08)
1633
+ // .withAllowDuplicates(true)
1634
+ .execute()
1635
+ .then((reverseResponse) => {
1636
+ expect(reverseResponse).toBeTruthy();
1637
+ expect(reverseResponse.responseCode).toBe("00");
1638
+ }));
1639
+ });
1640
+ });
1641
+ /// REVERSAL
1642
+ // test("071 - debit reversal mastercard", () => {
1643
+ // // see test case 66
1644
+ // });
1645
+ // test("072 - debit reversal visa", () => {
1646
+ // // see test case 96
1647
+ // });
1648
+ /// EBT FUNCTIONS
1649
+ /// Food Stamp Purchase
1650
+ test("080 - ebt fs purchase visa swipe", () => {
1651
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
1652
+ return card
1653
+ .charge(101.01)
1654
+ .withAllowDuplicates(true)
1655
+ .withCurrency("USD")
1656
+ .execute()
1657
+ .then((response) => {
1658
+ expect(response).toBeTruthy();
1659
+ expect(response.responseCode).toBe("00");
1660
+ });
1661
+ });
1662
+ test("081 - ebt fs purchase visa manual", () => {
1663
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1664
+ return card
1665
+ .charge(102.01)
1666
+ .withAllowDuplicates(true)
1667
+ .withCurrency("USD")
1668
+ .execute()
1669
+ .then((response) => {
1670
+ expect(response).toBeTruthy();
1671
+ expect(response.responseCode).toBe("00");
1672
+ });
1673
+ });
1674
+ /// Food Stamp Electronic Voucher (Manual Entry Only)
1675
+ test("082 - ebt voucher purchase visa", () => {
1676
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1677
+ card.serialNumber = "123456789012345";
1678
+ card.approvalCode = "123456";
1679
+ return card
1680
+ .charge(103.01)
1681
+ .withAllowDuplicates(true)
1682
+ .withCurrency("USD")
1683
+ .execute()
1684
+ .then((response) => {
1685
+ expect(response).toBeTruthy();
1686
+ expect(response.responseCode).toBe("00");
1687
+ });
1688
+ });
1689
+ /// Food Stamp Balance Inquiry
1690
+ test("083 - ebt fs return visa swipe", () => {
1691
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1692
+ return card
1693
+ .refund(104.01)
1694
+ .withAllowDuplicates(true)
1695
+ .withCurrency("USD")
1696
+ .execute()
1697
+ .then((response) => {
1698
+ expect(response).toBeTruthy();
1699
+ expect(response.responseCode).toBe("00");
1700
+ });
1701
+ });
1702
+ test("084 - ebt fs return visa manual", () => {
1703
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1704
+ return card
1705
+ .refund(105.01)
1706
+ .withAllowDuplicates(true)
1707
+ .withCurrency("USD")
1708
+ .execute()
1709
+ .then((response) => {
1710
+ expect(response).toBeTruthy();
1711
+ expect(response.responseCode).toBe("00");
1712
+ });
1713
+ });
1714
+ /// Food Stamp Balance Inquiry
1715
+ test("085 - ebt balance inquiry visa swipe", () => {
1716
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1717
+ return card
1718
+ .balanceInquiry()
1719
+ .execute()
1720
+ .then((response) => {
1721
+ expect(response).toBeTruthy();
1722
+ expect(response.responseCode).toBe("00");
1723
+ });
1724
+ });
1725
+ test("086 - ebt balance inquiry visa manual", () => {
1726
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(true, true), "32539F50C245A6A93D123412324000AA");
1727
+ return card
1728
+ .balanceInquiry()
1729
+ .execute()
1730
+ .then((response) => {
1731
+ expect(response).toBeTruthy();
1732
+ expect(response.responseCode).toBe("00");
1733
+ });
1734
+ });
1735
+ /// EBT CASH BENEFITS
1736
+ /// Cash Back Purchase
1737
+ test("087 - ebt cash back purchase visa swipe", () => {
1738
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1739
+ return card
1740
+ .charge(106.01)
1741
+ .withAllowDuplicates(true)
1742
+ .withCurrency("USD")
1743
+ .withCashBack(5.0)
1744
+ .execute()
1745
+ .then((response) => {
1746
+ expect(response).toBeTruthy();
1747
+ expect(response.responseCode).toBe("00");
1748
+ });
1749
+ });
1750
+ test("088 - ebt cash back purchase visa manual", () => {
1751
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1752
+ return card
1753
+ .charge(107.01)
1754
+ .withAllowDuplicates(true)
1755
+ .withCurrency("USD")
1756
+ .withCashBack(5.0)
1757
+ .execute()
1758
+ .then((response) => {
1759
+ expect(response).toBeTruthy();
1760
+ expect(response.responseCode).toBe("00");
1761
+ });
1762
+ });
1763
+ /// No Cash Back Purchase
1764
+ test("089 - ebt cash back purchase visa swipe no cash back", () => {
1765
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1766
+ return card
1767
+ .charge(108.01)
1768
+ .withAllowDuplicates(true)
1769
+ .withCurrency("USD")
1770
+ .withCashBack(0)
1771
+ .execute()
1772
+ .then((response) => {
1773
+ expect(response).toBeTruthy();
1774
+ expect(response.responseCode).toBe("00");
1775
+ });
1776
+ });
1777
+ test("090 - ebt cash back purchase visa manual no cash back", () => {
1778
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1779
+ return card
1780
+ .charge(109.01)
1781
+ .withAllowDuplicates(true)
1782
+ .withCurrency("USD")
1783
+ .withCashBack(0)
1784
+ .execute()
1785
+ .then((response) => {
1786
+ expect(response).toBeTruthy();
1787
+ expect(response.responseCode).toBe("00");
1788
+ });
1789
+ });
1790
+ /// Cash Back Balance Inquiry
1791
+ test("091 - ebt balance inquiry visa swipe cash", () => {
1792
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1793
+ return card
1794
+ .balanceInquiry(src_1.InquiryType.Cash)
1795
+ .execute()
1796
+ .then((response) => {
1797
+ expect(response).toBeTruthy();
1798
+ expect(response.responseCode).toBe("00");
1799
+ });
1800
+ });
1801
+ test("092 - ebt balance inquiry visa manual cash", () => {
1802
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(true, true), "32539F50C245A6A93D123412324000AA");
1803
+ return card
1804
+ .balanceInquiry(src_1.InquiryType.Cash)
1805
+ .execute()
1806
+ .then((response) => {
1807
+ expect(response).toBeTruthy();
1808
+ expect(response.responseCode).toBe("00");
1809
+ });
1810
+ });
1811
+ /// Cash Benefits Withdrawal
1812
+ test("093 - ebt benefit withdrawal visa swipe", () => {
1813
+ const card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
1814
+ return card
1815
+ .charge(110.01)
1816
+ .withAllowDuplicates(true)
1817
+ .withCurrency("USD")
1818
+ .execute()
1819
+ .then((response) => {
1820
+ expect(response).toBeTruthy();
1821
+ expect(response.responseCode).toBe("00");
1822
+ });
1823
+ });
1824
+ test("094 - ebt benefit withdrawal visa manual", () => {
1825
+ const card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
1826
+ return card
1827
+ .charge(111.01)
1828
+ .withAllowDuplicates(true)
1829
+ .withCurrency("USD")
1830
+ .withCashBack(0)
1831
+ .execute()
1832
+ .then((response) => {
1833
+ expect(response).toBeTruthy();
1834
+ expect(response.responseCode).toBe("00");
1835
+ });
1836
+ });
1837
+ /// HMS GIFT - REWARDS
1838
+ /// GIFT
1839
+ /// ACTIVATE
1840
+ test("095 - activate gift 1 swipe", () => {
1841
+ const card = Data_1.TestCards.giftCard1Swipe();
1842
+ return card
1843
+ .activate(6.0)
1844
+ .execute()
1845
+ .then((response) => {
1846
+ expect(response).toBeTruthy();
1847
+ expect(response.responseCode).toBe("00");
1848
+ });
1849
+ });
1850
+ test("096 - activate gift 2 manual", () => {
1851
+ const card = Data_1.TestCards.giftCard2Manual();
1852
+ return card
1853
+ .activate(7.0)
1854
+ .execute()
1855
+ .then((response) => {
1856
+ expect(response).toBeTruthy();
1857
+ expect(response.responseCode).toBe("00");
1858
+ });
1859
+ });
1860
+ /// ADD VALUE
1861
+ test("097 - add value gift 1 swipe", () => {
1862
+ const card = Data_1.TestCards.giftCard1Swipe();
1863
+ return card
1864
+ .addValue(8.0)
1865
+ .withCurrency("USD")
1866
+ .execute()
1867
+ .then((response) => {
1868
+ expect(response).toBeTruthy();
1869
+ expect(response.responseCode).toBe("00");
1870
+ });
1871
+ });
1872
+ test("098 - add value gift 2 manual", () => {
1873
+ const card = Data_1.TestCards.giftCard2Manual();
1874
+ return card
1875
+ .addValue(9.0)
1876
+ .withCurrency("USD")
1877
+ .execute()
1878
+ .then((response) => {
1879
+ expect(response).toBeTruthy();
1880
+ expect(response.responseCode).toBe("00");
1881
+ });
1882
+ });
1883
+ /// BALANCE INQUIRY
1884
+ test("099 - balance inquiry gift 1 swipe", () => {
1885
+ const card = Data_1.TestCards.giftCard1Swipe();
1886
+ return card
1887
+ .balanceInquiry()
1888
+ .execute()
1889
+ .then((response) => {
1890
+ expect(response).toBeTruthy();
1891
+ expect(response.responseCode).toBe("00");
1892
+ expect(response.balanceAmount).toBe("10.00");
1893
+ });
1894
+ });
1895
+ test("100 - balance inquiry gift 2 manual", () => {
1896
+ const card = Data_1.TestCards.giftCard2Manual();
1897
+ return card
1898
+ .balanceInquiry()
1899
+ .execute()
1900
+ .then((response) => {
1901
+ expect(response).toBeTruthy();
1902
+ expect(response.responseCode).toBe("00");
1903
+ expect(response.balanceAmount).toBe("10.00");
1904
+ });
1905
+ });
1906
+ /// REPLACE / TRANSFER
1907
+ test("101 - replace gift 1 swipe", () => {
1908
+ const oldCard = Data_1.TestCards.giftCard1Swipe();
1909
+ const newCard = Data_1.TestCards.giftCard2Manual();
1910
+ return oldCard
1911
+ .replaceWith(newCard)
1912
+ .execute()
1913
+ .then((response) => {
1914
+ expect(response).toBeTruthy();
1915
+ expect(response.responseCode).toBe("00");
1916
+ });
1917
+ });
1918
+ test("102 - replace gift 2 manual", () => {
1919
+ const newCard = Data_1.TestCards.giftCard1Swipe();
1920
+ const oldCard = Data_1.TestCards.giftCard2Manual();
1921
+ return oldCard
1922
+ .replaceWith(newCard)
1923
+ .execute()
1924
+ .then((response) => {
1925
+ expect(response).toBeTruthy();
1926
+ expect(response.responseCode).toBe("00");
1927
+ });
1928
+ });
1929
+ /// SALE / REDEEM
1930
+ test("103 - sale gift 1 swipe", () => {
1931
+ const card = Data_1.TestCards.giftCard1Swipe();
1932
+ return card
1933
+ .charge(1.0)
1934
+ .withCurrency("USD")
1935
+ .execute()
1936
+ .then((response) => {
1937
+ expect(response).toBeTruthy();
1938
+ expect(response.responseCode).toBe("00");
1939
+ });
1940
+ });
1941
+ test("104 - sale gift 2 manual", () => {
1942
+ const card = Data_1.TestCards.giftCard2Manual();
1943
+ return card
1944
+ .charge(2.0)
1945
+ .withCurrency("USD")
1946
+ .execute()
1947
+ .then((response) => {
1948
+ expect(response).toBeTruthy();
1949
+ expect(response.responseCode).toBe("00");
1950
+ });
1951
+ });
1952
+ test.skip("105 - sale gift 1 void swipe", () => {
1953
+ const card = Data_1.TestCards.giftCard1Swipe();
1954
+ return card
1955
+ .charge(3.0)
1956
+ .withCurrency("USD")
1957
+ .execute()
1958
+ .then((response) => {
1959
+ expect(response).toBeTruthy();
1960
+ expect(response.responseCode).toBe("00");
1961
+ return response;
1962
+ })
1963
+ .then((response) => {
1964
+ // test case 107
1965
+ return response
1966
+ .void()
1967
+ .execute()
1968
+ .then((voidResponse) => {
1969
+ expect(voidResponse).toBeTruthy();
1970
+ expect(voidResponse.responseCode).toBe("00");
1971
+ });
1972
+ });
1973
+ });
1974
+ test.skip("106 - sale gift 2 reversal manual", () => {
1975
+ const card = Data_1.TestCards.giftCard2Manual();
1976
+ return card
1977
+ .charge(4.0)
1978
+ .withCurrency("USD")
1979
+ .execute()
1980
+ .then((response) => {
1981
+ expect(response).toBeTruthy();
1982
+ expect(response.responseCode).toBe("00");
1983
+ return response;
1984
+ })
1985
+ .then((response) => {
1986
+ // test case 108
1987
+ return response
1988
+ .reverse(4.0)
1989
+ .execute()
1990
+ .then((voidResponse) => {
1991
+ expect(voidResponse).toBeTruthy();
1992
+ expect(voidResponse.responseCode).toBe("00");
1993
+ });
1994
+ });
1995
+ });
1996
+ /// VOID
1997
+ // test("107 - void gift", () => {
1998
+ // // see test case 105
1999
+ // });
2000
+ // /// REVERSAL
2001
+ // test("108 - reversal gift", () => {
2002
+ // // see test case 106
2003
+ // });
2004
+ /// DEACTIVATE
2005
+ test("109 - deactivate gift 1", () => {
2006
+ const card = Data_1.TestCards.giftCard1Swipe();
2007
+ return card
2008
+ .deactivate()
2009
+ .execute()
2010
+ .then((response) => {
2011
+ expect(response).toBeTruthy();
2012
+ expect(response.responseCode).toBe("00");
2013
+ });
2014
+ });
2015
+ /// RECEIPTS MESSAGING
2016
+ // test("110 - receipts messaging", () => {
2017
+ // /// PRINT AND SCAN RECEIPT FOR TEST 107
2018
+ // });
2019
+ /// REWARDS
2020
+ /// BALANCE INQUIRY
2021
+ test("111 - balance inquiry rewards 1", () => {
2022
+ const card = Data_1.TestCards.giftCard1Swipe();
2023
+ return card
2024
+ .balanceInquiry()
2025
+ .execute()
2026
+ .then((response) => {
2027
+ expect(response).toBeTruthy();
2028
+ expect(response.responseCode).toBe("00");
2029
+ expect(response.pointsBalanceAmount > "0").toBeTruthy();
2030
+ });
2031
+ });
2032
+ test("112 - balance inquiry rewards 2", () => {
2033
+ const card = Data_1.TestCards.giftCard2Manual();
2034
+ return card
2035
+ .balanceInquiry()
2036
+ .execute()
2037
+ .then((response) => {
2038
+ expect(response).toBeTruthy();
2039
+ expect(response.responseCode).toBe("00");
2040
+ expect(response.pointsBalanceAmount > "0").toBeTruthy();
2041
+ });
2042
+ });
2043
+ /// ALIAS
2044
+ test("113 - create alias gift 1", () => {
2045
+ return src_1.GiftCard.create("9725550100").then((card) => {
2046
+ expect(card).toBeTruthy();
2047
+ });
2048
+ });
2049
+ test("114 - create alias gift 2", () => {
2050
+ return src_1.GiftCard.create("9725550100").then((card) => {
2051
+ expect(card).toBeTruthy();
2052
+ });
2053
+ });
2054
+ test("115 - add alias gift 1", () => {
2055
+ const card = Data_1.TestCards.giftCard1Swipe();
2056
+ return card
2057
+ .addAlias("2145550199")
2058
+ .execute()
2059
+ .then((response) => {
2060
+ expect(response).toBeTruthy();
2061
+ expect(response.responseCode).toBe("00");
2062
+ });
2063
+ });
2064
+ test("116 - add alias gift 2", () => {
2065
+ const card = Data_1.TestCards.giftCard2Manual();
2066
+ return card
2067
+ .addAlias("2145550199")
2068
+ .execute()
2069
+ .then((response) => {
2070
+ expect(response).toBeTruthy();
2071
+ expect(response.responseCode).toBe("00");
2072
+ });
2073
+ });
2074
+ test("117 - delete alias gift 1", () => {
2075
+ const card = Data_1.TestCards.giftCard1Swipe();
2076
+ return card
2077
+ .removeAlias("2145550199")
2078
+ .execute()
2079
+ .then((response) => {
2080
+ expect(response).toBeTruthy();
2081
+ expect(response.responseCode).toBe("00");
2082
+ });
2083
+ });
2084
+ afterAll(() => {
2085
+ expect.assertions(1);
2086
+ return new Promise((resolve, reject) => {
2087
+ src_1.BatchService.closeBatch()
2088
+ .then((response) => {
2089
+ expect(response).toBeTruthy();
2090
+ resolve();
2091
+ })
2092
+ .catch((e) => {
2093
+ if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
2094
+ e.message.indexOf(BATCH_EMPTY) !== -1) {
2095
+ resolve();
2096
+ return;
2097
+ }
2098
+ reject(e);
2099
+ });
2100
+ });
2101
+ });
2102
+ //# sourceMappingURL=Retail.test.js.map