globalpayments-api 3.10.0 → 3.10.2

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 (214) hide show
  1. package/CHANGELOG.md +184 -170
  2. package/appsec.properties +8 -0
  3. package/lib/src/Entities/index.d.ts +4 -0
  4. package/lib/src/Entities/index.js +4 -0
  5. package/lib/src/Entities/index.js.map +1 -1
  6. package/lib/src/Gateways/PorticoConnector.d.ts +3 -3
  7. package/lib/src/Gateways/PorticoConnector.js +24 -0
  8. package/lib/src/Gateways/PorticoConnector.js.map +1 -1
  9. package/lib/src/Gateways/RealexConnector.d.ts +30 -0
  10. package/lib/src/Gateways/RealexConnector.js +523 -0
  11. package/lib/src/PaymentMethods/Credit.d.ts +2 -1
  12. package/lib/src/PaymentMethods/Credit.js +1 -0
  13. package/lib/src/PaymentMethods/Credit.js.map +1 -1
  14. package/lib/src/ServicesConfig.d.ts +27 -0
  15. package/lib/src/ServicesConfig.js +50 -0
  16. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +15 -15
  17. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +5 -5
  18. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +4 -4
  19. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +1 -1
  20. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +112 -59
  21. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +1 -1
  22. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +483 -378
  23. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +1 -1
  24. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +83 -86
  25. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +1 -1
  26. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +1720 -1723
  27. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +1 -1
  28. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +83 -86
  29. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +1 -1
  30. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +1757 -1760
  31. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +1 -1
  32. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +682 -420
  33. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +1 -1
  34. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +2218 -2221
  35. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +36 -8
  36. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -1
  37. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +1 -1
  38. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +707 -392
  39. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +1 -1
  40. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +151 -88
  41. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +1 -1
  42. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +171 -72
  43. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +8 -8
  44. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +1 -1
  45. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +192 -143
  46. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +1 -1
  47. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +377 -147
  48. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +1 -1
  49. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +196 -101
  50. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +1 -1
  51. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +53 -50
  52. package/lib/test/Integration/Gateways/{GpApiConnector/3DS2Test.d.ts → ProPayConnector/Certifications/GetInformationCertificationTests.d.ts} +1 -1
  53. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.js +100 -0
  54. package/lib/test/Integration/Gateways/{GpApiConnector/AccessTokenTest.d.ts → ProPayConnector/Certifications/ProPayAccountCertificationTests.d.ts} +1 -1
  55. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.js +352 -0
  56. package/lib/test/Integration/Gateways/{GpApiConnector/CreditCardNotPresentTest.d.ts → ProPayConnector/Certifications/ProPayFundCertificationTests.d.ts} +1 -1
  57. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.js +123 -0
  58. package/lib/test/Integration/Gateways/{GpApiConnector/3DSecureTest.d.ts → ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.d.ts} +1 -1
  59. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.js +142 -0
  60. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.d.ts +1 -0
  61. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.js +100 -0
  62. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.d.ts +1 -0
  63. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.js +535 -0
  64. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.d.ts +1 -0
  65. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.js +124 -0
  66. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.d.ts +1 -0
  67. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.js +144 -0
  68. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/Certification/AuthTest.d.ts +1 -1
  69. package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +4373 -0
  70. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/Certification/AvsTest.d.ts +1 -1
  71. package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +758 -0
  72. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/Certification/CreditTest.d.ts +1 -1
  73. package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +2399 -0
  74. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/Certification/HoldTest.d.ts +1 -1
  75. package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +1656 -0
  76. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +1 -0
  77. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +5650 -0
  78. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +1 -0
  79. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +1985 -0
  80. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +1 -0
  81. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +2369 -0
  82. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +1 -0
  83. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +1703 -0
  84. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +1 -0
  85. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +2053 -0
  86. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +1 -0
  87. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +2469 -0
  88. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +1 -0
  89. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +3116 -0
  90. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +1 -0
  91. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +2031 -0
  92. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/CreditTest.d.ts +1 -1
  93. package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +322 -0
  94. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/HppTest.d.ts +1 -1
  95. package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +98 -0
  96. package/lib/test/Integration/Gateways/{GpEcomConnector → RealexConnector}/RecurringTest.d.ts +1 -1
  97. package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +263 -0
  98. package/lib/test/Integration/Services/CheckServiceTest.d.ts +1 -1
  99. package/lib/test/Integration/Services/CheckServiceTest.js +98 -45
  100. package/lib/test/Integration/Services/CreditServiceTest.d.ts +1 -1
  101. package/lib/test/Integration/Services/CreditServiceTest.js +313 -174
  102. package/lib/test/Integration/Services/DebitServiceTest.d.ts +1 -1
  103. package/lib/test/Integration/Services/DebitServiceTest.js +154 -81
  104. package/lib/test/Integration/Services/EBTServiceTest.d.ts +1 -1
  105. package/lib/test/Integration/Services/EBTServiceTest.js +135 -64
  106. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +1 -1
  107. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +161 -111
  108. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +1 -1
  109. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +139 -62
  110. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +1 -1
  111. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +202 -125
  112. package/lib/test/Unit/Gateways/{GpEcomConnector → RealexConnector}/CreditTest.d.ts +1 -1
  113. package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +29 -0
  114. package/package.json +62 -62
  115. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js +0 -1029
  116. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +0 -1
  117. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js +0 -649
  118. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +0 -1
  119. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +0 -109
  120. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +0 -1
  121. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +0 -1025
  122. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +0 -1
  123. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.d.ts +0 -1
  124. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +0 -439
  125. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +0 -1
  126. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.d.ts +0 -1
  127. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js +0 -143
  128. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +0 -1
  129. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.d.ts +0 -1
  130. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js +0 -639
  131. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +0 -1
  132. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.d.ts +0 -1
  133. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +0 -149
  134. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +0 -1
  135. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.d.ts +0 -1
  136. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js +0 -226
  137. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +0 -1
  138. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.d.ts +0 -1
  139. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js +0 -434
  140. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +0 -1
  141. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +0 -1
  142. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +0 -217
  143. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +0 -1
  144. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.d.ts +0 -1
  145. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js +0 -338
  146. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +0 -1
  147. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js +0 -2446
  148. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +0 -1
  149. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js +0 -506
  150. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +0 -1
  151. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js +0 -1296
  152. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +0 -1
  153. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js +0 -847
  154. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +0 -1
  155. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js +0 -215
  156. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  157. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +0 -99
  158. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +0 -1
  159. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +0 -133
  160. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +0 -1
  161. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +0 -1
  162. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +0 -1
  163. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +0 -1
  164. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +0 -1
  165. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +0 -1
  166. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +0 -1
  167. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +0 -1
  168. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +0 -1
  169. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +0 -1
  170. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +0 -1
  171. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +0 -1
  172. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +0 -1
  173. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +0 -1
  174. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.d.ts +0 -1
  175. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js +0 -48
  176. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +0 -1
  177. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +0 -1
  178. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +0 -1
  179. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.d.ts +0 -1
  180. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js +0 -44
  181. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +0 -1
  182. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.d.ts +0 -1
  183. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js +0 -221
  184. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +0 -1
  185. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.d.ts +0 -1
  186. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js +0 -60
  187. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +0 -1
  188. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.d.ts +0 -1
  189. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js +0 -80
  190. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +0 -1
  191. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.d.ts +0 -1
  192. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js +0 -44
  193. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +0 -1
  194. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.d.ts +0 -1
  195. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js +0 -330
  196. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +0 -1
  197. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.d.ts +0 -1
  198. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js +0 -60
  199. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +0 -1
  200. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.d.ts +0 -1
  201. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js +0 -80
  202. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +0 -1
  203. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.d.ts +0 -1
  204. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +0 -149
  205. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +0 -1
  206. package/lib/test/Integration/Services/CheckServiceTest.js.map +0 -1
  207. package/lib/test/Integration/Services/CreditServiceTest.js.map +0 -1
  208. package/lib/test/Integration/Services/DebitServiceTest.js.map +0 -1
  209. package/lib/test/Integration/Services/EBTServiceTest.js.map +0 -1
  210. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +0 -1
  211. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +0 -1
  212. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js +0 -34
  213. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  214. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +0 -1
@@ -1,174 +1,313 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const src_1 = require("../../../src/");
8
- const Data_1 = require("../../Data");
9
- const config = new src_1.PorticoConfig();
10
- config.secretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
11
- const service = new src_1.CreditService(config);
12
- const runSerially = false;
13
- const test = runSerially ? ava_1.default.serial : ava_1.default;
14
- const card = Data_1.TestCards.visaManual();
15
- test("auth capture", async (t) => {
16
- t.plan(4);
17
- const response = await service
18
- .authorize(10)
19
- .withCurrency("USD")
20
- .withPaymentMethod(card)
21
- .withAllowDuplicates(true)
22
- .execute();
23
- t.truthy(response);
24
- t.is(response.responseCode, "00");
25
- const capture = await service.capture(response.transactionId).execute();
26
- t.truthy(capture);
27
- t.is(capture.responseCode, "00");
28
- });
29
- test("sale", async (t) => {
30
- t.plan(2);
31
- const response = await service
32
- .charge(11.01)
33
- .withCurrency("USD")
34
- .withPaymentMethod(card)
35
- .withAllowDuplicates(true)
36
- .execute();
37
- t.truthy(response);
38
- t.is(response.responseCode, "00");
39
- });
40
- test("edit", async (t) => {
41
- t.plan(4);
42
- const response = await service
43
- .charge(12)
44
- .withCurrency("USD")
45
- .withPaymentMethod(card)
46
- .withAllowDuplicates(true)
47
- .execute();
48
- t.truthy(response);
49
- t.is(response.responseCode, "00");
50
- const edit = await service
51
- .edit(response.transactionId)
52
- .withAmount(14)
53
- .withGratuity(2)
54
- .execute();
55
- t.truthy(edit);
56
- t.is(edit.responseCode, "00");
57
- });
58
- test("commercial edit", async (t) => {
59
- t.plan(4);
60
- const response = await service
61
- .charge(13)
62
- .withCurrency("USD")
63
- .withPaymentMethod(card)
64
- .withCommercialRequest(true)
65
- .withAllowDuplicates(true)
66
- .execute();
67
- t.truthy(response);
68
- t.is(response.responseCode, "00");
69
- const edit = await service
70
- .edit(response.transactionId)
71
- .withTaxType(src_1.TaxType.SalesTax)
72
- .withTaxAmount(1)
73
- .execute();
74
- t.truthy(edit);
75
- t.is(edit.responseCode, "00");
76
- });
77
- test("refund by card", async (t) => {
78
- t.plan(4);
79
- const response = await service
80
- .charge(14)
81
- .withCurrency("USD")
82
- .withPaymentMethod(card)
83
- .withAllowDuplicates(true)
84
- .execute();
85
- t.truthy(response);
86
- t.is(response.responseCode, "00");
87
- const refund = await service
88
- .refund(14)
89
- .withCurrency("USD")
90
- .withPaymentMethod(card)
91
- .execute();
92
- t.truthy(refund);
93
- t.is(refund.responseCode, "00");
94
- });
95
- test("refund by transaction ID", async (t) => {
96
- t.plan(4);
97
- const response = await service
98
- .charge(15)
99
- .withCurrency("USD")
100
- .withPaymentMethod(card)
101
- .withAllowDuplicates(true)
102
- .execute();
103
- t.truthy(response);
104
- t.is(response.responseCode, "00");
105
- const refund = await service
106
- .refund(15)
107
- .withCurrency("USD")
108
- .withTransactionId(response.transactionId)
109
- .execute();
110
- t.truthy(refund);
111
- t.is(refund.responseCode, "00");
112
- });
113
- test("reverse by card", async (t) => {
114
- t.plan(4);
115
- const response = await service
116
- .charge(16)
117
- .withCurrency("USD")
118
- .withPaymentMethod(card)
119
- .withAllowDuplicates(true)
120
- .execute();
121
- t.truthy(response);
122
- t.is(response.responseCode, "00");
123
- const reverse = await service
124
- .reverse(16)
125
- .withCurrency("USD")
126
- .withPaymentMethod(card)
127
- .execute();
128
- t.truthy(reverse);
129
- t.is(reverse.responseCode, "00");
130
- });
131
- test("reverse by transaction ID", async (t) => {
132
- t.plan(4);
133
- const response = await service
134
- .charge(17)
135
- .withCurrency("USD")
136
- .withPaymentMethod(card)
137
- .withAllowDuplicates(true)
138
- .execute();
139
- t.truthy(response);
140
- t.is(response.responseCode, "00");
141
- const reverse = await service
142
- .reverse(17)
143
- .withCurrency("USD")
144
- .withTransactionId(response.transactionId)
145
- .execute();
146
- t.truthy(reverse);
147
- t.is(reverse.responseCode, "00");
148
- });
149
- test("verify", async (t) => {
150
- t.plan(2);
151
- const response = await service
152
- .verify()
153
- .withCurrency("USD")
154
- .withPaymentMethod(card)
155
- .execute();
156
- t.truthy(response);
157
- t.is(response.responseCode, "00");
158
- });
159
- test("reverse by client transaction ID", async (t) => {
160
- t.plan(4);
161
- const response = await service
162
- .charge(19)
163
- .withCurrency("USD")
164
- .withPaymentMethod(card)
165
- .withClientTransactionId("123456789")
166
- .withAllowDuplicates(true)
167
- .execute();
168
- t.truthy(response);
169
- t.is(response.responseCode, "00");
170
- const voidResponse = await service.void(response.transactionId).execute();
171
- t.truthy(voidResponse);
172
- t.is(voidResponse.responseCode, "00");
173
- });
174
- //# sourceMappingURL=CreditServiceTest.js.map
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var ava_1 = require("ava");
40
+ var src_1 = require("../../../src/");
41
+ var Data_1 = require("../../Data");
42
+ var config = new src_1.ServicesConfig();
43
+ config.secretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
44
+ config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
45
+ var service = new src_1.CreditService(config);
46
+ var runSerially = false;
47
+ var test = runSerially ? ava_1.default.serial : ava_1.default;
48
+ var card = Data_1.TestCards.visaManual();
49
+ test("auth capture", function (t) { return __awaiter(void 0, void 0, void 0, function () {
50
+ var response, capture;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ t.plan(4);
55
+ return [4 /*yield*/, service
56
+ .authorize(10)
57
+ .withCurrency("USD")
58
+ .withPaymentMethod(card)
59
+ .withAllowDuplicates(true)
60
+ .execute()];
61
+ case 1:
62
+ response = _a.sent();
63
+ t.truthy(response);
64
+ t.is(response.responseCode, "00");
65
+ return [4 /*yield*/, service.capture(response.transactionId).execute()];
66
+ case 2:
67
+ capture = _a.sent();
68
+ t.truthy(capture);
69
+ t.is(capture.responseCode, "00");
70
+ return [2 /*return*/];
71
+ }
72
+ });
73
+ }); });
74
+ test("sale", function (t) { return __awaiter(void 0, void 0, void 0, function () {
75
+ var response;
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0:
79
+ t.plan(2);
80
+ return [4 /*yield*/, service
81
+ .charge(11.01)
82
+ .withCurrency("USD")
83
+ .withPaymentMethod(card)
84
+ .withAllowDuplicates(true)
85
+ .execute()];
86
+ case 1:
87
+ response = _a.sent();
88
+ t.truthy(response);
89
+ t.is(response.responseCode, "00");
90
+ return [2 /*return*/];
91
+ }
92
+ });
93
+ }); });
94
+ test("edit", function (t) { return __awaiter(void 0, void 0, void 0, function () {
95
+ var response, edit;
96
+ return __generator(this, function (_a) {
97
+ switch (_a.label) {
98
+ case 0:
99
+ t.plan(4);
100
+ return [4 /*yield*/, service
101
+ .charge(12)
102
+ .withCurrency("USD")
103
+ .withPaymentMethod(card)
104
+ .withAllowDuplicates(true)
105
+ .execute()];
106
+ case 1:
107
+ response = _a.sent();
108
+ t.truthy(response);
109
+ t.is(response.responseCode, "00");
110
+ return [4 /*yield*/, service
111
+ .edit(response.transactionId)
112
+ .withAmount(14)
113
+ .withGratuity(2)
114
+ .execute()];
115
+ case 2:
116
+ edit = _a.sent();
117
+ t.truthy(edit);
118
+ t.is(edit.responseCode, "00");
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ }); });
123
+ test("commercial edit", function (t) { return __awaiter(void 0, void 0, void 0, function () {
124
+ var response, edit;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0:
128
+ t.plan(4);
129
+ return [4 /*yield*/, service
130
+ .charge(13)
131
+ .withCurrency("USD")
132
+ .withPaymentMethod(card)
133
+ .withCommercialRequest(true)
134
+ .withAllowDuplicates(true)
135
+ .execute()];
136
+ case 1:
137
+ response = _a.sent();
138
+ t.truthy(response);
139
+ t.is(response.responseCode, "00");
140
+ return [4 /*yield*/, service
141
+ .edit(response.transactionId)
142
+ .withTaxType(src_1.TaxType.SalesTax)
143
+ .withTaxAmount(1)
144
+ .execute()];
145
+ case 2:
146
+ edit = _a.sent();
147
+ t.truthy(edit);
148
+ t.is(edit.responseCode, "00");
149
+ return [2 /*return*/];
150
+ }
151
+ });
152
+ }); });
153
+ test("refund by card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
154
+ var response, refund;
155
+ return __generator(this, function (_a) {
156
+ switch (_a.label) {
157
+ case 0:
158
+ t.plan(4);
159
+ return [4 /*yield*/, service
160
+ .charge(14)
161
+ .withCurrency("USD")
162
+ .withPaymentMethod(card)
163
+ .withAllowDuplicates(true)
164
+ .execute()];
165
+ case 1:
166
+ response = _a.sent();
167
+ t.truthy(response);
168
+ t.is(response.responseCode, "00");
169
+ return [4 /*yield*/, service
170
+ .refund(14)
171
+ .withCurrency("USD")
172
+ .withPaymentMethod(card)
173
+ .execute()];
174
+ case 2:
175
+ refund = _a.sent();
176
+ t.truthy(refund);
177
+ t.is(refund.responseCode, "00");
178
+ return [2 /*return*/];
179
+ }
180
+ });
181
+ }); });
182
+ test("refund by transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
183
+ var response, refund;
184
+ return __generator(this, function (_a) {
185
+ switch (_a.label) {
186
+ case 0:
187
+ t.plan(4);
188
+ return [4 /*yield*/, service
189
+ .charge(15)
190
+ .withCurrency("USD")
191
+ .withPaymentMethod(card)
192
+ .withAllowDuplicates(true)
193
+ .execute()];
194
+ case 1:
195
+ response = _a.sent();
196
+ t.truthy(response);
197
+ t.is(response.responseCode, "00");
198
+ return [4 /*yield*/, service
199
+ .refund(15)
200
+ .withCurrency("USD")
201
+ .withTransactionId(response.transactionId)
202
+ .execute()];
203
+ case 2:
204
+ refund = _a.sent();
205
+ t.truthy(refund);
206
+ t.is(refund.responseCode, "00");
207
+ return [2 /*return*/];
208
+ }
209
+ });
210
+ }); });
211
+ test("reverse by card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
212
+ var response, reverse;
213
+ return __generator(this, function (_a) {
214
+ switch (_a.label) {
215
+ case 0:
216
+ t.plan(4);
217
+ return [4 /*yield*/, service
218
+ .charge(16)
219
+ .withCurrency("USD")
220
+ .withPaymentMethod(card)
221
+ .withAllowDuplicates(true)
222
+ .execute()];
223
+ case 1:
224
+ response = _a.sent();
225
+ t.truthy(response);
226
+ t.is(response.responseCode, "00");
227
+ return [4 /*yield*/, service
228
+ .reverse(16)
229
+ .withCurrency("USD")
230
+ .withPaymentMethod(card)
231
+ .execute()];
232
+ case 2:
233
+ reverse = _a.sent();
234
+ t.truthy(reverse);
235
+ t.is(reverse.responseCode, "00");
236
+ return [2 /*return*/];
237
+ }
238
+ });
239
+ }); });
240
+ test("reverse by transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
241
+ var response, reverse;
242
+ return __generator(this, function (_a) {
243
+ switch (_a.label) {
244
+ case 0:
245
+ t.plan(4);
246
+ return [4 /*yield*/, service
247
+ .charge(17)
248
+ .withCurrency("USD")
249
+ .withPaymentMethod(card)
250
+ .withAllowDuplicates(true)
251
+ .execute()];
252
+ case 1:
253
+ response = _a.sent();
254
+ t.truthy(response);
255
+ t.is(response.responseCode, "00");
256
+ return [4 /*yield*/, service
257
+ .reverse(17)
258
+ .withCurrency("USD")
259
+ .withTransactionId(response.transactionId)
260
+ .execute()];
261
+ case 2:
262
+ reverse = _a.sent();
263
+ t.truthy(reverse);
264
+ t.is(reverse.responseCode, "00");
265
+ return [2 /*return*/];
266
+ }
267
+ });
268
+ }); });
269
+ test("verify", function (t) { return __awaiter(void 0, void 0, void 0, function () {
270
+ var response;
271
+ return __generator(this, function (_a) {
272
+ switch (_a.label) {
273
+ case 0:
274
+ t.plan(2);
275
+ return [4 /*yield*/, service
276
+ .verify()
277
+ .withCurrency("USD")
278
+ .withPaymentMethod(card)
279
+ .execute()];
280
+ case 1:
281
+ response = _a.sent();
282
+ t.truthy(response);
283
+ t.is(response.responseCode, "00");
284
+ return [2 /*return*/];
285
+ }
286
+ });
287
+ }); });
288
+ test("reverse by client transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
289
+ var response, voidResponse;
290
+ return __generator(this, function (_a) {
291
+ switch (_a.label) {
292
+ case 0:
293
+ t.plan(4);
294
+ return [4 /*yield*/, service
295
+ .charge(19)
296
+ .withCurrency("USD")
297
+ .withPaymentMethod(card)
298
+ .withClientTransactionId("123456789")
299
+ .withAllowDuplicates(true)
300
+ .execute()];
301
+ case 1:
302
+ response = _a.sent();
303
+ t.truthy(response);
304
+ t.is(response.responseCode, "00");
305
+ return [4 /*yield*/, service.void(response.transactionId).execute()];
306
+ case 2:
307
+ voidResponse = _a.sent();
308
+ t.truthy(voidResponse);
309
+ t.is(voidResponse.responseCode, "00");
310
+ return [2 /*return*/];
311
+ }
312
+ });
313
+ }); });
@@ -1 +1 @@
1
- export {};
1
+ export {};