globalpayments-api 3.9.0 → 3.10.1

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 (200) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/LICENSE.md +257 -257
  3. package/README.md +141 -141
  4. package/lib/src/Builders/AuthorizationBuilder.d.ts +10 -1
  5. package/lib/src/Builders/AuthorizationBuilder.js +12 -0
  6. package/lib/src/Builders/AuthorizationBuilder.js.map +1 -1
  7. package/lib/src/Builders/ManagementBuilder.d.ts +9 -1
  8. package/lib/src/Builders/ManagementBuilder.js +11 -0
  9. package/lib/src/Builders/ManagementBuilder.js.map +1 -1
  10. package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js +13 -0
  11. package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js.map +1 -1
  12. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.d.ts +4 -1
  13. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +14 -0
  14. package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -1
  15. package/lib/src/Entities/DccRateData.d.ts +61 -0
  16. package/lib/src/Entities/DccRateData.js +64 -0
  17. package/lib/src/Entities/DccRateData.js.map +1 -0
  18. package/lib/src/Entities/Enums/DccProcessor.d.ts +4 -0
  19. package/lib/src/Entities/Enums/DccProcessor.js +9 -0
  20. package/lib/src/Entities/Enums/DccProcessor.js.map +1 -0
  21. package/lib/src/Entities/Enums/DccRateType.d.ts +4 -0
  22. package/lib/src/Entities/Enums/DccRateType.js +9 -0
  23. package/lib/src/Entities/Enums/DccRateType.js.map +1 -0
  24. package/lib/src/Entities/Enums.d.ts +1 -0
  25. package/lib/src/Entities/Enums.js +1 -0
  26. package/lib/src/Entities/Enums.js.map +1 -1
  27. package/lib/src/Entities/Transaction.d.ts +2 -1
  28. package/lib/src/Entities/Transaction.js +1 -0
  29. package/lib/src/Entities/Transaction.js.map +1 -1
  30. package/lib/src/Entities/index.d.ts +7 -0
  31. package/lib/src/Entities/index.js +7 -0
  32. package/lib/src/Entities/index.js.map +1 -1
  33. package/lib/src/Gateways/PorticoConnector.d.ts +3 -3
  34. package/lib/src/Mapping/GpApiMapping.d.ts +2 -0
  35. package/lib/src/Mapping/GpApiMapping.js +27 -0
  36. package/lib/src/Mapping/GpApiMapping.js.map +1 -1
  37. package/lib/src/PaymentMethods/Credit.d.ts +2 -1
  38. package/lib/src/PaymentMethods/Credit.js +12 -0
  39. package/lib/src/PaymentMethods/Credit.js.map +1 -1
  40. package/lib/test/Integration/Gateways/GpApiConnector/DccCardNotPresent.test.js +256 -0
  41. package/lib/test/Integration/Gateways/GpApiConnector/DccCardNotPresent.test.js.map +1 -0
  42. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +4 -8
  43. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -1
  44. package/package.json +2 -2
  45. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js +0 -1029
  46. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +0 -1
  47. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.d.ts +0 -1
  48. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js +0 -649
  49. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +0 -1
  50. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.d.ts +0 -1
  51. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +0 -109
  52. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +0 -1
  53. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.d.ts +0 -1
  54. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +0 -1025
  55. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +0 -1
  56. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.d.ts +0 -1
  57. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +0 -439
  58. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +0 -1
  59. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.d.ts +0 -1
  60. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js +0 -143
  61. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +0 -1
  62. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.d.ts +0 -1
  63. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js +0 -639
  64. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +0 -1
  65. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.d.ts +0 -1
  66. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +0 -149
  67. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +0 -1
  68. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.d.ts +0 -1
  69. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js +0 -226
  70. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +0 -1
  71. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.d.ts +0 -1
  72. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js +0 -434
  73. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +0 -1
  74. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +0 -1
  75. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +0 -217
  76. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +0 -1
  77. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.d.ts +0 -1
  78. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js +0 -338
  79. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +0 -1
  80. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.d.ts +0 -1
  81. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js +0 -2446
  82. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +0 -1
  83. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.d.ts +0 -1
  84. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js +0 -506
  85. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +0 -1
  86. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.d.ts +0 -1
  87. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js +0 -1296
  88. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +0 -1
  89. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.d.ts +0 -1
  90. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js +0 -847
  91. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +0 -1
  92. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.d.ts +0 -1
  93. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js +0 -215
  94. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  95. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.d.ts +0 -1
  96. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +0 -99
  97. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +0 -1
  98. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.d.ts +0 -1
  99. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +0 -133
  100. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +0 -1
  101. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
  102. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -59
  103. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +0 -1
  104. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
  105. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -378
  106. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +0 -1
  107. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
  108. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -86
  109. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +0 -1
  110. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
  111. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1723
  112. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +0 -1
  113. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
  114. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -86
  115. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +0 -1
  116. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
  117. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1760
  118. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +0 -1
  119. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
  120. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -420
  121. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +0 -1
  122. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
  123. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2221
  124. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +0 -1
  125. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
  126. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -392
  127. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +0 -1
  128. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
  129. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -88
  130. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +0 -1
  131. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
  132. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -72
  133. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +0 -1
  134. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
  135. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -143
  136. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +0 -1
  137. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
  138. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -147
  139. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +0 -1
  140. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.d.ts +0 -1
  141. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js +0 -48
  142. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +0 -1
  143. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
  144. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -101
  145. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +0 -1
  146. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
  147. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -50
  148. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +0 -1
  149. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.d.ts +0 -1
  150. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js +0 -44
  151. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +0 -1
  152. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.d.ts +0 -1
  153. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js +0 -221
  154. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +0 -1
  155. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.d.ts +0 -1
  156. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js +0 -60
  157. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +0 -1
  158. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.d.ts +0 -1
  159. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js +0 -80
  160. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +0 -1
  161. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.d.ts +0 -1
  162. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js +0 -44
  163. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +0 -1
  164. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.d.ts +0 -1
  165. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js +0 -330
  166. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +0 -1
  167. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.d.ts +0 -1
  168. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js +0 -60
  169. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +0 -1
  170. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.d.ts +0 -1
  171. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js +0 -80
  172. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +0 -1
  173. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.d.ts +0 -1
  174. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +0 -149
  175. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +0 -1
  176. package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
  177. package/lib/test/Integration/Services/CheckServiceTest.js +0 -45
  178. package/lib/test/Integration/Services/CheckServiceTest.js.map +0 -1
  179. package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
  180. package/lib/test/Integration/Services/CreditServiceTest.js +0 -174
  181. package/lib/test/Integration/Services/CreditServiceTest.js.map +0 -1
  182. package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
  183. package/lib/test/Integration/Services/DebitServiceTest.js +0 -81
  184. package/lib/test/Integration/Services/DebitServiceTest.js.map +0 -1
  185. package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
  186. package/lib/test/Integration/Services/EBTServiceTest.js +0 -64
  187. package/lib/test/Integration/Services/EBTServiceTest.js.map +0 -1
  188. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
  189. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -111
  190. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +0 -1
  191. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
  192. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -62
  193. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +0 -1
  194. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.d.ts +0 -1
  195. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js +0 -34
  196. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  197. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
  198. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -125
  199. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +0 -1
  200. /package/lib/test/Integration/Gateways/GpApiConnector/{3DS2Test.d.ts → DccCardNotPresent.test.d.ts} +0 -0
@@ -1,847 +0,0 @@
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 ServiceConfigs_1 = require("../../../../../src/ServiceConfigs");
9
- const config = new ServiceConfigs_1.GpEcomConfig();
10
- config.merchantId = "heartlandgpsandbox";
11
- config.accountId = "api";
12
- config.sharedSecret = "secret";
13
- config.refundPassword = "refund";
14
- config.rebatePassword = "rebate";
15
- config.timeout = 5000;
16
- config.channel = "ECOM";
17
- const configWithoutChannel = new ServiceConfigs_1.GpEcomConfig();
18
- configWithoutChannel.merchantId = "heartlandgpsandbox";
19
- configWithoutChannel.accountId = "api";
20
- configWithoutChannel.sharedSecret = "secret";
21
- configWithoutChannel.refundPassword = "refund";
22
- configWithoutChannel.rebatePassword = "rebate";
23
- configWithoutChannel.serviceUrl =
24
- "https://api.sandbox.realexpayments.com/epage-remote.cgi";
25
- configWithoutChannel.timeout = 5000;
26
- ava_1.default.before(() => {
27
- src_1.ServicesContainer.configureService(config);
28
- src_1.ServicesContainer.configureService(configWithoutChannel, "withoutChannel");
29
- });
30
- const throttle = () => new Promise((resolve) => setTimeout(resolve, 1500));
31
- ava_1.default.beforeEach(async () => {
32
- await throttle();
33
- });
34
- ava_1.default.skip("JAVA_Hold_Sample", async (t) => {
35
- t.plan(4);
36
- // create card
37
- const card = new src_1.CreditCardData();
38
- card.number = "4263970000005262";
39
- card.expMonth = "12";
40
- card.expYear = "2023";
41
- card.cvn = "123";
42
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
43
- card.cardHolderName = "James Mason";
44
- // build transaction
45
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
46
- t.truthy(saleResponse);
47
- t.is("00", saleResponse.responseCode);
48
- await throttle();
49
- // request
50
- const response = await saleResponse
51
- .hold()
52
- .withReasonCode(src_1.ReasonCode.Fraud)
53
- .withDescription("JAVA-Hold")
54
- .execute();
55
- t.truthy(response);
56
- t.is("00", response.responseCode);
57
- });
58
- (0, ava_1.default)("JAVA_Hold_006a", async (t) => {
59
- t.plan(4);
60
- // create card
61
- const card = new src_1.CreditCardData();
62
- card.number = "4263970000005262";
63
- card.expMonth = "12";
64
- card.expYear = "2023";
65
- card.cvn = "123";
66
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
67
- card.cardHolderName = "James Mason";
68
- // build transaction
69
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
70
- t.truthy(saleResponse);
71
- t.is("00", saleResponse.responseCode);
72
- await throttle();
73
- // request
74
- const response = await saleResponse
75
- .hold()
76
- .withReasonCode(src_1.ReasonCode.Fraud)
77
- .withDescription("JAVA-Hold")
78
- .execute();
79
- t.truthy(response);
80
- t.is("00", response.responseCode);
81
- });
82
- (0, ava_1.default)("JAVA_Hold_006b", async (t) => {
83
- t.plan(4);
84
- // create card
85
- const card = new src_1.CreditCardData();
86
- card.number = "4263970000005262";
87
- card.expMonth = "12";
88
- card.expYear = "2023";
89
- card.cvn = "123";
90
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
91
- card.cardHolderName = "James Mason";
92
- // build transaction
93
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
94
- t.truthy(saleResponse);
95
- t.is("00", saleResponse.responseCode);
96
- await throttle();
97
- // request
98
- const response = await saleResponse
99
- .hold()
100
- .withReasonCode(src_1.ReasonCode.Fraud)
101
- .withDescription("JAVA-Hold")
102
- .execute();
103
- t.truthy(response);
104
- t.is("00", response.responseCode);
105
- });
106
- (0, ava_1.default)("JAVA_Hold_006c", async (t) => {
107
- t.plan(4);
108
- // create card
109
- const card = new src_1.CreditCardData();
110
- card.number = "4263970000005262";
111
- card.expMonth = "12";
112
- card.expYear = "2023";
113
- card.cvn = "123";
114
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
115
- card.cardHolderName = "James Mason";
116
- // build transaction
117
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
118
- t.truthy(saleResponse);
119
- t.is("00", saleResponse.responseCode);
120
- await throttle();
121
- // request
122
- const response = await saleResponse
123
- .hold()
124
- .withReasonCode(src_1.ReasonCode.Fraud)
125
- .withDescription("JAVA-Hold")
126
- .execute();
127
- t.truthy(response);
128
- t.is("00", response.responseCode);
129
- });
130
- (0, ava_1.default)("JAVA_Hold_006d", async (t) => {
131
- t.plan(4);
132
- // create card
133
- const card = new src_1.CreditCardData();
134
- card.number = "4263970000005262";
135
- card.expMonth = "12";
136
- card.expYear = "2023";
137
- card.cvn = "123";
138
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
139
- card.cardHolderName = "James Mason";
140
- // build transaction
141
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
142
- t.truthy(saleResponse);
143
- t.is("00", saleResponse.responseCode);
144
- await throttle();
145
- // request
146
- const response = await saleResponse
147
- .hold()
148
- .withReasonCode(src_1.ReasonCode.Fraud)
149
- .withDescription("JAVA-Hold")
150
- .execute();
151
- t.truthy(response);
152
- t.is("00", response.responseCode);
153
- });
154
- (0, ava_1.default)("JAVA_Hold_006e", async (t) => {
155
- t.plan(4);
156
- // create card
157
- const card = new src_1.CreditCardData();
158
- card.number = "4263970000005262";
159
- card.expMonth = "12";
160
- card.expYear = "2023";
161
- card.cvn = "123";
162
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
163
- card.cardHolderName = "James Mason";
164
- // build transaction
165
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
166
- t.truthy(saleResponse);
167
- t.is("00", saleResponse.responseCode);
168
- await throttle();
169
- // request
170
- const response = await saleResponse
171
- .hold()
172
- .withReasonCode(src_1.ReasonCode.Fraud)
173
- .withDescription("JAVA-Hold")
174
- .execute();
175
- t.truthy(response);
176
- t.is("00", response.responseCode);
177
- });
178
- (0, ava_1.default)("JAVA_Hold_006f", async (t) => {
179
- // create card
180
- const card = new src_1.CreditCardData();
181
- card.number = "4263970000005262";
182
- card.expMonth = "12";
183
- card.expYear = "2023";
184
- card.cvn = "123";
185
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
186
- card.cardHolderName = "James Mason";
187
- // build transaction
188
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
189
- t.truthy(saleResponse);
190
- t.is("00", saleResponse.responseCode);
191
- await throttle();
192
- // request
193
- const response = await saleResponse
194
- .hold()
195
- .withReasonCode(src_1.ReasonCode.Fraud)
196
- .withDescription("JAVA-Hold")
197
- .execute();
198
- t.truthy(response);
199
- t.is("00", response.responseCode);
200
- });
201
- (0, ava_1.default)("JAVA_Hold_006g", async (t) => {
202
- // create card
203
- const card = new src_1.CreditCardData();
204
- card.number = "4263970000005262";
205
- card.expMonth = "12";
206
- card.expYear = "2023";
207
- card.cvn = "123";
208
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
209
- card.cardHolderName = "James Mason";
210
- // build transaction
211
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
212
- t.truthy(saleResponse);
213
- t.is("00", saleResponse.responseCode);
214
- await throttle();
215
- // request
216
- const response = await saleResponse
217
- .hold()
218
- .withReasonCode(src_1.ReasonCode.Fraud)
219
- .withDescription("JAVA-Hold")
220
- .execute();
221
- t.truthy(response);
222
- t.is("00", response.responseCode);
223
- });
224
- (0, ava_1.default)("JAVA_Hold_006h", async (t) => {
225
- // create card
226
- const card = new src_1.CreditCardData();
227
- card.number = "4263970000005262";
228
- card.expMonth = "12";
229
- card.expYear = "2023";
230
- card.cvn = "123";
231
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
232
- card.cardHolderName = "James Mason";
233
- // build transaction
234
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
235
- t.truthy(saleResponse);
236
- t.is("00", saleResponse.responseCode);
237
- await throttle();
238
- // request
239
- const response = await saleResponse
240
- .hold()
241
- .withReasonCode(src_1.ReasonCode.Fraud)
242
- .withDescription("JAVA-Hold")
243
- .execute();
244
- t.truthy(response);
245
- t.is("00", response.responseCode);
246
- });
247
- (0, ava_1.default)("JAVA_Hold_006i", async (t) => {
248
- // create card
249
- const card = new src_1.CreditCardData();
250
- card.number = "4263970000005262";
251
- card.expMonth = "12";
252
- card.expYear = "2023";
253
- card.cvn = "123";
254
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
255
- card.cardHolderName = "James Mason";
256
- // build transaction
257
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
258
- t.truthy(saleResponse);
259
- t.is("00", saleResponse.responseCode);
260
- await throttle();
261
- // request
262
- const response = await saleResponse
263
- .hold()
264
- .withReasonCode(src_1.ReasonCode.Fraud)
265
- .withDescription("JAVA-Hold")
266
- .execute();
267
- t.truthy(response);
268
- t.is("00", response.responseCode);
269
- });
270
- ava_1.default.skip("JAVA_Hold_006k", async (t) => {
271
- // create card
272
- const card = new src_1.CreditCardData();
273
- card.number = "4263970000005262";
274
- card.expMonth = "12";
275
- card.expYear = "2023";
276
- card.cvn = "123";
277
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
278
- card.cardHolderName = "James Mason";
279
- // build transaction
280
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
281
- t.truthy(saleResponse);
282
- t.is("00", saleResponse.responseCode);
283
- await throttle();
284
- // request
285
- const response = await saleResponse
286
- .hold()
287
- .withReasonCode(src_1.ReasonCode.Fraud)
288
- .withDescription("JAVA-Hold")
289
- .execute();
290
- t.truthy(response);
291
- t.is("00", response.responseCode);
292
- });
293
- ava_1.default.skip("JAVA_Hold_006l", async (t) => {
294
- // create card
295
- const card = new src_1.CreditCardData();
296
- card.number = "4263970000005262";
297
- card.expMonth = "12";
298
- card.expYear = "2023";
299
- card.cvn = "123";
300
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
301
- card.cardHolderName = "James Mason";
302
- // build transaction
303
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
304
- t.truthy(saleResponse);
305
- t.is("00", saleResponse.responseCode);
306
- await throttle();
307
- // request
308
- const response = await saleResponse
309
- .hold()
310
- .withReasonCode(src_1.ReasonCode.Fraud)
311
- .withDescription("JAVA-Hold")
312
- .execute();
313
- t.truthy(response);
314
- t.is("00", response.responseCode);
315
- });
316
- ava_1.default.skip("JAVA_Hold_007a", async (t) => {
317
- t.plan(2);
318
- // create card
319
- const card = new src_1.CreditCardData();
320
- card.number = "4263970000005262";
321
- card.expMonth = "12";
322
- card.expYear = "2023";
323
- card.cvn = "123";
324
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
325
- card.cardHolderName = "James Mason";
326
- // build transaction
327
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
328
- t.truthy(saleResponse);
329
- t.is("00", saleResponse.responseCode);
330
- await throttle();
331
- // request
332
- const response = await saleResponse
333
- .hold()
334
- .withReasonCode(src_1.ReasonCode.Fraud)
335
- .withDescription("JAVA-Hold")
336
- .execute();
337
- t.truthy(response);
338
- t.is("00", response.responseCode);
339
- });
340
- ava_1.default.skip("JAVA_Hold_007b", async (t) => {
341
- t.plan(2);
342
- // create card
343
- const card = new src_1.CreditCardData();
344
- card.number = "4263970000005262";
345
- card.expMonth = "12";
346
- card.expYear = "2023";
347
- card.cvn = "123";
348
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
349
- card.cardHolderName = "James Mason";
350
- // build transaction
351
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
352
- t.truthy(saleResponse);
353
- t.is("00", saleResponse.responseCode);
354
- await throttle();
355
- // request
356
- const response = await saleResponse
357
- .hold()
358
- .withReasonCode(src_1.ReasonCode.Fraud)
359
- .withDescription("JAVA-Hold")
360
- .execute();
361
- t.truthy(response);
362
- t.is("00", response.responseCode);
363
- });
364
- ava_1.default.skip("JAVA_Hold_007c", async (t) => {
365
- t.plan(2);
366
- // create card
367
- const card = new src_1.CreditCardData();
368
- card.number = "4263970000005262";
369
- card.expMonth = "12";
370
- card.expYear = "2023";
371
- card.cvn = "123";
372
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
373
- card.cardHolderName = "James Mason";
374
- // build transaction
375
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
376
- t.truthy(saleResponse);
377
- t.is("00", saleResponse.responseCode);
378
- await throttle();
379
- // request
380
- const response = await saleResponse
381
- .hold()
382
- .withReasonCode(src_1.ReasonCode.Fraud)
383
- .withDescription("JAVA-Hold")
384
- .execute();
385
- t.truthy(response);
386
- t.is("00", response.responseCode);
387
- });
388
- (0, ava_1.default)("JAVA_Hold_007d", async (t) => {
389
- t.plan(2);
390
- const saleResponse = src_1.Transaction.fromId(undefined);
391
- // request
392
- const error = t.throws(() => saleResponse
393
- .hold()
394
- .withReasonCode(src_1.ReasonCode.Fraud)
395
- .execute("withoutChannel"), { instanceOf: src_1.BuilderError });
396
- t.truthy(error?.message);
397
- });
398
- (0, ava_1.default)("JAVA_Hold_007e", async (t) => {
399
- t.plan(2);
400
- const saleResponse = src_1.Transaction.fromId(undefined);
401
- // request
402
- const error = t.throws(() => saleResponse
403
- .hold()
404
- .withReasonCode(src_1.ReasonCode.Fraud)
405
- .execute("withoutChannel"), { instanceOf: src_1.BuilderError });
406
- t.truthy(error?.message);
407
- });
408
- ava_1.default.skip("JAVA_Hold_008a", async (t) => {
409
- t.plan(2);
410
- // create card
411
- const card = new src_1.CreditCardData();
412
- card.number = "4263970000005262";
413
- card.expMonth = "12";
414
- card.expYear = "2023";
415
- card.cvn = "123";
416
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
417
- card.cardHolderName = "James Mason";
418
- // build transaction
419
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
420
- t.truthy(saleResponse);
421
- t.is("00", saleResponse.responseCode);
422
- await throttle();
423
- // request
424
- const response = await saleResponse
425
- .hold()
426
- .withReasonCode(src_1.ReasonCode.Fraud)
427
- .withDescription("JAVA-Hold")
428
- .execute();
429
- t.truthy(response);
430
- t.is("00", response.responseCode);
431
- });
432
- ava_1.default.skip("JAVA_Hold_008b", async (t) => {
433
- t.plan(2);
434
- // create card
435
- const card = new src_1.CreditCardData();
436
- card.number = "4263970000005262";
437
- card.expMonth = "12";
438
- card.expYear = "2023";
439
- card.cvn = "123";
440
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
441
- card.cardHolderName = "James Mason";
442
- // build transaction
443
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
444
- t.truthy(saleResponse);
445
- t.is("00", saleResponse.responseCode);
446
- await throttle();
447
- // request
448
- const response = await saleResponse
449
- .hold()
450
- .withReasonCode(src_1.ReasonCode.Fraud)
451
- .withDescription("JAVA-Hold")
452
- .execute();
453
- t.truthy(response);
454
- t.is("00", response.responseCode);
455
- });
456
- (0, ava_1.default)("JAVA_Hold_008c", async (t) => {
457
- t.plan(2);
458
- const saleResponse = src_1.Transaction.fromId(undefined);
459
- // request
460
- const error = t.throws(() => saleResponse
461
- .hold()
462
- .withReasonCode(src_1.ReasonCode.Fraud)
463
- .execute("withoutChannel"), { instanceOf: src_1.BuilderError });
464
- t.truthy(error?.message);
465
- });
466
- (0, ava_1.default)("JAVA_Hold_008d", async (t) => {
467
- t.plan(2);
468
- const saleResponse = src_1.Transaction.fromId(undefined);
469
- // request
470
- const error = t.throws(() => saleResponse
471
- .hold()
472
- .withReasonCode(src_1.ReasonCode.Fraud)
473
- .execute("withoutChannel"), { instanceOf: src_1.BuilderError });
474
- t.truthy(error?.message);
475
- });
476
- (0, ava_1.default)("JAVA_Hold_008e", async (t) => {
477
- t.plan(2);
478
- const saleResponse = src_1.Transaction.fromId(undefined);
479
- // request
480
- const error = t.throws(() => saleResponse
481
- .hold()
482
- .withReasonCode(src_1.ReasonCode.Fraud)
483
- .execute("withoutChannel"), { instanceOf: src_1.BuilderError });
484
- t.truthy(error?.message);
485
- });
486
- ava_1.default.skip("JAVA_Hold_009c", async (t) => {
487
- t.plan(2);
488
- // create card
489
- const card = new src_1.CreditCardData();
490
- card.number = "4263970000005262";
491
- card.expMonth = "12";
492
- card.expYear = "2023";
493
- card.cvn = "123";
494
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
495
- card.cardHolderName = "James Mason";
496
- // build transaction
497
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
498
- t.truthy(saleResponse);
499
- t.is("00", saleResponse.responseCode);
500
- await throttle();
501
- // request
502
- const response = await saleResponse
503
- .hold()
504
- .withReasonCode(src_1.ReasonCode.Fraud)
505
- .withDescription("JAVA-Hold")
506
- .execute();
507
- t.truthy(response);
508
- t.is("00", response.responseCode);
509
- });
510
- (0, ava_1.default)("JAVA_Hold_009d", async (t) => {
511
- t.plan(2);
512
- const saleResponse = src_1.Transaction.fromId(undefined);
513
- // request
514
- const error = t.throws(() => saleResponse
515
- .hold()
516
- .withReasonCode(src_1.ReasonCode.Fraud)
517
- .withDescription("SDK-JAVA-Query")
518
- .execute(), { instanceOf: src_1.BuilderError });
519
- t.truthy(error?.message);
520
- });
521
- (0, ava_1.default)("JAVA_Hold_009e", async (t) => {
522
- t.plan(2);
523
- const saleResponse = src_1.Transaction.fromId(undefined);
524
- // request
525
- const error = t.throws(() => saleResponse
526
- .hold()
527
- .withReasonCode(src_1.ReasonCode.Fraud)
528
- .withDescription("SDK-JAVA-Query")
529
- .execute(), { instanceOf: src_1.BuilderError });
530
- t.truthy(error?.message);
531
- });
532
- ava_1.default.skip("JAVA_Hold_010a", async (t) => {
533
- t.plan(2);
534
- // create card
535
- const card = new src_1.CreditCardData();
536
- card.number = "4263970000005262";
537
- card.expMonth = "12";
538
- card.expYear = "2023";
539
- card.cvn = "123";
540
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
541
- card.cardHolderName = "James Mason";
542
- // build transaction
543
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
544
- t.truthy(saleResponse);
545
- t.is("00", saleResponse.responseCode);
546
- await throttle();
547
- // request
548
- const response = await saleResponse
549
- .hold()
550
- .withReasonCode(src_1.ReasonCode.Fraud)
551
- .withDescription("JAVA-Hold")
552
- .execute();
553
- t.truthy(response);
554
- t.is("00", response.responseCode);
555
- });
556
- (0, ava_1.default)("JAVA_Hold_010b", async (t) => {
557
- // create card
558
- const card = new src_1.CreditCardData();
559
- card.number = "4263970000005262";
560
- card.expMonth = "12";
561
- card.expYear = "2023";
562
- card.cvn = "123";
563
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
564
- card.cardHolderName = "James Mason";
565
- // build transaction
566
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
567
- t.truthy(saleResponse);
568
- t.is("00", saleResponse.responseCode);
569
- await throttle();
570
- // request
571
- const response = await saleResponse
572
- .hold()
573
- .withReasonCode(src_1.ReasonCode.Fraud)
574
- .withDescription("JAVA-Hold")
575
- .execute();
576
- t.truthy(response);
577
- t.is("00", response.responseCode);
578
- });
579
- (0, ava_1.default)("JAVA_Hold_010c", async (t) => {
580
- t.plan(2);
581
- const saleResponse = src_1.Transaction.fromId(undefined);
582
- // request
583
- const error = t.throws(() => saleResponse
584
- .hold()
585
- .withReasonCode(src_1.ReasonCode.Fraud)
586
- .withDescription("JAVA-Hold")
587
- .execute(), { instanceOf: src_1.BuilderError });
588
- t.truthy(error?.message);
589
- });
590
- ava_1.default.skip("JAVA_Hold_010d", async (t) => {
591
- t.plan(2);
592
- // create card
593
- const card = new src_1.CreditCardData();
594
- card.number = "4263970000005262";
595
- card.expMonth = "12";
596
- card.expYear = "2023";
597
- card.cvn = "123";
598
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
599
- card.cardHolderName = "James Mason";
600
- // build transaction
601
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
602
- t.truthy(saleResponse);
603
- t.is("00", saleResponse.responseCode);
604
- await throttle();
605
- // request
606
- const response = await saleResponse
607
- .hold()
608
- .withReasonCode(src_1.ReasonCode.Fraud)
609
- .withDescription("JAVA-Hold")
610
- .execute();
611
- t.truthy(response);
612
- t.is("00", response.responseCode);
613
- });
614
- (0, ava_1.default)("JAVA_Hold_011a", async (t) => {
615
- // create card
616
- const card = new src_1.CreditCardData();
617
- card.number = "4263970000005262";
618
- card.expMonth = "12";
619
- card.expYear = "2023";
620
- card.cvn = "123";
621
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
622
- card.cardHolderName = "James Mason";
623
- // build transaction
624
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
625
- t.truthy(saleResponse);
626
- t.is("00", saleResponse.responseCode);
627
- await throttle();
628
- // request
629
- const response = await saleResponse
630
- .hold()
631
- .withReasonCode(src_1.ReasonCode.Fraud)
632
- .withDescription("JAVA-Hold")
633
- .execute();
634
- t.truthy(response);
635
- t.is("00", response.responseCode);
636
- });
637
- (0, ava_1.default)("JAVA_Hold_011b", async (t) => {
638
- // create card
639
- const card = new src_1.CreditCardData();
640
- card.number = "4263970000005262";
641
- card.expMonth = "12";
642
- card.expYear = "2023";
643
- card.cvn = "123";
644
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
645
- card.cardHolderName = "James Mason";
646
- // build transaction
647
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
648
- t.truthy(saleResponse);
649
- t.is("00", saleResponse.responseCode);
650
- await throttle();
651
- // request
652
- const response = await saleResponse
653
- .hold()
654
- .withReasonCode(undefined)
655
- .withDescription("JAVA-Hold")
656
- .execute();
657
- t.truthy(response);
658
- t.is("00", response.responseCode);
659
- });
660
- (0, ava_1.default)("JAVA_Hold_011c", async (t) => {
661
- // create card
662
- const card = new src_1.CreditCardData();
663
- card.number = "4263970000005262";
664
- card.expMonth = "12";
665
- card.expYear = "2023";
666
- card.cvn = "123";
667
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
668
- card.cardHolderName = "James Mason";
669
- // build transaction
670
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
671
- t.truthy(saleResponse);
672
- t.is("00", saleResponse.responseCode);
673
- await throttle();
674
- // request
675
- const response = await saleResponse
676
- .hold()
677
- .withDescription("JAVA-Hold")
678
- .execute();
679
- t.truthy(response);
680
- t.is("00", response.responseCode);
681
- });
682
- (0, ava_1.default)("JAVA_Hold_011d", async (t) => {
683
- // create card
684
- const card = new src_1.CreditCardData();
685
- card.number = "4263970000005262";
686
- card.expMonth = "12";
687
- card.expYear = "2023";
688
- card.cvn = "123";
689
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
690
- card.cardHolderName = "James Mason";
691
- // build transaction
692
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
693
- t.truthy(saleResponse);
694
- t.is("00", saleResponse.responseCode);
695
- await throttle();
696
- // request
697
- const response = await saleResponse
698
- .hold()
699
- .withReasonCode(undefined)
700
- .withDescription("JAVA-Hold")
701
- .execute();
702
- t.truthy(response);
703
- t.is("00", response.responseCode);
704
- });
705
- (0, ava_1.default)("JAVA_Hold_012a", async (t) => {
706
- // create card
707
- const card = new src_1.CreditCardData();
708
- card.number = "4263970000005262";
709
- card.expMonth = "12";
710
- card.expYear = "2023";
711
- card.cvn = "123";
712
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
713
- card.cardHolderName = "James Mason";
714
- // build transaction
715
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
716
- t.truthy(saleResponse);
717
- t.is("00", saleResponse.responseCode);
718
- await throttle();
719
- // request
720
- const response = await saleResponse
721
- .hold()
722
- .withReasonCode(src_1.ReasonCode.Fraud)
723
- .withDescription("JAVA-Hold")
724
- .execute();
725
- t.truthy(response);
726
- t.is("00", response.responseCode);
727
- });
728
- (0, ava_1.default)("JAVA_Hold_012b", async (t) => {
729
- t.plan(2);
730
- const config = new ServiceConfigs_1.GpEcomConfig();
731
- config.merchantId = "heartlandgpsandbox";
732
- config.accountId = "api";
733
- config.sharedSecret = "secreto";
734
- config.refundPassword = "refund";
735
- config.rebatePassword = "rebate";
736
- config.timeout = 5000;
737
- config.channel = "ECOM";
738
- src_1.ServicesContainer.configureService(config);
739
- // create card
740
- const card = new src_1.CreditCardData();
741
- card.number = "4263970000005262";
742
- card.expMonth = "12";
743
- card.expYear = "2023";
744
- card.cvn = "123";
745
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
746
- card.cardHolderName = "James Mason";
747
- // build transaction
748
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
749
- t.truthy(saleResponse);
750
- t.is("00", saleResponse.responseCode);
751
- await throttle();
752
- // request
753
- const error = await t.throwsAsync(async () => await saleResponse
754
- .hold()
755
- .withReasonCode(src_1.ReasonCode.Fraud)
756
- .withDescription("SDK-JAVA-Query")
757
- .execute(), { instanceOf: src_1.GatewayError });
758
- t.truthy(error?.message);
759
- });
760
- (0, ava_1.default)("JAVA_Hold_013a", async (t) => {
761
- // create card
762
- const card = new src_1.CreditCardData();
763
- card.number = "4263970000005262";
764
- card.expMonth = "12";
765
- card.expYear = "2023";
766
- card.cvn = "123";
767
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
768
- card.cardHolderName = "James Mason";
769
- // build transaction
770
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
771
- t.truthy(saleResponse);
772
- t.is("00", saleResponse.responseCode);
773
- await throttle();
774
- // request
775
- const response = await saleResponse
776
- .hold()
777
- .withReasonCode(src_1.ReasonCode.Fraud)
778
- .withDescription("JAVA-Hold")
779
- .execute();
780
- t.truthy(response);
781
- t.is("00", response.responseCode);
782
- });
783
- (0, ava_1.default)("JAVA_Hold_013b", async (t) => {
784
- t.plan(2);
785
- const config = new ServiceConfigs_1.GpEcomConfig();
786
- config.merchantId = "heartlandgpsandbox";
787
- config.accountId = "api";
788
- config.sharedSecret = "secret";
789
- config.refundPassword = "refund";
790
- config.rebatePassword = "rebate";
791
- config.timeout = 5000;
792
- config.channel = "EC";
793
- src_1.ServicesContainer.configureService(config);
794
- // create card
795
- const card = new src_1.CreditCardData();
796
- card.number = "4263970000005262";
797
- card.expMonth = "12";
798
- card.expYear = "2023";
799
- card.cvn = "123";
800
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
801
- card.cardHolderName = "James Mason";
802
- // build transaction
803
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
804
- t.truthy(saleResponse);
805
- t.is("00", saleResponse.responseCode);
806
- await throttle();
807
- // request
808
- const error = await t.throwsAsync(async () => await saleResponse
809
- .hold()
810
- .withReasonCode(src_1.ReasonCode.Fraud)
811
- .withDescription("SDK-JAVA-Query")
812
- .execute(), { instanceOf: src_1.GatewayError });
813
- t.truthy(error?.message);
814
- });
815
- (0, ava_1.default)("JAVA_Hold_013c", async (t) => {
816
- t.plan(2);
817
- const config = new ServiceConfigs_1.GpEcomConfig();
818
- config.merchantId = "heartlandgpsandbox";
819
- config.accountId = "api";
820
- config.sharedSecret = "secret";
821
- config.refundPassword = "refund";
822
- config.rebatePassword = "rebate";
823
- config.timeout = 5000;
824
- config.channel = "ECOOOOOOOOM";
825
- src_1.ServicesContainer.configureService(config);
826
- // create card
827
- const card = new src_1.CreditCardData();
828
- card.number = "4263970000005262";
829
- card.expMonth = "12";
830
- card.expYear = "2023";
831
- card.cvn = "123";
832
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
833
- card.cardHolderName = "James Mason";
834
- // build transaction
835
- const saleResponse = await card.charge(10).withCurrency("EUR").execute();
836
- t.truthy(saleResponse);
837
- t.is("00", saleResponse.responseCode);
838
- await throttle();
839
- // request
840
- const error = await t.throwsAsync(async () => await saleResponse
841
- .hold()
842
- .withReasonCode(src_1.ReasonCode.Fraud)
843
- .withDescription("SDK-JAVA-Query")
844
- .execute(), { instanceOf: src_1.GatewayError });
845
- t.truthy(error?.message);
846
- });
847
- //# sourceMappingURL=HoldTest.js.map