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,147 +1,377 @@
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_MaePAQBr-1QAqjfckFC8FTbRTT120bVQUlfVOjgCBw";
10
- const runSerially = false;
11
- const test = runSerially ? ava_1.default.serial : ava_1.default;
12
- const card = new src_1.GiftCard();
13
- card.number = "5022440000000000007";
14
- const track = new src_1.GiftCard();
15
- track.trackData =
16
- "%B5022440000000000098^^391200081613?;5022440000000000098=391200081613?";
17
- ava_1.default.before(() => {
18
- src_1.ServicesContainer.configureService(config);
19
- });
20
- test("gift create", async (t) => {
21
- t.plan(4);
22
- const newCard = await src_1.GiftCard.create("2145550199");
23
- t.truthy(newCard);
24
- t.truthy(newCard.number);
25
- t.truthy(newCard.alias);
26
- t.truthy(newCard.pin);
27
- });
28
- test("gift add alias", async (t) => {
29
- t.plan(2);
30
- const response = await card.addAlias("2145550199").execute();
31
- t.truthy(response);
32
- t.is(response.responseCode, "00", response.responseMessage);
33
- });
34
- test("gift add value", async (t) => {
35
- t.plan(2);
36
- const response = await card.addValue(10).withCurrency("USD").execute();
37
- t.truthy(response);
38
- t.is(response.responseCode, "00", response.responseMessage);
39
- });
40
- test("gift balance inquiry", async (t) => {
41
- t.plan(2);
42
- const response = await card.balanceInquiry().execute();
43
- t.truthy(response);
44
- t.is(response.responseCode, "00", response.responseMessage);
45
- });
46
- test("gift sale", async (t) => {
47
- t.plan(2);
48
- const response = await card.charge(10).withCurrency("USD").execute();
49
- t.truthy(response);
50
- t.is(response.responseCode, "00", response.responseMessage);
51
- });
52
- test("gift deactivate", async (t) => {
53
- t.plan(2);
54
- const response = await card.deactivate().execute();
55
- t.truthy(response);
56
- t.is(response.responseCode, "00", response.responseMessage);
57
- });
58
- test("gift remove alias", async (t) => {
59
- t.plan(2);
60
- const response = await card.removeAlias("2145550199").execute();
61
- t.truthy(response);
62
- t.is(response.responseCode, "00", response.responseMessage);
63
- });
64
- test("gift replace", async (t) => {
65
- t.plan(2);
66
- const response = await card.replaceWith(track).execute();
67
- t.truthy(response);
68
- t.is(response.responseCode, "00", response.responseMessage);
69
- });
70
- test("gift reverse", async (t) => {
71
- t.plan(2);
72
- const response = await card.reverse(10).execute();
73
- t.truthy(response);
74
- t.is(response.responseCode, "00", response.responseMessage);
75
- });
76
- test("gift rewards", async (t) => {
77
- t.plan(2);
78
- const response = await card.rewards(10).execute();
79
- t.truthy(response);
80
- t.is(response.responseCode, "00", response.responseMessage);
81
- });
82
- test("gift track add alias", async (t) => {
83
- t.plan(2);
84
- const response = await track.addAlias("2145550199").execute();
85
- t.truthy(response);
86
- t.is(response.responseCode, "00", response.responseMessage);
87
- });
88
- test("gift track add value", async (t) => {
89
- t.plan(2);
90
- const response = await track.addValue(10).withCurrency("USD").execute();
91
- t.truthy(response);
92
- t.is(response.responseCode, "00", response.responseMessage);
93
- });
94
- test("gift track balance inquiry", async (t) => {
95
- t.plan(2);
96
- const response = await track.balanceInquiry().execute();
97
- t.truthy(response);
98
- t.is(response.responseCode, "00", response.responseMessage);
99
- });
100
- test("gift track sale", async (t) => {
101
- t.plan(2);
102
- const response = await track.charge(10).withCurrency("USD").execute();
103
- t.truthy(response);
104
- t.is(response.responseCode, "00", response.responseMessage);
105
- });
106
- test("gift track deactivate", async (t) => {
107
- t.plan(2);
108
- const response = await track.deactivate().execute();
109
- t.truthy(response);
110
- t.is(response.responseCode, "00", response.responseMessage);
111
- });
112
- test("gift track remove alias", async (t) => {
113
- t.plan(2);
114
- const response = await track.removeAlias("2145550199").execute();
115
- t.truthy(response);
116
- t.is(response.responseCode, "00", response.responseMessage);
117
- });
118
- test("gift track replace", async (t) => {
119
- t.plan(2);
120
- const response = await track.replaceWith(track).execute();
121
- t.truthy(response);
122
- t.is(response.responseCode, "00", response.responseMessage);
123
- });
124
- test("gift track reverse", async (t) => {
125
- t.plan(2);
126
- const response = await track.reverse(10).execute();
127
- t.truthy(response);
128
- t.is(response.responseCode, "00", response.responseMessage);
129
- });
130
- test("gift track rewards", async (t) => {
131
- t.plan(2);
132
- const response = await track.rewards(10).execute();
133
- t.truthy(response);
134
- t.is(response.responseCode, "00", response.responseMessage);
135
- });
136
- test("gift reverse with transaction id", async (t) => {
137
- t.plan(4);
138
- const response = await card.charge(10).withCurrency("USD").execute();
139
- t.truthy(response);
140
- t.is(response.responseCode, "00", response.responseMessage);
141
- const reverseResponse = await src_1.Transaction.fromId(response.transactionId, src_1.PaymentMethodType.Gift)
142
- .reverse(10)
143
- .execute();
144
- t.truthy(reverseResponse);
145
- t.is(reverseResponse.responseCode, "00", reverseResponse.responseMessage);
146
- });
147
- //# sourceMappingURL=GiftTest.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 config = new src_1.ServicesConfig();
42
+ config.secretApiKey = "skapi_cert_MaePAQBr-1QAqjfckFC8FTbRTT120bVQUlfVOjgCBw";
43
+ config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
44
+ var runSerially = false;
45
+ var test = runSerially ? ava_1.default.serial : ava_1.default;
46
+ var card = new src_1.GiftCard();
47
+ card.number = "5022440000000000007";
48
+ var track = new src_1.GiftCard();
49
+ track.trackData =
50
+ "%B5022440000000000098^^391200081613?;5022440000000000098=391200081613?";
51
+ ava_1.default.before(function (_t) {
52
+ src_1.ServicesContainer.configure(config);
53
+ });
54
+ test("gift create", function (t) { return __awaiter(void 0, void 0, void 0, function () {
55
+ var newCard;
56
+ return __generator(this, function (_a) {
57
+ switch (_a.label) {
58
+ case 0:
59
+ t.plan(4);
60
+ return [4 /*yield*/, src_1.GiftCard.create("2145550199")];
61
+ case 1:
62
+ newCard = _a.sent();
63
+ t.truthy(newCard);
64
+ t.truthy(newCard.number);
65
+ t.truthy(newCard.alias);
66
+ t.truthy(newCard.pin);
67
+ return [2 /*return*/];
68
+ }
69
+ });
70
+ }); });
71
+ test("gift add alias", function (t) { return __awaiter(void 0, void 0, void 0, function () {
72
+ var response;
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0:
76
+ t.plan(2);
77
+ return [4 /*yield*/, card.addAlias("2145550199").execute()];
78
+ case 1:
79
+ response = _a.sent();
80
+ t.truthy(response);
81
+ t.is(response.responseCode, "00", response.responseMessage);
82
+ return [2 /*return*/];
83
+ }
84
+ });
85
+ }); });
86
+ test("gift add value", function (t) { return __awaiter(void 0, void 0, void 0, function () {
87
+ var response;
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0:
91
+ t.plan(2);
92
+ return [4 /*yield*/, card
93
+ .addValue(10)
94
+ .withCurrency("USD")
95
+ .execute()];
96
+ case 1:
97
+ response = _a.sent();
98
+ t.truthy(response);
99
+ t.is(response.responseCode, "00", response.responseMessage);
100
+ return [2 /*return*/];
101
+ }
102
+ });
103
+ }); });
104
+ test("gift balance inquiry", function (t) { return __awaiter(void 0, void 0, void 0, function () {
105
+ var response;
106
+ return __generator(this, function (_a) {
107
+ switch (_a.label) {
108
+ case 0:
109
+ t.plan(2);
110
+ return [4 /*yield*/, card.balanceInquiry().execute()];
111
+ case 1:
112
+ response = _a.sent();
113
+ t.truthy(response);
114
+ t.is(response.responseCode, "00", response.responseMessage);
115
+ return [2 /*return*/];
116
+ }
117
+ });
118
+ }); });
119
+ test("gift sale", function (t) { return __awaiter(void 0, void 0, void 0, function () {
120
+ var response;
121
+ return __generator(this, function (_a) {
122
+ switch (_a.label) {
123
+ case 0:
124
+ t.plan(2);
125
+ return [4 /*yield*/, card
126
+ .charge(10)
127
+ .withCurrency("USD")
128
+ .execute()];
129
+ case 1:
130
+ response = _a.sent();
131
+ t.truthy(response);
132
+ t.is(response.responseCode, "00", response.responseMessage);
133
+ return [2 /*return*/];
134
+ }
135
+ });
136
+ }); });
137
+ test("gift deactivate", function (t) { return __awaiter(void 0, void 0, void 0, function () {
138
+ var response;
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0:
142
+ t.plan(2);
143
+ return [4 /*yield*/, card.deactivate().execute()];
144
+ case 1:
145
+ response = _a.sent();
146
+ t.truthy(response);
147
+ t.is(response.responseCode, "00", response.responseMessage);
148
+ return [2 /*return*/];
149
+ }
150
+ });
151
+ }); });
152
+ test("gift remove alias", function (t) { return __awaiter(void 0, void 0, void 0, function () {
153
+ var response;
154
+ return __generator(this, function (_a) {
155
+ switch (_a.label) {
156
+ case 0:
157
+ t.plan(2);
158
+ return [4 /*yield*/, card.removeAlias("2145550199").execute()];
159
+ case 1:
160
+ response = _a.sent();
161
+ t.truthy(response);
162
+ t.is(response.responseCode, "00", response.responseMessage);
163
+ return [2 /*return*/];
164
+ }
165
+ });
166
+ }); });
167
+ test("gift replace", function (t) { return __awaiter(void 0, void 0, void 0, function () {
168
+ var response;
169
+ return __generator(this, function (_a) {
170
+ switch (_a.label) {
171
+ case 0:
172
+ t.plan(2);
173
+ return [4 /*yield*/, card.replaceWith(track).execute()];
174
+ case 1:
175
+ response = _a.sent();
176
+ t.truthy(response);
177
+ t.is(response.responseCode, "00", response.responseMessage);
178
+ return [2 /*return*/];
179
+ }
180
+ });
181
+ }); });
182
+ test("gift reverse", function (t) { return __awaiter(void 0, void 0, void 0, function () {
183
+ var response;
184
+ return __generator(this, function (_a) {
185
+ switch (_a.label) {
186
+ case 0:
187
+ t.plan(2);
188
+ return [4 /*yield*/, card.reverse(10).execute()];
189
+ case 1:
190
+ response = _a.sent();
191
+ t.truthy(response);
192
+ t.is(response.responseCode, "00", response.responseMessage);
193
+ return [2 /*return*/];
194
+ }
195
+ });
196
+ }); });
197
+ test("gift rewards", function (t) { return __awaiter(void 0, void 0, void 0, function () {
198
+ var response;
199
+ return __generator(this, function (_a) {
200
+ switch (_a.label) {
201
+ case 0:
202
+ t.plan(2);
203
+ return [4 /*yield*/, card.rewards(10).execute()];
204
+ case 1:
205
+ response = _a.sent();
206
+ t.truthy(response);
207
+ t.is(response.responseCode, "00", response.responseMessage);
208
+ return [2 /*return*/];
209
+ }
210
+ });
211
+ }); });
212
+ test("gift track add alias", function (t) { return __awaiter(void 0, void 0, void 0, function () {
213
+ var response;
214
+ return __generator(this, function (_a) {
215
+ switch (_a.label) {
216
+ case 0:
217
+ t.plan(2);
218
+ return [4 /*yield*/, track.addAlias("2145550199").execute()];
219
+ case 1:
220
+ response = _a.sent();
221
+ t.truthy(response);
222
+ t.is(response.responseCode, "00", response.responseMessage);
223
+ return [2 /*return*/];
224
+ }
225
+ });
226
+ }); });
227
+ test("gift track add value", function (t) { return __awaiter(void 0, void 0, void 0, function () {
228
+ var response;
229
+ return __generator(this, function (_a) {
230
+ switch (_a.label) {
231
+ case 0:
232
+ t.plan(2);
233
+ return [4 /*yield*/, track
234
+ .addValue(10)
235
+ .withCurrency("USD")
236
+ .execute()];
237
+ case 1:
238
+ response = _a.sent();
239
+ t.truthy(response);
240
+ t.is(response.responseCode, "00", response.responseMessage);
241
+ return [2 /*return*/];
242
+ }
243
+ });
244
+ }); });
245
+ test("gift track balance inquiry", function (t) { return __awaiter(void 0, void 0, void 0, function () {
246
+ var response;
247
+ return __generator(this, function (_a) {
248
+ switch (_a.label) {
249
+ case 0:
250
+ t.plan(2);
251
+ return [4 /*yield*/, track.balanceInquiry().execute()];
252
+ case 1:
253
+ response = _a.sent();
254
+ t.truthy(response);
255
+ t.is(response.responseCode, "00", response.responseMessage);
256
+ return [2 /*return*/];
257
+ }
258
+ });
259
+ }); });
260
+ test("gift track sale", function (t) { return __awaiter(void 0, void 0, void 0, function () {
261
+ var response;
262
+ return __generator(this, function (_a) {
263
+ switch (_a.label) {
264
+ case 0:
265
+ t.plan(2);
266
+ return [4 /*yield*/, track
267
+ .charge(10)
268
+ .withCurrency("USD")
269
+ .execute()];
270
+ case 1:
271
+ response = _a.sent();
272
+ t.truthy(response);
273
+ t.is(response.responseCode, "00", response.responseMessage);
274
+ return [2 /*return*/];
275
+ }
276
+ });
277
+ }); });
278
+ test("gift track deactivate", function (t) { return __awaiter(void 0, void 0, void 0, function () {
279
+ var response;
280
+ return __generator(this, function (_a) {
281
+ switch (_a.label) {
282
+ case 0:
283
+ t.plan(2);
284
+ return [4 /*yield*/, track.deactivate().execute()];
285
+ case 1:
286
+ response = _a.sent();
287
+ t.truthy(response);
288
+ t.is(response.responseCode, "00", response.responseMessage);
289
+ return [2 /*return*/];
290
+ }
291
+ });
292
+ }); });
293
+ test("gift track remove alias", function (t) { return __awaiter(void 0, void 0, void 0, function () {
294
+ var response;
295
+ return __generator(this, function (_a) {
296
+ switch (_a.label) {
297
+ case 0:
298
+ t.plan(2);
299
+ return [4 /*yield*/, track.removeAlias("2145550199").execute()];
300
+ case 1:
301
+ response = _a.sent();
302
+ t.truthy(response);
303
+ t.is(response.responseCode, "00", response.responseMessage);
304
+ return [2 /*return*/];
305
+ }
306
+ });
307
+ }); });
308
+ test("gift track replace", function (t) { return __awaiter(void 0, void 0, void 0, function () {
309
+ var response;
310
+ return __generator(this, function (_a) {
311
+ switch (_a.label) {
312
+ case 0:
313
+ t.plan(2);
314
+ return [4 /*yield*/, track.replaceWith(track).execute()];
315
+ case 1:
316
+ response = _a.sent();
317
+ t.truthy(response);
318
+ t.is(response.responseCode, "00", response.responseMessage);
319
+ return [2 /*return*/];
320
+ }
321
+ });
322
+ }); });
323
+ test("gift track reverse", function (t) { return __awaiter(void 0, void 0, void 0, function () {
324
+ var response;
325
+ return __generator(this, function (_a) {
326
+ switch (_a.label) {
327
+ case 0:
328
+ t.plan(2);
329
+ return [4 /*yield*/, track.reverse(10).execute()];
330
+ case 1:
331
+ response = _a.sent();
332
+ t.truthy(response);
333
+ t.is(response.responseCode, "00", response.responseMessage);
334
+ return [2 /*return*/];
335
+ }
336
+ });
337
+ }); });
338
+ test("gift track rewards", function (t) { return __awaiter(void 0, void 0, void 0, function () {
339
+ var response;
340
+ return __generator(this, function (_a) {
341
+ switch (_a.label) {
342
+ case 0:
343
+ t.plan(2);
344
+ return [4 /*yield*/, track.rewards(10).execute()];
345
+ case 1:
346
+ response = _a.sent();
347
+ t.truthy(response);
348
+ t.is(response.responseCode, "00", response.responseMessage);
349
+ return [2 /*return*/];
350
+ }
351
+ });
352
+ }); });
353
+ test("gift reverse with transaction id", function (t) { return __awaiter(void 0, void 0, void 0, function () {
354
+ var response, reverseResponse;
355
+ return __generator(this, function (_a) {
356
+ switch (_a.label) {
357
+ case 0:
358
+ t.plan(4);
359
+ return [4 /*yield*/, card
360
+ .charge(10)
361
+ .withCurrency("USD")
362
+ .execute()];
363
+ case 1:
364
+ response = _a.sent();
365
+ t.truthy(response);
366
+ t.is(response.responseCode, "00", response.responseMessage);
367
+ return [4 /*yield*/, src_1.Transaction.fromId(response.transactionId, src_1.PaymentMethodType.Gift)
368
+ .reverse(10)
369
+ .execute()];
370
+ case 2:
371
+ reverseResponse = _a.sent();
372
+ t.truthy(reverseResponse);
373
+ t.is(reverseResponse.responseCode, "00", reverseResponse.responseMessage);
374
+ return [2 /*return*/];
375
+ }
376
+ });
377
+ }); });
@@ -1 +1 @@
1
- export {};
1
+ export {};