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
@@ -0,0 +1,1703 @@
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 throttle = function () { return new Promise(function (resolve) { return setTimeout(resolve, 1500); }); };
42
+ ava_1.default.beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
43
+ return __generator(this, function (_a) {
44
+ switch (_a.label) {
45
+ case 0: return [4 /*yield*/, throttle()];
46
+ case 1:
47
+ _a.sent();
48
+ return [2 /*return*/];
49
+ }
50
+ });
51
+ }); });
52
+ ava_1.default("JAVA_Release_Sample", function (t) { return __awaiter(void 0, void 0, void 0, function () {
53
+ var config, card, saleResponse, holdResponse, response;
54
+ return __generator(this, function (_a) {
55
+ switch (_a.label) {
56
+ case 0:
57
+ t.plan(2);
58
+ config = new src_1.ServicesConfig();
59
+ config.merchantId = "heartlandgpsandbox";
60
+ config.accountId = "api";
61
+ config.sharedSecret = "secret";
62
+ config.refundPassword = "refund";
63
+ config.rebatePassword = "rebate";
64
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
65
+ config.timeout = 5000;
66
+ config.channel = "ECOM";
67
+ src_1.ServicesContainer.configure(config);
68
+ card = new src_1.CreditCardData();
69
+ card.number = "4263970000005262";
70
+ card.expMonth = "12";
71
+ card.expYear = "2020";
72
+ card.cvn = "123";
73
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
74
+ card.cardHolderName = "James Mason";
75
+ return [4 /*yield*/, card
76
+ .charge(10)
77
+ .withCurrency("EUR")
78
+ .execute()];
79
+ case 1:
80
+ saleResponse = _a.sent();
81
+ t.truthy(saleResponse);
82
+ t.is("00", saleResponse.responseCode);
83
+ return [4 /*yield*/, throttle()];
84
+ case 2:
85
+ _a.sent();
86
+ return [4 /*yield*/, saleResponse
87
+ .hold()
88
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
89
+ .execute()];
90
+ case 3:
91
+ holdResponse = _a.sent();
92
+ t.truthy(holdResponse);
93
+ t.is("00", holdResponse.responseCode);
94
+ return [4 /*yield*/, throttle()];
95
+ case 4:
96
+ _a.sent();
97
+ return [4 /*yield*/, saleResponse
98
+ .release()
99
+ .withReasonCode(src_1.ReasonCode.InStock)
100
+ .withDescription("JAVA-Hold")
101
+ .execute()];
102
+ case 5:
103
+ response = _a.sent();
104
+ t.truthy(response);
105
+ t.is("00", response.responseCode);
106
+ return [2 /*return*/];
107
+ }
108
+ });
109
+ }); });
110
+ ava_1.default("JAVA_Release_006a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
111
+ var config, card, saleResponse, holdResponse, response;
112
+ return __generator(this, function (_a) {
113
+ switch (_a.label) {
114
+ case 0:
115
+ t.plan(2);
116
+ config = new src_1.ServicesConfig();
117
+ config.merchantId = "heartlandgpsandbox";
118
+ config.accountId = "api";
119
+ config.sharedSecret = "secret";
120
+ config.refundPassword = "refund";
121
+ config.rebatePassword = "rebate";
122
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
123
+ config.timeout = 5000;
124
+ config.channel = "ECOM";
125
+ src_1.ServicesContainer.configure(config);
126
+ card = new src_1.CreditCardData();
127
+ card.number = "4263970000005262";
128
+ card.expMonth = "12";
129
+ card.expYear = "2020";
130
+ card.cvn = "123";
131
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
132
+ card.cardHolderName = "James Mason";
133
+ return [4 /*yield*/, card
134
+ .charge(10)
135
+ .withCurrency("EUR")
136
+ .execute()];
137
+ case 1:
138
+ saleResponse = _a.sent();
139
+ t.truthy(saleResponse);
140
+ t.is("00", saleResponse.responseCode);
141
+ return [4 /*yield*/, throttle()];
142
+ case 2:
143
+ _a.sent();
144
+ return [4 /*yield*/, saleResponse
145
+ .hold()
146
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
147
+ .execute()];
148
+ case 3:
149
+ holdResponse = _a.sent();
150
+ t.truthy(holdResponse);
151
+ t.is("00", holdResponse.responseCode);
152
+ return [4 /*yield*/, throttle()];
153
+ case 4:
154
+ _a.sent();
155
+ return [4 /*yield*/, saleResponse
156
+ .release()
157
+ .withReasonCode(src_1.ReasonCode.InStock)
158
+ .withDescription("JAVA-Hold")
159
+ .execute()];
160
+ case 5:
161
+ response = _a.sent();
162
+ t.truthy(response);
163
+ t.is("00", response.responseCode);
164
+ return [2 /*return*/];
165
+ }
166
+ });
167
+ }); });
168
+ ava_1.default("JAVA_Release_006b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
169
+ var config, card, saleResponse, holdResponse, response;
170
+ return __generator(this, function (_a) {
171
+ switch (_a.label) {
172
+ case 0:
173
+ t.plan(2);
174
+ config = new src_1.ServicesConfig();
175
+ config.merchantId = "heartlandgpsandbox";
176
+ config.accountId = "api";
177
+ config.sharedSecret = "secret";
178
+ config.refundPassword = "refund";
179
+ config.rebatePassword = "rebate";
180
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
181
+ config.timeout = 5000;
182
+ config.channel = "ECOM";
183
+ src_1.ServicesContainer.configure(config);
184
+ card = new src_1.CreditCardData();
185
+ card.number = "4263970000005262";
186
+ card.expMonth = "12";
187
+ card.expYear = "2020";
188
+ card.cvn = "123";
189
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
190
+ card.cardHolderName = "James Mason";
191
+ return [4 /*yield*/, card
192
+ .charge(10)
193
+ .withCurrency("EUR")
194
+ .execute()];
195
+ case 1:
196
+ saleResponse = _a.sent();
197
+ t.truthy(saleResponse);
198
+ t.is("00", saleResponse.responseCode);
199
+ return [4 /*yield*/, throttle()];
200
+ case 2:
201
+ _a.sent();
202
+ return [4 /*yield*/, saleResponse
203
+ .hold()
204
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
205
+ .execute()];
206
+ case 3:
207
+ holdResponse = _a.sent();
208
+ t.truthy(holdResponse);
209
+ t.is("00", holdResponse.responseCode);
210
+ return [4 /*yield*/, throttle()];
211
+ case 4:
212
+ _a.sent();
213
+ return [4 /*yield*/, saleResponse
214
+ .release()
215
+ .withReasonCode(src_1.ReasonCode.InStock)
216
+ .withDescription("JAVA-Hold")
217
+ .execute()];
218
+ case 5:
219
+ response = _a.sent();
220
+ t.truthy(response);
221
+ t.is("00", response.responseCode);
222
+ return [2 /*return*/];
223
+ }
224
+ });
225
+ }); });
226
+ ava_1.default("JAVA_Release_006c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
227
+ var config, card, saleResponse, holdResponse, response;
228
+ return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0:
231
+ t.plan(2);
232
+ config = new src_1.ServicesConfig();
233
+ config.merchantId = "heartlandgpsandbox";
234
+ config.accountId = "api";
235
+ config.sharedSecret = "secret";
236
+ config.refundPassword = "refund";
237
+ config.rebatePassword = "rebate";
238
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
239
+ config.timeout = 5000;
240
+ config.channel = "ECOM";
241
+ src_1.ServicesContainer.configure(config);
242
+ card = new src_1.CreditCardData();
243
+ card.number = "4263970000005262";
244
+ card.expMonth = "12";
245
+ card.expYear = "2020";
246
+ card.cvn = "123";
247
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
248
+ card.cardHolderName = "James Mason";
249
+ return [4 /*yield*/, card
250
+ .charge(10)
251
+ .withCurrency("EUR")
252
+ .execute()];
253
+ case 1:
254
+ saleResponse = _a.sent();
255
+ t.truthy(saleResponse);
256
+ t.is("00", saleResponse.responseCode);
257
+ return [4 /*yield*/, throttle()];
258
+ case 2:
259
+ _a.sent();
260
+ return [4 /*yield*/, saleResponse
261
+ .hold()
262
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
263
+ .execute()];
264
+ case 3:
265
+ holdResponse = _a.sent();
266
+ t.truthy(holdResponse);
267
+ t.is("00", holdResponse.responseCode);
268
+ return [4 /*yield*/, throttle()];
269
+ case 4:
270
+ _a.sent();
271
+ return [4 /*yield*/, saleResponse
272
+ .release()
273
+ .withReasonCode(src_1.ReasonCode.InStock)
274
+ .withDescription("JAVA-Hold")
275
+ .execute()];
276
+ case 5:
277
+ response = _a.sent();
278
+ t.truthy(response);
279
+ t.is("00", response.responseCode);
280
+ return [2 /*return*/];
281
+ }
282
+ });
283
+ }); });
284
+ ava_1.default("JAVA_Release_006d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
285
+ var config, card, saleResponse, holdResponse, response;
286
+ return __generator(this, function (_a) {
287
+ switch (_a.label) {
288
+ case 0:
289
+ t.plan(2);
290
+ config = new src_1.ServicesConfig();
291
+ config.merchantId = "heartlandgpsandbox";
292
+ config.accountId = "api";
293
+ config.sharedSecret = "secret";
294
+ config.refundPassword = "refund";
295
+ config.rebatePassword = "rebate";
296
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
297
+ config.timeout = 5000;
298
+ config.channel = "ECOM";
299
+ src_1.ServicesContainer.configure(config);
300
+ card = new src_1.CreditCardData();
301
+ card.number = "4263970000005262";
302
+ card.expMonth = "12";
303
+ card.expYear = "2020";
304
+ card.cvn = "123";
305
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
306
+ card.cardHolderName = "James Mason";
307
+ return [4 /*yield*/, card
308
+ .charge(10)
309
+ .withCurrency("EUR")
310
+ .execute()];
311
+ case 1:
312
+ saleResponse = _a.sent();
313
+ t.truthy(saleResponse);
314
+ t.is("00", saleResponse.responseCode);
315
+ return [4 /*yield*/, throttle()];
316
+ case 2:
317
+ _a.sent();
318
+ return [4 /*yield*/, saleResponse
319
+ .hold()
320
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
321
+ .execute()];
322
+ case 3:
323
+ holdResponse = _a.sent();
324
+ t.truthy(holdResponse);
325
+ t.is("00", holdResponse.responseCode);
326
+ return [4 /*yield*/, throttle()];
327
+ case 4:
328
+ _a.sent();
329
+ return [4 /*yield*/, saleResponse
330
+ .release()
331
+ .withReasonCode(src_1.ReasonCode.InStock)
332
+ .withDescription("JAVA-Hold")
333
+ .execute()];
334
+ case 5:
335
+ response = _a.sent();
336
+ t.truthy(response);
337
+ t.is("00", response.responseCode);
338
+ return [2 /*return*/];
339
+ }
340
+ });
341
+ }); });
342
+ ava_1.default("JAVA_Release_006e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
343
+ var config, card, saleResponse, holdResponse, response;
344
+ return __generator(this, function (_a) {
345
+ switch (_a.label) {
346
+ case 0:
347
+ t.plan(2);
348
+ config = new src_1.ServicesConfig();
349
+ config.merchantId = "heartlandgpsandbox";
350
+ config.accountId = "api";
351
+ config.sharedSecret = "secret";
352
+ config.refundPassword = "refund";
353
+ config.rebatePassword = "rebate";
354
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
355
+ config.timeout = 5000;
356
+ config.channel = "ECOM";
357
+ src_1.ServicesContainer.configure(config);
358
+ card = new src_1.CreditCardData();
359
+ card.number = "4263970000005262";
360
+ card.expMonth = "12";
361
+ card.expYear = "2020";
362
+ card.cvn = "123";
363
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
364
+ card.cardHolderName = "James Mason";
365
+ return [4 /*yield*/, card
366
+ .charge(10)
367
+ .withCurrency("EUR")
368
+ .execute()];
369
+ case 1:
370
+ saleResponse = _a.sent();
371
+ t.truthy(saleResponse);
372
+ t.is("00", saleResponse.responseCode);
373
+ return [4 /*yield*/, throttle()];
374
+ case 2:
375
+ _a.sent();
376
+ return [4 /*yield*/, saleResponse
377
+ .hold()
378
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
379
+ .execute()];
380
+ case 3:
381
+ holdResponse = _a.sent();
382
+ t.truthy(holdResponse);
383
+ t.is("00", holdResponse.responseCode);
384
+ return [4 /*yield*/, throttle()];
385
+ case 4:
386
+ _a.sent();
387
+ return [4 /*yield*/, saleResponse
388
+ .release()
389
+ .withReasonCode(src_1.ReasonCode.InStock)
390
+ .withDescription("JAVA-Hold")
391
+ .execute()];
392
+ case 5:
393
+ response = _a.sent();
394
+ t.truthy(response);
395
+ t.is("00", response.responseCode);
396
+ return [2 /*return*/];
397
+ }
398
+ });
399
+ }); });
400
+ ava_1.default("JAVA_Release_006f", function (t) { return __awaiter(void 0, void 0, void 0, function () {
401
+ var config, card, saleResponse, holdResponse, response;
402
+ return __generator(this, function (_a) {
403
+ switch (_a.label) {
404
+ case 0:
405
+ t.plan(2);
406
+ config = new src_1.ServicesConfig();
407
+ config.merchantId = "heartlandgpsandbox";
408
+ config.accountId = "api";
409
+ config.sharedSecret = "secret";
410
+ config.refundPassword = "refund";
411
+ config.rebatePassword = "rebate";
412
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
413
+ config.timeout = 5000;
414
+ config.channel = "ECOM";
415
+ src_1.ServicesContainer.configure(config);
416
+ card = new src_1.CreditCardData();
417
+ card.number = "4263970000005262";
418
+ card.expMonth = "12";
419
+ card.expYear = "2020";
420
+ card.cvn = "123";
421
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
422
+ card.cardHolderName = "James Mason";
423
+ return [4 /*yield*/, card
424
+ .charge(10)
425
+ .withCurrency("EUR")
426
+ .execute()];
427
+ case 1:
428
+ saleResponse = _a.sent();
429
+ t.truthy(saleResponse);
430
+ t.is("00", saleResponse.responseCode);
431
+ return [4 /*yield*/, throttle()];
432
+ case 2:
433
+ _a.sent();
434
+ return [4 /*yield*/, saleResponse
435
+ .hold()
436
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
437
+ .execute()];
438
+ case 3:
439
+ holdResponse = _a.sent();
440
+ t.truthy(holdResponse);
441
+ t.is("00", holdResponse.responseCode);
442
+ return [4 /*yield*/, throttle()];
443
+ case 4:
444
+ _a.sent();
445
+ return [4 /*yield*/, saleResponse
446
+ .release()
447
+ .withReasonCode(src_1.ReasonCode.InStock)
448
+ .withDescription("JAVA-Hold")
449
+ .execute()];
450
+ case 5:
451
+ response = _a.sent();
452
+ t.truthy(response);
453
+ t.is("00", response.responseCode);
454
+ return [2 /*return*/];
455
+ }
456
+ });
457
+ }); });
458
+ ava_1.default("JAVA_Release_006g", function (t) { return __awaiter(void 0, void 0, void 0, function () {
459
+ var config, card, saleResponse, holdResponse, response;
460
+ return __generator(this, function (_a) {
461
+ switch (_a.label) {
462
+ case 0:
463
+ t.plan(2);
464
+ config = new src_1.ServicesConfig();
465
+ config.merchantId = "heartlandgpsandbox";
466
+ config.accountId = "api";
467
+ config.sharedSecret = "secret";
468
+ config.refundPassword = "refund";
469
+ config.rebatePassword = "rebate";
470
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
471
+ config.timeout = 5000;
472
+ config.channel = "ECOM";
473
+ src_1.ServicesContainer.configure(config);
474
+ card = new src_1.CreditCardData();
475
+ card.number = "4263970000005262";
476
+ card.expMonth = "12";
477
+ card.expYear = "2020";
478
+ card.cvn = "123";
479
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
480
+ card.cardHolderName = "James Mason";
481
+ return [4 /*yield*/, card
482
+ .charge(10)
483
+ .withCurrency("EUR")
484
+ .execute()];
485
+ case 1:
486
+ saleResponse = _a.sent();
487
+ t.truthy(saleResponse);
488
+ t.is("00", saleResponse.responseCode);
489
+ return [4 /*yield*/, throttle()];
490
+ case 2:
491
+ _a.sent();
492
+ return [4 /*yield*/, saleResponse
493
+ .hold()
494
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
495
+ .execute()];
496
+ case 3:
497
+ holdResponse = _a.sent();
498
+ t.truthy(holdResponse);
499
+ t.is("00", holdResponse.responseCode);
500
+ return [4 /*yield*/, throttle()];
501
+ case 4:
502
+ _a.sent();
503
+ return [4 /*yield*/, saleResponse
504
+ .release()
505
+ .withReasonCode(src_1.ReasonCode.InStock)
506
+ .withDescription("JAVA-Hold")
507
+ .execute()];
508
+ case 5:
509
+ response = _a.sent();
510
+ t.truthy(response);
511
+ t.is("00", response.responseCode);
512
+ return [2 /*return*/];
513
+ }
514
+ });
515
+ }); });
516
+ ava_1.default("JAVA_Release_006h", function (t) { return __awaiter(void 0, void 0, void 0, function () {
517
+ var config, card, saleResponse, holdResponse, response;
518
+ return __generator(this, function (_a) {
519
+ switch (_a.label) {
520
+ case 0:
521
+ t.plan(2);
522
+ config = new src_1.ServicesConfig();
523
+ config.merchantId = "heartlandgpsandbox";
524
+ config.accountId = "api";
525
+ config.sharedSecret = "secret";
526
+ config.refundPassword = "refund";
527
+ config.rebatePassword = "rebate";
528
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
529
+ config.timeout = 5000;
530
+ config.channel = "ECOM";
531
+ src_1.ServicesContainer.configure(config);
532
+ card = new src_1.CreditCardData();
533
+ card.number = "4263970000005262";
534
+ card.expMonth = "12";
535
+ card.expYear = "2020";
536
+ card.cvn = "123";
537
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
538
+ card.cardHolderName = "James Mason";
539
+ return [4 /*yield*/, card
540
+ .charge(10)
541
+ .withCurrency("EUR")
542
+ .execute()];
543
+ case 1:
544
+ saleResponse = _a.sent();
545
+ t.truthy(saleResponse);
546
+ t.is("00", saleResponse.responseCode);
547
+ return [4 /*yield*/, throttle()];
548
+ case 2:
549
+ _a.sent();
550
+ return [4 /*yield*/, saleResponse
551
+ .hold()
552
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
553
+ .execute()];
554
+ case 3:
555
+ holdResponse = _a.sent();
556
+ t.truthy(holdResponse);
557
+ t.is("00", holdResponse.responseCode);
558
+ return [4 /*yield*/, throttle()];
559
+ case 4:
560
+ _a.sent();
561
+ return [4 /*yield*/, saleResponse
562
+ .release()
563
+ .withReasonCode(src_1.ReasonCode.InStock)
564
+ .withDescription("JAVA-Hold")
565
+ .execute()];
566
+ case 5:
567
+ response = _a.sent();
568
+ t.truthy(response);
569
+ t.is("00", response.responseCode);
570
+ return [2 /*return*/];
571
+ }
572
+ });
573
+ }); });
574
+ ava_1.default("JAVA_Release_006i", function (t) { return __awaiter(void 0, void 0, void 0, function () {
575
+ var config, card, saleResponse, holdResponse, response;
576
+ return __generator(this, function (_a) {
577
+ switch (_a.label) {
578
+ case 0:
579
+ t.plan(2);
580
+ config = new src_1.ServicesConfig();
581
+ config.merchantId = "heartlandgpsandbox";
582
+ config.accountId = "api";
583
+ config.sharedSecret = "secret";
584
+ config.refundPassword = "refund";
585
+ config.rebatePassword = "rebate";
586
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
587
+ config.timeout = 5000;
588
+ config.channel = "ECOM";
589
+ src_1.ServicesContainer.configure(config);
590
+ card = new src_1.CreditCardData();
591
+ card.number = "4263970000005262";
592
+ card.expMonth = "12";
593
+ card.expYear = "2020";
594
+ card.cvn = "123";
595
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
596
+ card.cardHolderName = "James Mason";
597
+ return [4 /*yield*/, card
598
+ .charge(10)
599
+ .withCurrency("EUR")
600
+ .execute()];
601
+ case 1:
602
+ saleResponse = _a.sent();
603
+ t.truthy(saleResponse);
604
+ t.is("00", saleResponse.responseCode);
605
+ return [4 /*yield*/, throttle()];
606
+ case 2:
607
+ _a.sent();
608
+ return [4 /*yield*/, saleResponse
609
+ .hold()
610
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
611
+ .execute()];
612
+ case 3:
613
+ holdResponse = _a.sent();
614
+ t.truthy(holdResponse);
615
+ t.is("00", holdResponse.responseCode);
616
+ return [4 /*yield*/, throttle()];
617
+ case 4:
618
+ _a.sent();
619
+ return [4 /*yield*/, saleResponse
620
+ .release()
621
+ .withReasonCode(src_1.ReasonCode.InStock)
622
+ .withDescription("JAVA-Hold")
623
+ .execute()];
624
+ case 5:
625
+ response = _a.sent();
626
+ t.truthy(response);
627
+ t.is("00", response.responseCode);
628
+ return [2 /*return*/];
629
+ }
630
+ });
631
+ }); });
632
+ ava_1.default("JAVA_Release_006k", function (t) { return __awaiter(void 0, void 0, void 0, function () {
633
+ var config, card, saleResponse, holdResponse, response;
634
+ return __generator(this, function (_a) {
635
+ switch (_a.label) {
636
+ case 0:
637
+ t.plan(2);
638
+ config = new src_1.ServicesConfig();
639
+ config.merchantId = "heartlandgpsandbox";
640
+ config.accountId = "api";
641
+ config.sharedSecret = "secret";
642
+ config.refundPassword = "refund";
643
+ config.rebatePassword = "rebate";
644
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
645
+ config.timeout = 5000;
646
+ config.channel = "ECOM";
647
+ src_1.ServicesContainer.configure(config);
648
+ card = new src_1.CreditCardData();
649
+ card.number = "4263970000005262";
650
+ card.expMonth = "12";
651
+ card.expYear = "2020";
652
+ card.cvn = "123";
653
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
654
+ card.cardHolderName = "James Mason";
655
+ return [4 /*yield*/, card
656
+ .charge(10)
657
+ .withCurrency("EUR")
658
+ .execute()];
659
+ case 1:
660
+ saleResponse = _a.sent();
661
+ t.truthy(saleResponse);
662
+ t.is("00", saleResponse.responseCode);
663
+ return [4 /*yield*/, throttle()];
664
+ case 2:
665
+ _a.sent();
666
+ return [4 /*yield*/, saleResponse
667
+ .hold()
668
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
669
+ .execute()];
670
+ case 3:
671
+ holdResponse = _a.sent();
672
+ t.truthy(holdResponse);
673
+ t.is("00", holdResponse.responseCode);
674
+ return [4 /*yield*/, throttle()];
675
+ case 4:
676
+ _a.sent();
677
+ return [4 /*yield*/, saleResponse
678
+ .release()
679
+ .withReasonCode(src_1.ReasonCode.InStock)
680
+ .withDescription("JAVA-Hold")
681
+ .execute()];
682
+ case 5:
683
+ response = _a.sent();
684
+ t.truthy(response);
685
+ t.is("00", response.responseCode);
686
+ return [2 /*return*/];
687
+ }
688
+ });
689
+ }); });
690
+ ava_1.default("JAVA_Release_006l", function (t) { return __awaiter(void 0, void 0, void 0, function () {
691
+ var config, card, saleResponse, holdResponse, response;
692
+ return __generator(this, function (_a) {
693
+ switch (_a.label) {
694
+ case 0:
695
+ t.plan(2);
696
+ config = new src_1.ServicesConfig();
697
+ config.merchantId = "heartlandgpsandbox";
698
+ config.accountId = "api";
699
+ config.sharedSecret = "secret";
700
+ config.refundPassword = "refund";
701
+ config.rebatePassword = "rebate";
702
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
703
+ config.timeout = 5000;
704
+ config.channel = "ECOM";
705
+ src_1.ServicesContainer.configure(config);
706
+ card = new src_1.CreditCardData();
707
+ card.number = "4263970000005262";
708
+ card.expMonth = "12";
709
+ card.expYear = "2020";
710
+ card.cvn = "123";
711
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
712
+ card.cardHolderName = "James Mason";
713
+ return [4 /*yield*/, card
714
+ .charge(10)
715
+ .withCurrency("EUR")
716
+ .execute()];
717
+ case 1:
718
+ saleResponse = _a.sent();
719
+ t.truthy(saleResponse);
720
+ t.is("00", saleResponse.responseCode);
721
+ return [4 /*yield*/, throttle()];
722
+ case 2:
723
+ _a.sent();
724
+ return [4 /*yield*/, saleResponse
725
+ .hold()
726
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
727
+ .execute()];
728
+ case 3:
729
+ holdResponse = _a.sent();
730
+ t.truthy(holdResponse);
731
+ t.is("00", holdResponse.responseCode);
732
+ return [4 /*yield*/, throttle()];
733
+ case 4:
734
+ _a.sent();
735
+ return [4 /*yield*/, saleResponse
736
+ .release()
737
+ .withReasonCode(src_1.ReasonCode.InStock)
738
+ .withDescription("JAVA-Hold")
739
+ .execute()];
740
+ case 5:
741
+ response = _a.sent();
742
+ t.truthy(response);
743
+ t.is("00", response.responseCode);
744
+ return [2 /*return*/];
745
+ }
746
+ });
747
+ }); });
748
+ ava_1.default("JAVA_Release_007a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
749
+ var config, card, saleResponse, holdResponse, response;
750
+ return __generator(this, function (_a) {
751
+ switch (_a.label) {
752
+ case 0:
753
+ t.plan(2);
754
+ config = new src_1.ServicesConfig();
755
+ config.merchantId = "heartlandgpsandbox";
756
+ config.accountId = "api";
757
+ config.sharedSecret = "secret";
758
+ config.refundPassword = "refund";
759
+ config.rebatePassword = "rebate";
760
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
761
+ config.timeout = 5000;
762
+ config.channel = "ECOM";
763
+ src_1.ServicesContainer.configure(config);
764
+ card = new src_1.CreditCardData();
765
+ card.number = "4263970000005262";
766
+ card.expMonth = "12";
767
+ card.expYear = "2020";
768
+ card.cvn = "123";
769
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
770
+ card.cardHolderName = "James Mason";
771
+ return [4 /*yield*/, card
772
+ .charge(10)
773
+ .withCurrency("EUR")
774
+ .execute()];
775
+ case 1:
776
+ saleResponse = _a.sent();
777
+ t.truthy(saleResponse);
778
+ t.is("00", saleResponse.responseCode);
779
+ return [4 /*yield*/, throttle()];
780
+ case 2:
781
+ _a.sent();
782
+ return [4 /*yield*/, saleResponse
783
+ .hold()
784
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
785
+ .execute()];
786
+ case 3:
787
+ holdResponse = _a.sent();
788
+ t.truthy(holdResponse);
789
+ t.is("00", holdResponse.responseCode);
790
+ return [4 /*yield*/, throttle()];
791
+ case 4:
792
+ _a.sent();
793
+ return [4 /*yield*/, saleResponse
794
+ .release()
795
+ .withReasonCode(src_1.ReasonCode.InStock)
796
+ .withDescription("JAVA-Hold")
797
+ .execute()];
798
+ case 5:
799
+ response = _a.sent();
800
+ t.truthy(response);
801
+ t.is("00", response.responseCode);
802
+ return [2 /*return*/];
803
+ }
804
+ });
805
+ }); });
806
+ ava_1.default("JAVA_Release_007b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
807
+ var config, card, saleResponse, holdResponse, response;
808
+ return __generator(this, function (_a) {
809
+ switch (_a.label) {
810
+ case 0:
811
+ t.plan(2);
812
+ config = new src_1.ServicesConfig();
813
+ config.merchantId = "heartlandgpsandbox";
814
+ config.accountId = "api";
815
+ config.sharedSecret = "secret";
816
+ config.refundPassword = "refund";
817
+ config.rebatePassword = "rebate";
818
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
819
+ config.timeout = 5000;
820
+ config.channel = "ECOM";
821
+ src_1.ServicesContainer.configure(config);
822
+ card = new src_1.CreditCardData();
823
+ card.number = "4263970000005262";
824
+ card.expMonth = "12";
825
+ card.expYear = "2020";
826
+ card.cvn = "123";
827
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
828
+ card.cardHolderName = "James Mason";
829
+ return [4 /*yield*/, card
830
+ .charge(10)
831
+ .withCurrency("EUR")
832
+ .execute()];
833
+ case 1:
834
+ saleResponse = _a.sent();
835
+ t.truthy(saleResponse);
836
+ t.is("00", saleResponse.responseCode);
837
+ return [4 /*yield*/, throttle()];
838
+ case 2:
839
+ _a.sent();
840
+ return [4 /*yield*/, saleResponse
841
+ .hold()
842
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
843
+ .execute()];
844
+ case 3:
845
+ holdResponse = _a.sent();
846
+ t.truthy(holdResponse);
847
+ t.is("00", holdResponse.responseCode);
848
+ return [4 /*yield*/, throttle()];
849
+ case 4:
850
+ _a.sent();
851
+ return [4 /*yield*/, saleResponse
852
+ .release()
853
+ .withReasonCode(src_1.ReasonCode.InStock)
854
+ .withDescription("JAVA-Hold")
855
+ .execute()];
856
+ case 5:
857
+ response = _a.sent();
858
+ t.truthy(response);
859
+ t.is("00", response.responseCode);
860
+ return [2 /*return*/];
861
+ }
862
+ });
863
+ }); });
864
+ ava_1.default("JAVA_Release_007c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
865
+ var config, card, saleResponse, holdResponse, response;
866
+ return __generator(this, function (_a) {
867
+ switch (_a.label) {
868
+ case 0:
869
+ t.plan(2);
870
+ config = new src_1.ServicesConfig();
871
+ config.merchantId = "heartlandgpsandbox";
872
+ config.accountId = "api";
873
+ config.sharedSecret = "secret";
874
+ config.refundPassword = "refund";
875
+ config.rebatePassword = "rebate";
876
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
877
+ config.timeout = 5000;
878
+ config.channel = "ECOM";
879
+ src_1.ServicesContainer.configure(config);
880
+ card = new src_1.CreditCardData();
881
+ card.number = "4263970000005262";
882
+ card.expMonth = "12";
883
+ card.expYear = "2020";
884
+ card.cvn = "123";
885
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
886
+ card.cardHolderName = "James Mason";
887
+ return [4 /*yield*/, card
888
+ .charge(10)
889
+ .withCurrency("EUR")
890
+ .execute()];
891
+ case 1:
892
+ saleResponse = _a.sent();
893
+ t.truthy(saleResponse);
894
+ t.is("00", saleResponse.responseCode);
895
+ return [4 /*yield*/, throttle()];
896
+ case 2:
897
+ _a.sent();
898
+ return [4 /*yield*/, saleResponse
899
+ .hold()
900
+ .withReasonCode(src_1.ReasonCode.OutOfStock)
901
+ .execute()];
902
+ case 3:
903
+ holdResponse = _a.sent();
904
+ t.truthy(holdResponse);
905
+ t.is("00", holdResponse.responseCode);
906
+ return [4 /*yield*/, throttle()];
907
+ case 4:
908
+ _a.sent();
909
+ return [4 /*yield*/, saleResponse
910
+ .release()
911
+ .withReasonCode(src_1.ReasonCode.InStock)
912
+ .withDescription("JAVA-Hold")
913
+ .execute()];
914
+ case 5:
915
+ response = _a.sent();
916
+ t.truthy(response);
917
+ t.is("00", response.responseCode);
918
+ return [2 /*return*/];
919
+ }
920
+ });
921
+ }); });
922
+ ava_1.default("JAVA_Release_007d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
923
+ var config, saleResponse, error;
924
+ return __generator(this, function (_a) {
925
+ switch (_a.label) {
926
+ case 0:
927
+ t.plan(2);
928
+ config = new src_1.ServicesConfig();
929
+ config.merchantId = "heartlandgpsandbox";
930
+ config.accountId = "api";
931
+ config.sharedSecret = "secret";
932
+ config.refundPassword = "refund";
933
+ config.rebatePassword = "rebate";
934
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
935
+ config.timeout = 5000;
936
+ src_1.ServicesContainer.configure(config);
937
+ saleResponse = src_1.Transaction.fromId(undefined);
938
+ return [4 /*yield*/, t.throws(saleResponse
939
+ .release()
940
+ .withReasonCode(src_1.ReasonCode.InStock)
941
+ .execute(), src_1.BuilderError)];
942
+ case 1:
943
+ error = _a.sent();
944
+ t.truthy(error.message);
945
+ return [2 /*return*/];
946
+ }
947
+ });
948
+ }); });
949
+ ava_1.default("JAVA_Release_007e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
950
+ var config, saleResponse, error;
951
+ return __generator(this, function (_a) {
952
+ switch (_a.label) {
953
+ case 0:
954
+ t.plan(2);
955
+ config = new src_1.ServicesConfig();
956
+ config.merchantId = "heartlandgpsandbox";
957
+ config.accountId = "api";
958
+ config.sharedSecret = "secret";
959
+ config.refundPassword = "refund";
960
+ config.rebatePassword = "rebate";
961
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
962
+ config.timeout = 5000;
963
+ src_1.ServicesContainer.configure(config);
964
+ saleResponse = src_1.Transaction.fromId(undefined);
965
+ return [4 /*yield*/, t.throws(saleResponse
966
+ .release()
967
+ .withReasonCode(src_1.ReasonCode.InStock)
968
+ .execute(), src_1.BuilderError)];
969
+ case 1:
970
+ error = _a.sent();
971
+ t.truthy(error.message);
972
+ return [2 /*return*/];
973
+ }
974
+ });
975
+ }); });
976
+ ava_1.default("JAVA_Release_008c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
977
+ var config, saleResponse, error;
978
+ return __generator(this, function (_a) {
979
+ switch (_a.label) {
980
+ case 0:
981
+ t.plan(2);
982
+ config = new src_1.ServicesConfig();
983
+ config.merchantId = "heartlandgpsandbox";
984
+ config.accountId = "api";
985
+ config.sharedSecret = "secret";
986
+ config.refundPassword = "refund";
987
+ config.rebatePassword = "rebate";
988
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
989
+ config.timeout = 5000;
990
+ src_1.ServicesContainer.configure(config);
991
+ saleResponse = src_1.Transaction.fromId(undefined);
992
+ return [4 /*yield*/, t.throws(saleResponse
993
+ .release()
994
+ .withReasonCode(src_1.ReasonCode.InStock)
995
+ .execute(), src_1.BuilderError)];
996
+ case 1:
997
+ error = _a.sent();
998
+ t.truthy(error.message);
999
+ return [2 /*return*/];
1000
+ }
1001
+ });
1002
+ }); });
1003
+ ava_1.default("JAVA_Release_008d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1004
+ var config, saleResponse, error;
1005
+ return __generator(this, function (_a) {
1006
+ switch (_a.label) {
1007
+ case 0:
1008
+ t.plan(2);
1009
+ config = new src_1.ServicesConfig();
1010
+ config.merchantId = "heartlandgpsandbox";
1011
+ config.accountId = "api";
1012
+ config.sharedSecret = "secret";
1013
+ config.refundPassword = "refund";
1014
+ config.rebatePassword = "rebate";
1015
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1016
+ config.timeout = 5000;
1017
+ src_1.ServicesContainer.configure(config);
1018
+ saleResponse = src_1.Transaction.fromId(undefined);
1019
+ return [4 /*yield*/, t.throws(saleResponse
1020
+ .release()
1021
+ .withReasonCode(src_1.ReasonCode.InStock)
1022
+ .execute(), src_1.BuilderError)];
1023
+ case 1:
1024
+ error = _a.sent();
1025
+ t.truthy(error.message);
1026
+ return [2 /*return*/];
1027
+ }
1028
+ });
1029
+ }); });
1030
+ ava_1.default("JAVA_Release_008e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1031
+ var config, saleResponse, error;
1032
+ return __generator(this, function (_a) {
1033
+ switch (_a.label) {
1034
+ case 0:
1035
+ t.plan(2);
1036
+ config = new src_1.ServicesConfig();
1037
+ config.merchantId = "heartlandgpsandbox";
1038
+ config.accountId = "api";
1039
+ config.sharedSecret = "secret";
1040
+ config.refundPassword = "refund";
1041
+ config.rebatePassword = "rebate";
1042
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1043
+ config.timeout = 5000;
1044
+ src_1.ServicesContainer.configure(config);
1045
+ saleResponse = src_1.Transaction.fromId(undefined);
1046
+ return [4 /*yield*/, t.throws(saleResponse
1047
+ .release()
1048
+ .withReasonCode(src_1.ReasonCode.InStock)
1049
+ .execute(), src_1.BuilderError)];
1050
+ case 1:
1051
+ error = _a.sent();
1052
+ t.truthy(error.message);
1053
+ return [2 /*return*/];
1054
+ }
1055
+ });
1056
+ }); });
1057
+ ava_1.default("JAVA_Release_009d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1058
+ var config, saleResponse, error;
1059
+ return __generator(this, function (_a) {
1060
+ switch (_a.label) {
1061
+ case 0:
1062
+ t.plan(2);
1063
+ config = new src_1.ServicesConfig();
1064
+ config.merchantId = "heartlandgpsandbox";
1065
+ config.accountId = "api";
1066
+ config.sharedSecret = "secret";
1067
+ config.refundPassword = "refund";
1068
+ config.rebatePassword = "rebate";
1069
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1070
+ config.timeout = 5000;
1071
+ config.channel = "ECOM";
1072
+ src_1.ServicesContainer.configure(config);
1073
+ saleResponse = src_1.Transaction.fromId(undefined);
1074
+ return [4 /*yield*/, t.throws(saleResponse
1075
+ .release()
1076
+ .withReasonCode(src_1.ReasonCode.InStock)
1077
+ .withDescription("JAVA-Query")
1078
+ .execute(), src_1.BuilderError)];
1079
+ case 1:
1080
+ error = _a.sent();
1081
+ t.truthy(error.message);
1082
+ return [2 /*return*/];
1083
+ }
1084
+ });
1085
+ }); });
1086
+ ava_1.default("JAVA_Release_009e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1087
+ var config, saleResponse, error;
1088
+ return __generator(this, function (_a) {
1089
+ switch (_a.label) {
1090
+ case 0:
1091
+ t.plan(2);
1092
+ config = new src_1.ServicesConfig();
1093
+ config.merchantId = "heartlandgpsandbox";
1094
+ config.accountId = "api";
1095
+ config.sharedSecret = "secret";
1096
+ config.refundPassword = "refund";
1097
+ config.rebatePassword = "rebate";
1098
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1099
+ config.timeout = 5000;
1100
+ config.channel = "ECOM";
1101
+ src_1.ServicesContainer.configure(config);
1102
+ saleResponse = src_1.Transaction.fromId(undefined);
1103
+ return [4 /*yield*/, t.throws(saleResponse
1104
+ .release()
1105
+ .withReasonCode(src_1.ReasonCode.InStock)
1106
+ .withDescription("JAVA-Query")
1107
+ .execute(), src_1.BuilderError)];
1108
+ case 1:
1109
+ error = _a.sent();
1110
+ t.truthy(error.message);
1111
+ return [2 /*return*/];
1112
+ }
1113
+ });
1114
+ }); });
1115
+ ava_1.default("JAVA_Release_010a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1116
+ var config, card, saleResponse, response;
1117
+ return __generator(this, function (_a) {
1118
+ switch (_a.label) {
1119
+ case 0:
1120
+ t.plan(2);
1121
+ config = new src_1.ServicesConfig();
1122
+ config.merchantId = "heartlandgpsandbox";
1123
+ config.accountId = "api";
1124
+ config.sharedSecret = "secret";
1125
+ config.refundPassword = "refund";
1126
+ config.rebatePassword = "rebate";
1127
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1128
+ config.timeout = 5000;
1129
+ config.channel = "ECOM";
1130
+ src_1.ServicesContainer.configure(config);
1131
+ card = new src_1.CreditCardData();
1132
+ card.number = "4263970000005262";
1133
+ card.expMonth = "12";
1134
+ card.expYear = "2020";
1135
+ card.cvn = "123";
1136
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1137
+ card.cardHolderName = "James Mason";
1138
+ return [4 /*yield*/, card
1139
+ .charge(10)
1140
+ .withCurrency("EUR")
1141
+ .execute()];
1142
+ case 1:
1143
+ saleResponse = _a.sent();
1144
+ t.truthy(saleResponse);
1145
+ t.is("00", saleResponse.responseCode);
1146
+ return [4 /*yield*/, throttle()];
1147
+ case 2:
1148
+ _a.sent();
1149
+ return [4 /*yield*/, saleResponse
1150
+ .hold()
1151
+ .withReasonCode(src_1.ReasonCode.Other)
1152
+ .withDescription("JAVA-Hold")
1153
+ .execute()];
1154
+ case 3:
1155
+ response = _a.sent();
1156
+ t.truthy(response);
1157
+ t.is("00", response.responseCode);
1158
+ return [2 /*return*/];
1159
+ }
1160
+ });
1161
+ }); });
1162
+ ava_1.default("JAVA_Release_010b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1163
+ var config, card, saleResponse, response;
1164
+ return __generator(this, function (_a) {
1165
+ switch (_a.label) {
1166
+ case 0:
1167
+ t.plan(2);
1168
+ config = new src_1.ServicesConfig();
1169
+ config.merchantId = "heartlandgpsandbox";
1170
+ config.accountId = "api";
1171
+ config.sharedSecret = "secret";
1172
+ config.refundPassword = "refund";
1173
+ config.rebatePassword = "rebate";
1174
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1175
+ config.timeout = 5000;
1176
+ config.channel = "ECOM";
1177
+ src_1.ServicesContainer.configure(config);
1178
+ card = new src_1.CreditCardData();
1179
+ card.number = "4263970000005262";
1180
+ card.expMonth = "12";
1181
+ card.expYear = "2020";
1182
+ card.cvn = "123";
1183
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1184
+ card.cardHolderName = "James Mason";
1185
+ return [4 /*yield*/, card
1186
+ .charge(10)
1187
+ .withCurrency("EUR")
1188
+ .execute()];
1189
+ case 1:
1190
+ saleResponse = _a.sent();
1191
+ t.truthy(saleResponse);
1192
+ t.is("00", saleResponse.responseCode);
1193
+ return [4 /*yield*/, throttle()];
1194
+ case 2:
1195
+ _a.sent();
1196
+ return [4 /*yield*/, saleResponse
1197
+ .hold()
1198
+ .withReasonCode(src_1.ReasonCode.Fraud)
1199
+ .withDescription("JAVA-Hold")
1200
+ .execute()];
1201
+ case 3:
1202
+ response = _a.sent();
1203
+ t.truthy(response);
1204
+ t.is("00", response.responseCode);
1205
+ return [2 /*return*/];
1206
+ }
1207
+ });
1208
+ }); });
1209
+ ava_1.default("JAVA_Release_010c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1210
+ var config, saleResponse, error;
1211
+ return __generator(this, function (_a) {
1212
+ switch (_a.label) {
1213
+ case 0:
1214
+ t.plan(2);
1215
+ config = new src_1.ServicesConfig();
1216
+ config.merchantId = "heartlandgpsandbox";
1217
+ config.accountId = "api";
1218
+ config.sharedSecret = "secret";
1219
+ config.refundPassword = "refund";
1220
+ config.rebatePassword = "rebate";
1221
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1222
+ config.timeout = 5000;
1223
+ config.channel = "ECOM";
1224
+ src_1.ServicesContainer.configure(config);
1225
+ saleResponse = src_1.Transaction.fromId(undefined);
1226
+ return [4 /*yield*/, t.throws(saleResponse
1227
+ .hold()
1228
+ .withReasonCode(src_1.ReasonCode.Fraud)
1229
+ .withDescription("JAVA-Hold")
1230
+ .execute(), src_1.BuilderError)];
1231
+ case 1:
1232
+ error = _a.sent();
1233
+ t.truthy(error.message);
1234
+ return [2 /*return*/];
1235
+ }
1236
+ });
1237
+ }); });
1238
+ ava_1.default("JAVA_Release_010d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1239
+ var config, card, saleResponse, response;
1240
+ return __generator(this, function (_a) {
1241
+ switch (_a.label) {
1242
+ case 0:
1243
+ t.plan(2);
1244
+ config = new src_1.ServicesConfig();
1245
+ config.merchantId = "heartlandgpsandbox";
1246
+ config.accountId = "api";
1247
+ config.sharedSecret = "secret";
1248
+ config.refundPassword = "refund";
1249
+ config.rebatePassword = "rebate";
1250
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1251
+ config.timeout = 5000;
1252
+ config.channel = "ECOM";
1253
+ src_1.ServicesContainer.configure(config);
1254
+ card = new src_1.CreditCardData();
1255
+ card.number = "4263970000005262";
1256
+ card.expMonth = "12";
1257
+ card.expYear = "2020";
1258
+ card.cvn = "123";
1259
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1260
+ card.cardHolderName = "James Mason";
1261
+ return [4 /*yield*/, card
1262
+ .charge(10)
1263
+ .withCurrency("EUR")
1264
+ .execute()];
1265
+ case 1:
1266
+ saleResponse = _a.sent();
1267
+ t.truthy(saleResponse);
1268
+ t.is("00", saleResponse.responseCode);
1269
+ return [4 /*yield*/, throttle()];
1270
+ case 2:
1271
+ _a.sent();
1272
+ return [4 /*yield*/, saleResponse
1273
+ .hold()
1274
+ .withReasonCode(src_1.ReasonCode.Other)
1275
+ .withDescription("JAVA-Hold")
1276
+ .execute()];
1277
+ case 3:
1278
+ response = _a.sent();
1279
+ t.truthy(response);
1280
+ t.is("00", response.responseCode);
1281
+ return [2 /*return*/];
1282
+ }
1283
+ });
1284
+ }); });
1285
+ ava_1.default("JAVA_Release_011a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1286
+ var config, card, saleResponse, response;
1287
+ return __generator(this, function (_a) {
1288
+ switch (_a.label) {
1289
+ case 0:
1290
+ t.plan(2);
1291
+ config = new src_1.ServicesConfig();
1292
+ config.merchantId = "heartlandgpsandbox";
1293
+ config.accountId = "api";
1294
+ config.sharedSecret = "secret";
1295
+ config.refundPassword = "refund";
1296
+ config.rebatePassword = "rebate";
1297
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1298
+ config.timeout = 5000;
1299
+ config.channel = "ECOM";
1300
+ src_1.ServicesContainer.configure(config);
1301
+ card = new src_1.CreditCardData();
1302
+ card.number = "4263970000005262";
1303
+ card.expMonth = "12";
1304
+ card.expYear = "2020";
1305
+ card.cvn = "123";
1306
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1307
+ card.cardHolderName = "James Mason";
1308
+ return [4 /*yield*/, card
1309
+ .charge(10)
1310
+ .withCurrency("EUR")
1311
+ .execute()];
1312
+ case 1:
1313
+ saleResponse = _a.sent();
1314
+ t.truthy(saleResponse);
1315
+ t.is("00", saleResponse.responseCode);
1316
+ return [4 /*yield*/, throttle()];
1317
+ case 2:
1318
+ _a.sent();
1319
+ return [4 /*yield*/, saleResponse
1320
+ .hold()
1321
+ .withReasonCode(src_1.ReasonCode.Other)
1322
+ .withDescription("JAVA-Hold")
1323
+ .execute()];
1324
+ case 3:
1325
+ response = _a.sent();
1326
+ t.truthy(response);
1327
+ t.is("00", response.responseCode);
1328
+ return [2 /*return*/];
1329
+ }
1330
+ });
1331
+ }); });
1332
+ ava_1.default("JAVA_Release_011b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1333
+ var config, card, saleResponse, response;
1334
+ return __generator(this, function (_a) {
1335
+ switch (_a.label) {
1336
+ case 0:
1337
+ t.plan(2);
1338
+ config = new src_1.ServicesConfig();
1339
+ config.merchantId = "heartlandgpsandbox";
1340
+ config.accountId = "api";
1341
+ config.sharedSecret = "secret";
1342
+ config.refundPassword = "refund";
1343
+ config.rebatePassword = "rebate";
1344
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1345
+ config.timeout = 5000;
1346
+ config.channel = "ECOM";
1347
+ src_1.ServicesContainer.configure(config);
1348
+ card = new src_1.CreditCardData();
1349
+ card.number = "4263970000005262";
1350
+ card.expMonth = "12";
1351
+ card.expYear = "2020";
1352
+ card.cvn = "123";
1353
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1354
+ card.cardHolderName = "James Mason";
1355
+ return [4 /*yield*/, card
1356
+ .charge(10)
1357
+ .withCurrency("EUR")
1358
+ .execute()];
1359
+ case 1:
1360
+ saleResponse = _a.sent();
1361
+ t.truthy(saleResponse);
1362
+ t.is("00", saleResponse.responseCode);
1363
+ return [4 /*yield*/, throttle()];
1364
+ case 2:
1365
+ _a.sent();
1366
+ return [4 /*yield*/, saleResponse
1367
+ .hold()
1368
+ .withReasonCode(undefined)
1369
+ .withDescription("JAVA-Hold")
1370
+ .execute()];
1371
+ case 3:
1372
+ response = _a.sent();
1373
+ t.truthy(response);
1374
+ t.is("00", response.responseCode);
1375
+ return [2 /*return*/];
1376
+ }
1377
+ });
1378
+ }); });
1379
+ ava_1.default("JAVA_Release_011c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1380
+ var config, card, saleResponse, response;
1381
+ return __generator(this, function (_a) {
1382
+ switch (_a.label) {
1383
+ case 0:
1384
+ t.plan(2);
1385
+ config = new src_1.ServicesConfig();
1386
+ config.merchantId = "heartlandgpsandbox";
1387
+ config.accountId = "api";
1388
+ config.sharedSecret = "secret";
1389
+ config.refundPassword = "refund";
1390
+ config.rebatePassword = "rebate";
1391
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1392
+ config.timeout = 5000;
1393
+ config.channel = "ECOM";
1394
+ src_1.ServicesContainer.configure(config);
1395
+ card = new src_1.CreditCardData();
1396
+ card.number = "4263970000005262";
1397
+ card.expMonth = "12";
1398
+ card.expYear = "2020";
1399
+ card.cvn = "123";
1400
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1401
+ card.cardHolderName = "James Mason";
1402
+ return [4 /*yield*/, card
1403
+ .charge(10)
1404
+ .withCurrency("EUR")
1405
+ .execute()];
1406
+ case 1:
1407
+ saleResponse = _a.sent();
1408
+ t.truthy(saleResponse);
1409
+ t.is("00", saleResponse.responseCode);
1410
+ return [4 /*yield*/, throttle()];
1411
+ case 2:
1412
+ _a.sent();
1413
+ return [4 /*yield*/, saleResponse
1414
+ .hold()
1415
+ .withDescription("JAVA-Hold")
1416
+ .execute()];
1417
+ case 3:
1418
+ response = _a.sent();
1419
+ t.truthy(response);
1420
+ t.is("00", response.responseCode);
1421
+ return [2 /*return*/];
1422
+ }
1423
+ });
1424
+ }); });
1425
+ ava_1.default("JAVA_Release_011d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1426
+ var config, card, saleResponse, response;
1427
+ return __generator(this, function (_a) {
1428
+ switch (_a.label) {
1429
+ case 0:
1430
+ t.plan(2);
1431
+ config = new src_1.ServicesConfig();
1432
+ config.merchantId = "heartlandgpsandbox";
1433
+ config.accountId = "api";
1434
+ config.sharedSecret = "secret";
1435
+ config.refundPassword = "refund";
1436
+ config.rebatePassword = "rebate";
1437
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1438
+ config.timeout = 5000;
1439
+ config.channel = "ECOM";
1440
+ src_1.ServicesContainer.configure(config);
1441
+ card = new src_1.CreditCardData();
1442
+ card.number = "4263970000005262";
1443
+ card.expMonth = "12";
1444
+ card.expYear = "2020";
1445
+ card.cvn = "123";
1446
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1447
+ card.cardHolderName = "James Mason";
1448
+ return [4 /*yield*/, card
1449
+ .charge(10)
1450
+ .withCurrency("EUR")
1451
+ .execute()];
1452
+ case 1:
1453
+ saleResponse = _a.sent();
1454
+ t.truthy(saleResponse);
1455
+ t.is("00", saleResponse.responseCode);
1456
+ return [4 /*yield*/, throttle()];
1457
+ case 2:
1458
+ _a.sent();
1459
+ return [4 /*yield*/, saleResponse
1460
+ .hold()
1461
+ .withReasonCode(undefined)
1462
+ .withDescription("JAVA-Hold")
1463
+ .execute()];
1464
+ case 3:
1465
+ response = _a.sent();
1466
+ t.truthy(response);
1467
+ t.is("00", response.responseCode);
1468
+ return [2 /*return*/];
1469
+ }
1470
+ });
1471
+ }); });
1472
+ ava_1.default("JAVA_Release_012a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1473
+ var config, card, saleResponse, response;
1474
+ return __generator(this, function (_a) {
1475
+ switch (_a.label) {
1476
+ case 0:
1477
+ t.plan(2);
1478
+ config = new src_1.ServicesConfig();
1479
+ config.merchantId = "heartlandgpsandbox";
1480
+ config.accountId = "api";
1481
+ config.sharedSecret = "secret";
1482
+ config.refundPassword = "refund";
1483
+ config.rebatePassword = "rebate";
1484
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1485
+ config.timeout = 5000;
1486
+ config.channel = "ECOM";
1487
+ src_1.ServicesContainer.configure(config);
1488
+ card = new src_1.CreditCardData();
1489
+ card.number = "4263970000005262";
1490
+ card.expMonth = "12";
1491
+ card.expYear = "2020";
1492
+ card.cvn = "123";
1493
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1494
+ card.cardHolderName = "James Mason";
1495
+ return [4 /*yield*/, card
1496
+ .charge(10)
1497
+ .withCurrency("EUR")
1498
+ .execute()];
1499
+ case 1:
1500
+ saleResponse = _a.sent();
1501
+ t.truthy(saleResponse);
1502
+ t.is("00", saleResponse.responseCode);
1503
+ return [4 /*yield*/, throttle()];
1504
+ case 2:
1505
+ _a.sent();
1506
+ return [4 /*yield*/, saleResponse
1507
+ .hold()
1508
+ .withReasonCode(src_1.ReasonCode.Other)
1509
+ .withDescription("JAVA-Hold")
1510
+ .execute()];
1511
+ case 3:
1512
+ response = _a.sent();
1513
+ t.truthy(response);
1514
+ t.is("00", response.responseCode);
1515
+ return [2 /*return*/];
1516
+ }
1517
+ });
1518
+ }); });
1519
+ ava_1.default("JAVA_Release_012b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1520
+ var config, card, saleResponse, error;
1521
+ return __generator(this, function (_a) {
1522
+ switch (_a.label) {
1523
+ case 0:
1524
+ t.plan(2);
1525
+ config = new src_1.ServicesConfig();
1526
+ config.merchantId = "heartlandgpsandbox";
1527
+ config.accountId = "api";
1528
+ config.sharedSecret = "secreto";
1529
+ config.refundPassword = "refund";
1530
+ config.rebatePassword = "rebate";
1531
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1532
+ config.timeout = 5000;
1533
+ config.channel = "ECOM";
1534
+ src_1.ServicesContainer.configure(config);
1535
+ card = new src_1.CreditCardData();
1536
+ card.number = "4263970000005262";
1537
+ card.expMonth = "12";
1538
+ card.expYear = "2020";
1539
+ card.cvn = "123";
1540
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1541
+ card.cardHolderName = "James Mason";
1542
+ return [4 /*yield*/, card
1543
+ .charge(10)
1544
+ .withCurrency("EUR")
1545
+ .execute()];
1546
+ case 1:
1547
+ saleResponse = _a.sent();
1548
+ t.truthy(saleResponse);
1549
+ t.is("00", saleResponse.responseCode);
1550
+ return [4 /*yield*/, throttle()];
1551
+ case 2:
1552
+ _a.sent();
1553
+ return [4 /*yield*/, t.throws(saleResponse
1554
+ .hold()
1555
+ .withReasonCode(src_1.ReasonCode.Other)
1556
+ .withDescription("JAVA-Query")
1557
+ .execute(), src_1.GatewayError)];
1558
+ case 3:
1559
+ error = _a.sent();
1560
+ t.truthy(error.message);
1561
+ return [2 /*return*/];
1562
+ }
1563
+ });
1564
+ }); });
1565
+ ava_1.default("JAVA_Release_013a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1566
+ var config, card, saleResponse, response;
1567
+ return __generator(this, function (_a) {
1568
+ switch (_a.label) {
1569
+ case 0:
1570
+ t.plan(2);
1571
+ config = new src_1.ServicesConfig();
1572
+ config.merchantId = "heartlandgpsandbox";
1573
+ config.accountId = "api";
1574
+ config.sharedSecret = "secret";
1575
+ config.refundPassword = "refund";
1576
+ config.rebatePassword = "rebate";
1577
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1578
+ config.timeout = 5000;
1579
+ config.channel = "ECOM";
1580
+ src_1.ServicesContainer.configure(config);
1581
+ card = new src_1.CreditCardData();
1582
+ card.number = "4263970000005262";
1583
+ card.expMonth = "12";
1584
+ card.expYear = "2020";
1585
+ card.cvn = "123";
1586
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1587
+ card.cardHolderName = "James Mason";
1588
+ return [4 /*yield*/, card
1589
+ .charge(10)
1590
+ .withCurrency("EUR")
1591
+ .execute()];
1592
+ case 1:
1593
+ saleResponse = _a.sent();
1594
+ t.truthy(saleResponse);
1595
+ t.is("00", saleResponse.responseCode);
1596
+ return [4 /*yield*/, throttle()];
1597
+ case 2:
1598
+ _a.sent();
1599
+ return [4 /*yield*/, saleResponse
1600
+ .hold()
1601
+ .withReasonCode(src_1.ReasonCode.Other)
1602
+ .withDescription("JAVA-Hold")
1603
+ .execute()];
1604
+ case 3:
1605
+ response = _a.sent();
1606
+ t.truthy(response);
1607
+ t.is("00", response.responseCode);
1608
+ return [2 /*return*/];
1609
+ }
1610
+ });
1611
+ }); });
1612
+ ava_1.default("JAVA_Release_013b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1613
+ var config, card, saleResponse, error;
1614
+ return __generator(this, function (_a) {
1615
+ switch (_a.label) {
1616
+ case 0:
1617
+ t.plan(2);
1618
+ config = new src_1.ServicesConfig();
1619
+ config.merchantId = "heartlandgpsandbox";
1620
+ config.accountId = "api";
1621
+ config.sharedSecret = "secret";
1622
+ config.refundPassword = "refund";
1623
+ config.rebatePassword = "rebate";
1624
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1625
+ config.timeout = 5000;
1626
+ config.channel = "EC";
1627
+ src_1.ServicesContainer.configure(config);
1628
+ card = new src_1.CreditCardData();
1629
+ card.number = "4263970000005262";
1630
+ card.expMonth = "12";
1631
+ card.expYear = "2020";
1632
+ card.cvn = "123";
1633
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1634
+ card.cardHolderName = "James Mason";
1635
+ return [4 /*yield*/, card
1636
+ .charge(10)
1637
+ .withCurrency("EUR")
1638
+ .execute()];
1639
+ case 1:
1640
+ saleResponse = _a.sent();
1641
+ t.truthy(saleResponse);
1642
+ t.is("00", saleResponse.responseCode);
1643
+ return [4 /*yield*/, throttle()];
1644
+ case 2:
1645
+ _a.sent();
1646
+ return [4 /*yield*/, t.throws(saleResponse
1647
+ .hold()
1648
+ .withReasonCode(src_1.ReasonCode.Other)
1649
+ .withDescription("JAVA-Query")
1650
+ .execute(), src_1.GatewayError)];
1651
+ case 3:
1652
+ error = _a.sent();
1653
+ t.truthy(error.message);
1654
+ return [2 /*return*/];
1655
+ }
1656
+ });
1657
+ }); });
1658
+ ava_1.default("JAVA_Release_013c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1659
+ var config, card, saleResponse, error;
1660
+ return __generator(this, function (_a) {
1661
+ switch (_a.label) {
1662
+ case 0:
1663
+ t.plan(2);
1664
+ config = new src_1.ServicesConfig();
1665
+ config.merchantId = "heartlandgpsandbox";
1666
+ config.accountId = "api";
1667
+ config.sharedSecret = "secret";
1668
+ config.refundPassword = "refund";
1669
+ config.rebatePassword = "rebate";
1670
+ config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1671
+ config.timeout = 5000;
1672
+ config.channel = "ECOOOOOOOOM";
1673
+ src_1.ServicesContainer.configure(config);
1674
+ card = new src_1.CreditCardData();
1675
+ card.number = "4263970000005262";
1676
+ card.expMonth = "12";
1677
+ card.expYear = "2020";
1678
+ card.cvn = "123";
1679
+ card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1680
+ card.cardHolderName = "James Mason";
1681
+ return [4 /*yield*/, card
1682
+ .charge(10)
1683
+ .withCurrency("EUR")
1684
+ .execute()];
1685
+ case 1:
1686
+ saleResponse = _a.sent();
1687
+ t.truthy(saleResponse);
1688
+ t.is("00", saleResponse.responseCode);
1689
+ return [4 /*yield*/, throttle()];
1690
+ case 2:
1691
+ _a.sent();
1692
+ return [4 /*yield*/, t.throws(saleResponse
1693
+ .hold()
1694
+ .withReasonCode(src_1.ReasonCode.Other)
1695
+ .withDescription("JAVA-Query")
1696
+ .execute(), src_1.GatewayError)];
1697
+ case 3:
1698
+ error = _a.sent();
1699
+ t.truthy(error.message);
1700
+ return [2 /*return*/];
1701
+ }
1702
+ });
1703
+ }); });