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,101 +1,196 @@
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 timeForId = new Date().getTime();
9
- (0, ava_1.default)("allow 5-part credentials", (t) => {
10
- const c = new src_1.PorticoConfig();
11
- c.username = "123456789";
12
- c.password = "$Test1234";
13
- c.siteId = "12345";
14
- c.deviceId = "123456";
15
- c.licenseId = "12345";
16
- src_1.ServicesContainer.configureService(c);
17
- t.truthy(true);
18
- });
19
- (0, ava_1.default)("make PayPlan customer", async (t) => {
20
- t.plan(1);
21
- handleAuth();
22
- const customer = new src_1.Customer();
23
- customer.id = "Customer" + timeForId;
24
- customer.firstName = "John";
25
- customer.lastName = "Doe";
26
- customer.status = "Active";
27
- customer.email = "john.doe@email.com";
28
- customer.address = new src_1.Address();
29
- customer.address.streetAddress1 = "123 Main St.";
30
- customer.address.city = "Dallas";
31
- customer.address.state = "TX";
32
- customer.address.postalCode = "98765";
33
- customer.address.country = "USA";
34
- customer.workPhone = "5551112222";
35
- const createdCustomer = await customer.create();
36
- t.truthy(createdCustomer);
37
- });
38
- (0, ava_1.default)("attach CC payment method to customer", async (t) => {
39
- t.plan(2);
40
- handleAuth();
41
- const foundCustomer = (await src_1.Customer.find("Customer" + timeForId));
42
- t.truthy(foundCustomer);
43
- const card = new src_1.CreditCardData();
44
- card.number = "4111111111111111";
45
- card.expMonth = "12";
46
- card.expYear = "2025";
47
- card.cvn = "123";
48
- const ccPaymentMethod = await foundCustomer
49
- .addPaymentMethod("Payment" + timeForId, card)
50
- .create();
51
- t.truthy(ccPaymentMethod);
52
- });
53
- (0, ava_1.default)("attach payment schedule to customer", async (t) => {
54
- t.plan(2);
55
- handleAuth();
56
- const foundCcPaymentMethod = (await src_1.RecurringPaymentMethod.find("Payment" + timeForId));
57
- t.truthy(foundCcPaymentMethod);
58
- const paymentSchedule = await foundCcPaymentMethod
59
- .addSchedule("Schedule" + timeForId)
60
- .withStartDate(new Date(2027, 1, 1))
61
- .withAmount(30.01)
62
- .withFrequency(src_1.ScheduleFrequency.Weekly)
63
- .withReprocessingCount(1)
64
- .withStatus("Active")
65
- .withEmailReceipt(src_1.EmailReceipt.Never)
66
- .create("auth");
67
- t.truthy(paymentSchedule);
68
- });
69
- (0, ava_1.default)("edit/deactivate the schedule from above test", async (t) => {
70
- t.plan(2);
71
- handleAuth();
72
- const foundSchedule = (await src_1.Schedule.find("Schedule" + timeForId));
73
- t.truthy(foundSchedule);
74
- foundSchedule.status = "Inactive";
75
- t.truthy(foundSchedule.saveChanges("auth"));
76
- });
77
- (0, ava_1.default)("find and charge payment method", async (t) => {
78
- t.plan(1);
79
- handleAuth();
80
- const foundCcPaymentMethod = (await src_1.RecurringPaymentMethod.find("Payment" + timeForId));
81
- const chargeResponse = await foundCcPaymentMethod
82
- .charge(12.34)
83
- .withCurrency("USD")
84
- .execute("auth");
85
- t.true(chargeResponse.responseCode == "00");
86
- });
87
- (0, ava_1.default)("find transactions from this new payment method", async (t) => {
88
- t.plan(1);
89
- handleAuth();
90
- const foundCcPaymentMethod = (await src_1.RecurringPaymentMethod.find("Payment" + timeForId));
91
- const foundTransactions = await src_1.ReportingService.findTransactions()
92
- .where("PaymentMethodKey", foundCcPaymentMethod.key)
93
- .execute("auth");
94
- t.true(foundTransactions.length === 2); // one transaction was the CreditAccountVerify from creating the payment method
95
- });
96
- function handleAuth() {
97
- const config = new src_1.PorticoConfig();
98
- config.secretApiKey = "skapi_cert_MXvdAQB61V4AkyM-x3EJuY6hkEaCzaMimTWav7mVfQ";
99
- src_1.ServicesContainer.configureService(config, "auth");
100
- }
101
- //# sourceMappingURL=RecurringTest.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 timeForId = new Date().getTime();
42
+ ava_1.default("allow 5-part credentials", function (t) {
43
+ var c = new src_1.ServicesConfig();
44
+ c.username = "123456789";
45
+ c.password = "$Test1234";
46
+ c.siteId = "12345";
47
+ c.deviceId = "123456";
48
+ c.licenseId = "12345";
49
+ c.serviceUrl = "https://cert.api2-c.heartlandportico.com";
50
+ src_1.ServicesContainer.configure(c);
51
+ t.truthy(true);
52
+ });
53
+ ava_1.default("make PayPlan customer", function (t) { return __awaiter(void 0, void 0, void 0, function () {
54
+ var customer, createdCustomer;
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0:
58
+ t.plan(1);
59
+ handleAuth();
60
+ customer = new src_1.Customer();
61
+ customer.id = "Customer" + timeForId;
62
+ customer.firstName = "John";
63
+ customer.lastName = "Doe";
64
+ customer.status = "Active";
65
+ customer.email = "john.doe@email.com";
66
+ customer.address = new src_1.Address();
67
+ customer.address.streetAddress1 = "123 Main St.";
68
+ customer.address.city = "Dallas";
69
+ customer.address.state = "TX";
70
+ customer.address.postalCode = "98765";
71
+ customer.address.country = "USA";
72
+ customer.workPhone = "5551112222";
73
+ return [4 /*yield*/, customer.create()];
74
+ case 1:
75
+ createdCustomer = _a.sent();
76
+ t.truthy(createdCustomer);
77
+ return [2 /*return*/];
78
+ }
79
+ });
80
+ }); });
81
+ ava_1.default("attach CC payment method to customer", function (t) { return __awaiter(void 0, void 0, void 0, function () {
82
+ var foundCustomer, card, ccPaymentMethod;
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
85
+ case 0:
86
+ t.plan(2);
87
+ handleAuth();
88
+ return [4 /*yield*/, src_1.Customer.find("Customer" + timeForId)];
89
+ case 1:
90
+ foundCustomer = _a.sent();
91
+ t.truthy(foundCustomer);
92
+ card = new src_1.CreditCardData();
93
+ card.number = "4111111111111111";
94
+ card.expMonth = "12";
95
+ card.expYear = "2025";
96
+ card.cvn = "123";
97
+ return [4 /*yield*/, foundCustomer
98
+ .addPaymentMethod("Payment" + timeForId, card)
99
+ .create()];
100
+ case 2:
101
+ ccPaymentMethod = _a.sent();
102
+ t.truthy(ccPaymentMethod);
103
+ return [2 /*return*/];
104
+ }
105
+ });
106
+ }); });
107
+ ava_1.default("attach payment schedule to customer", function (t) { return __awaiter(void 0, void 0, void 0, function () {
108
+ var foundCcPaymentMethod, paymentSchedule;
109
+ return __generator(this, function (_a) {
110
+ switch (_a.label) {
111
+ case 0:
112
+ t.plan(2);
113
+ handleAuth();
114
+ return [4 /*yield*/, src_1.RecurringPaymentMethod.find("Payment" + timeForId)];
115
+ case 1:
116
+ foundCcPaymentMethod = _a.sent();
117
+ t.truthy(foundCcPaymentMethod);
118
+ return [4 /*yield*/, foundCcPaymentMethod
119
+ .addSchedule("Schedule" + timeForId)
120
+ .withStartDate(new Date(2027, 1, 1))
121
+ .withAmount(30.01)
122
+ .withFrequency(src_1.ScheduleFrequency.Weekly)
123
+ .withReprocessingCount(1)
124
+ .withStatus("Active")
125
+ .withEmailReceipt(src_1.EmailReceipt.Never)
126
+ .create()];
127
+ case 2:
128
+ paymentSchedule = _a.sent();
129
+ t.truthy(paymentSchedule);
130
+ return [2 /*return*/];
131
+ }
132
+ });
133
+ }); });
134
+ ava_1.default("edit/deactivate the schedule from above test", function (t) { return __awaiter(void 0, void 0, void 0, function () {
135
+ var foundSchedule;
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0:
139
+ t.plan(2);
140
+ handleAuth();
141
+ return [4 /*yield*/, src_1.Schedule.find("Schedule" + timeForId)];
142
+ case 1:
143
+ foundSchedule = _a.sent();
144
+ t.truthy(foundSchedule);
145
+ foundSchedule.status = "Inactive";
146
+ t.truthy(foundSchedule.saveChanges());
147
+ return [2 /*return*/];
148
+ }
149
+ });
150
+ }); });
151
+ ava_1.default("find and charge payment method", function (t) { return __awaiter(void 0, void 0, void 0, function () {
152
+ var foundCcPaymentMethod, chargeResponse;
153
+ return __generator(this, function (_a) {
154
+ switch (_a.label) {
155
+ case 0:
156
+ t.plan(1);
157
+ handleAuth();
158
+ return [4 /*yield*/, src_1.RecurringPaymentMethod.find("Payment" + timeForId)];
159
+ case 1:
160
+ foundCcPaymentMethod = _a.sent();
161
+ return [4 /*yield*/, foundCcPaymentMethod.charge(12.34)
162
+ .withCurrency("USD")
163
+ .execute()];
164
+ case 2:
165
+ chargeResponse = _a.sent();
166
+ t.true(chargeResponse.responseCode == '00');
167
+ return [2 /*return*/];
168
+ }
169
+ });
170
+ }); });
171
+ ava_1.default("find transactions from this new payment method", function (t) { return __awaiter(void 0, void 0, void 0, function () {
172
+ var foundCcPaymentMethod, foundTransactions;
173
+ return __generator(this, function (_a) {
174
+ switch (_a.label) {
175
+ case 0:
176
+ t.plan(1);
177
+ handleAuth();
178
+ return [4 /*yield*/, src_1.RecurringPaymentMethod.find("Payment" + timeForId)];
179
+ case 1:
180
+ foundCcPaymentMethod = _a.sent();
181
+ return [4 /*yield*/, src_1.ReportingService.findTransactions()
182
+ .where("PaymentMethodKey", foundCcPaymentMethod.key)
183
+ .execute()];
184
+ case 2:
185
+ foundTransactions = _a.sent();
186
+ t.true(foundTransactions.length === 2); // one transaction was the CreditAccountVerify from creating the payment method
187
+ return [2 /*return*/];
188
+ }
189
+ });
190
+ }); });
191
+ function handleAuth() {
192
+ var config = new src_1.ServicesConfig();
193
+ config.secretApiKey = "skapi_cert_MXvdAQB61V4AkyM-x3EJuY6hkEaCzaMimTWav7mVfQ";
194
+ config.serviceUrl = "https://cert.api2.heartlandportico.com";
195
+ src_1.ServicesContainer.configure(config);
196
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,50 +1,53 @@
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 config = new src_1.PorticoConfig();
9
- config.secretApiKey = "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w";
10
- ava_1.default.before(() => {
11
- src_1.ServicesContainer.configureService(config);
12
- });
13
- (0, ava_1.default)("report activity", (t) => {
14
- t.plan(2);
15
- const start = new Date(Date.now());
16
- start.setDate(start.getDate() - 7);
17
- const end = new Date(Date.now());
18
- return src_1.ReportingService.activity()
19
- .withStartDate(start)
20
- .withEndDate(end)
21
- .execute()
22
- .then((activity) => {
23
- t.truthy(activity);
24
- t.true(activity.length > 0);
25
- });
26
- });
27
- (0, ava_1.default)("report transaction detail", (t) => {
28
- t.plan(3);
29
- const start = new Date(Date.now());
30
- start.setDate(start.getDate() - 7);
31
- const end = new Date(Date.now());
32
- return src_1.ReportingService.activity()
33
- .withStartDate(start)
34
- .withEndDate(end)
35
- .execute()
36
- .then((activity) => {
37
- t.truthy(activity);
38
- if (activity.length > 0) {
39
- return src_1.ReportingService.transactionDetail(activity[0].transactionId)
40
- .execute()
41
- .then((detail) => {
42
- t.truthy(detail);
43
- t.is(detail.gatewayResponseCode, "00");
44
- });
45
- }
46
- t.plan(1);
47
- return Promise.resolve();
48
- });
49
- });
50
- //# sourceMappingURL=ReportingTest.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var ava_1 = require("ava");
4
+ var src_1 = require("../../../../src/");
5
+ var config = new src_1.ServicesConfig();
6
+ config.secretApiKey = "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w";
7
+ config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
8
+ ava_1.default.before(function (_t) {
9
+ src_1.ServicesContainer.configure(config);
10
+ });
11
+ ava_1.default("report activity", function (t) {
12
+ t.plan(2);
13
+ var start = new Date(Date.now());
14
+ start.setDate(start.getDate() - 7);
15
+ var end = new Date(Date.now());
16
+ return src_1.ReportingService.activity()
17
+ .withStartDate(start)
18
+ .withEndDate(end)
19
+ .execute()
20
+ .then(function (activity) {
21
+ t.truthy(activity);
22
+ t.true(activity.length > 0);
23
+ });
24
+ });
25
+ ava_1.default("report transaction detail", function (t) {
26
+ t.plan(3);
27
+ var start = new Date(Date.now());
28
+ start.setDate(start.getDate() - 7);
29
+ var end = new Date(Date.now());
30
+ return src_1.ReportingService.activity()
31
+ .withStartDate(start)
32
+ .withEndDate(end)
33
+ .execute()
34
+ .then(function (activity) {
35
+ t.truthy(activity);
36
+ if (activity.length > 0) {
37
+ return src_1.ReportingService.transactionDetail(activity[0].transactionId)
38
+ .execute()
39
+ .then(function (detail) {
40
+ t.truthy(detail);
41
+ t.is(detail.gatewayResponseCode, "00");
42
+ });
43
+ }
44
+ t.plan(1);
45
+ return Promise.resolve();
46
+ });
47
+ });
48
+ ava_1.default.only("report transaction detail with transactionID", function (t) {
49
+ var response = src_1.ReportingService.transactionDetail()
50
+ .withTransactionId("1913135619")
51
+ .execute();
52
+ t.truthy(response);
53
+ });
@@ -0,0 +1,100 @@
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 PayFacService_1 = require("../../../../../src/Services/PayFacService");
41
+ var src_1 = require("../../../../../src/");
42
+ var config = new src_1.ServicesConfig();
43
+ config.serviceUrl = "https://xmltest.propay.com/API/PropayAPI.aspx";
44
+ config.certificationStr = "d17d770d4734341aaedab32b7a7763";
45
+ config.terminalID = "7a7763";
46
+ var _service = new PayFacService_1.PayFacService();
47
+ ava_1.default.before(function (_t) {
48
+ src_1.ServicesContainer.configure(config);
49
+ });
50
+ ava_1.default("get account info", function (t) { return __awaiter(void 0, void 0, void 0, function () {
51
+ var response;
52
+ return __generator(this, function (_a) {
53
+ switch (_a.label) {
54
+ case 0:
55
+ t.plan(2);
56
+ return [4 /*yield*/, _service.getAccountDetails()
57
+ .withAccountNumber("718570752")
58
+ .execute()];
59
+ case 1:
60
+ response = _a.sent();
61
+ t.truthy(response);
62
+ t.is("00", response.responseCode);
63
+ return [2 /*return*/];
64
+ }
65
+ });
66
+ }); });
67
+ ava_1.default("get account balance", function (t) { return __awaiter(void 0, void 0, void 0, function () {
68
+ var response;
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ t.plan(2);
73
+ return [4 /*yield*/, _service.getAccountBalance()
74
+ .withAccountNumber("718570752")
75
+ .execute()];
76
+ case 1:
77
+ response = _a.sent();
78
+ t.truthy(response);
79
+ t.is("00", response.responseCode);
80
+ return [2 /*return*/];
81
+ }
82
+ });
83
+ }); });
84
+ ava_1.default("get account info enchance", function (t) { return __awaiter(void 0, void 0, void 0, function () {
85
+ var response;
86
+ return __generator(this, function (_a) {
87
+ switch (_a.label) {
88
+ case 0:
89
+ t.plan(2);
90
+ return [4 /*yield*/, _service.getAccountDetailsEnhanced()
91
+ .withAccountNumber("718570752")
92
+ .execute()];
93
+ case 1:
94
+ response = _a.sent();
95
+ t.truthy(response);
96
+ t.is("00", response.responseCode);
97
+ return [2 /*return*/];
98
+ }
99
+ });
100
+ }); });