globalpayments-api 3.8.0 → 3.8.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 (191) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/LICENSE.md +257 -257
  3. package/README.md +141 -141
  4. package/lib/src/Builders/ManagementBuilder.d.ts +9 -5
  5. package/lib/src/Builders/ManagementBuilder.js +44 -34
  6. package/lib/src/Builders/ManagementBuilder.js.map +1 -1
  7. package/lib/src/Entities/AdditionalTaxDetails.d.ts +5 -0
  8. package/lib/src/Entities/AdditionalTaxDetails.js +10 -0
  9. package/lib/src/Entities/AdditionalTaxDetails.js.map +1 -0
  10. package/lib/src/Entities/CommercialData.d.ts +26 -0
  11. package/lib/src/Entities/CommercialData.js +36 -0
  12. package/lib/src/Entities/CommercialData.js.map +1 -0
  13. package/lib/src/Entities/CommercialLineItem.d.ts +21 -0
  14. package/lib/src/Entities/CommercialLineItem.js +24 -0
  15. package/lib/src/Entities/CommercialLineItem.js.map +1 -0
  16. package/lib/src/Entities/DiscountDetails.d.ts +8 -0
  17. package/lib/src/Entities/DiscountDetails.js +13 -0
  18. package/lib/src/Entities/DiscountDetails.js.map +1 -0
  19. package/lib/src/Entities/Enums.d.ts +10 -1
  20. package/lib/src/Entities/Enums.js +13 -2
  21. package/lib/src/Entities/Enums.js.map +1 -1
  22. package/lib/src/Entities/Transaction.js +3 -0
  23. package/lib/src/Entities/Transaction.js.map +1 -1
  24. package/lib/src/Entities/TransactionSummary.d.ts +1 -0
  25. package/lib/src/Entities/TransactionSummary.js +1 -0
  26. package/lib/src/Entities/TransactionSummary.js.map +1 -1
  27. package/lib/src/Gateways/PayPlanConnector.d.ts +1 -1
  28. package/lib/src/Gateways/PorticoConnector.d.ts +3 -3
  29. package/lib/src/Gateways/PorticoConnector.js +117 -4
  30. package/lib/src/Gateways/PorticoConnector.js.map +1 -1
  31. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js +17 -17
  32. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/Ecommerce.test.js.map +1 -1
  33. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +66 -0
  34. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -1
  35. package/package.json +1 -1
  36. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.d.ts +0 -1
  37. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js +0 -1029
  38. package/lib/test/Integration/Gateways/GpApiConnector/3DS2Test.js.map +0 -1
  39. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.d.ts +0 -1
  40. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js +0 -649
  41. package/lib/test/Integration/Gateways/GpApiConnector/3DSecureTest.js.map +0 -1
  42. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.d.ts +0 -1
  43. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +0 -109
  44. package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +0 -1
  45. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.d.ts +0 -1
  46. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +0 -1025
  47. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +0 -1
  48. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.d.ts +0 -1
  49. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js +0 -439
  50. package/lib/test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.js.map +0 -1
  51. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.d.ts +0 -1
  52. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js +0 -143
  53. package/lib/test/Integration/Gateways/GpApiConnector/DebitCardTest.js.map +0 -1
  54. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.d.ts +0 -1
  55. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js +0 -639
  56. package/lib/test/Integration/Gateways/GpApiConnector/GpApiCertificationTest.js.map +0 -1
  57. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.d.ts +0 -1
  58. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js +0 -149
  59. package/lib/test/Integration/Gateways/GpApiConnector/GpApiTokenManagementTest.js.map +0 -1
  60. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.d.ts +0 -1
  61. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js +0 -226
  62. package/lib/test/Integration/Gateways/GpApiConnector/ReportingDepositsTest.js.map +0 -1
  63. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.d.ts +0 -1
  64. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js +0 -434
  65. package/lib/test/Integration/Gateways/GpApiConnector/ReportingSettlementTransactionsTest.js.map +0 -1
  66. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +0 -1
  67. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +0 -217
  68. package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +0 -1
  69. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.d.ts +0 -1
  70. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js +0 -338
  71. package/lib/test/Integration/Gateways/GpApiConnector/ReportingTransactionsTest.js.map +0 -1
  72. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.d.ts +0 -1
  73. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js +0 -2446
  74. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AuthTest.js.map +0 -1
  75. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.d.ts +0 -1
  76. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js +0 -506
  77. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/AvsTest.js.map +0 -1
  78. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.d.ts +0 -1
  79. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js +0 -1296
  80. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/CreditTest.js.map +0 -1
  81. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.d.ts +0 -1
  82. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js +0 -847
  83. package/lib/test/Integration/Gateways/GpEcomConnector/Certification/HoldTest.js.map +0 -1
  84. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.d.ts +0 -1
  85. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js +0 -215
  86. package/lib/test/Integration/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  87. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.d.ts +0 -1
  88. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js +0 -99
  89. package/lib/test/Integration/Gateways/GpEcomConnector/HppTest.js.map +0 -1
  90. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.d.ts +0 -1
  91. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js +0 -133
  92. package/lib/test/Integration/Gateways/GpEcomConnector/RecurringTest.js.map +0 -1
  93. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
  94. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -59
  95. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js.map +0 -1
  96. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
  97. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -378
  98. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js.map +0 -1
  99. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
  100. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -86
  101. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js.map +0 -1
  102. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
  103. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1723
  104. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js.map +0 -1
  105. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
  106. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -86
  107. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js.map +0 -1
  108. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
  109. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1760
  110. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js.map +0 -1
  111. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
  112. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -420
  113. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js.map +0 -1
  114. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
  115. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2221
  116. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js.map +0 -1
  117. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
  118. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -392
  119. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js.map +0 -1
  120. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
  121. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -88
  122. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js.map +0 -1
  123. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
  124. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -72
  125. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js.map +0 -1
  126. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
  127. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -143
  128. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js.map +0 -1
  129. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
  130. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -147
  131. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js.map +0 -1
  132. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.d.ts +0 -1
  133. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js +0 -48
  134. package/lib/test/Integration/Gateways/PorticoConnector/PorticoManagementTokenTest.js.map +0 -1
  135. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
  136. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -101
  137. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js.map +0 -1
  138. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
  139. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -50
  140. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js.map +0 -1
  141. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.d.ts +0 -1
  142. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js +0 -44
  143. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTest.js.map +0 -1
  144. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.d.ts +0 -1
  145. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js +0 -221
  146. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTest.js.map +0 -1
  147. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.d.ts +0 -1
  148. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js +0 -60
  149. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTest.js.map +0 -1
  150. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.d.ts +0 -1
  151. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js +0 -80
  152. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTest.js.map +0 -1
  153. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.d.ts +0 -1
  154. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js +0 -44
  155. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTest.js.map +0 -1
  156. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.d.ts +0 -1
  157. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js +0 -330
  158. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTest.js.map +0 -1
  159. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.d.ts +0 -1
  160. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js +0 -60
  161. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTest.js.map +0 -1
  162. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.d.ts +0 -1
  163. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js +0 -80
  164. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTest.js.map +0 -1
  165. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.d.ts +0 -1
  166. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js +0 -149
  167. package/lib/test/Integration/Gateways/Terminals/UPA/UpaMicTest.js.map +0 -1
  168. package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
  169. package/lib/test/Integration/Services/CheckServiceTest.js +0 -45
  170. package/lib/test/Integration/Services/CheckServiceTest.js.map +0 -1
  171. package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
  172. package/lib/test/Integration/Services/CreditServiceTest.js +0 -174
  173. package/lib/test/Integration/Services/CreditServiceTest.js.map +0 -1
  174. package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
  175. package/lib/test/Integration/Services/DebitServiceTest.js +0 -81
  176. package/lib/test/Integration/Services/DebitServiceTest.js.map +0 -1
  177. package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
  178. package/lib/test/Integration/Services/EBTServiceTest.js +0 -64
  179. package/lib/test/Integration/Services/EBTServiceTest.js.map +0 -1
  180. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
  181. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -111
  182. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js.map +0 -1
  183. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
  184. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -62
  185. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js.map +0 -1
  186. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.d.ts +0 -1
  187. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js +0 -34
  188. package/lib/test/Unit/Gateways/GpEcomConnector/CreditTest.js.map +0 -1
  189. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
  190. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -125
  191. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js.map +0 -1
package/README.md CHANGED
@@ -1,141 +1,141 @@
1
- <a href="https://github.com/globalpayments" target="_blank">
2
- <img src="https://globalpayments.github.io/images/globapaymentsLogo.png" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
3
- </a>
4
-
5
- # Heartland & Global Payments Node.js SDK
6
-
7
- This SDK makes it easy to integrate your Node.js application with our Card Not Present and Card Present APIs.
8
-
9
- ## Solutions
10
-
11
- ### General / Omnichannel
12
-
13
- * API Payment Processing
14
- * Apple Pay & Google Pay
15
- * Secure Card Storage & Customer Management
16
- * Subscriptions / Recurring Billing Solutions
17
- * Credit, Debit, Gift & Loyalty, and eCheck/ACH
18
-
19
- ### Card Not Present (Ecommerce & MOTO) Specific
20
-
21
- * Minimize PCI compliance requirements with Hosted Payment Solutions
22
- * 140+ Authorization Currencies & 16 Settlement Currencies
23
- * 150+ Local Payment Methods Worldwide
24
- * Account Updater
25
- * Inbuilt Fraud Prevention Rules
26
- * 3D Secure, AVS and CVV Checks
27
- * 260+ Global Enterprise Fraud Rules
28
-
29
- ### Card Present (Terminal & POS) Specific
30
-
31
- * Secure End-To-End Encryption
32
-
33
- ## Requirements
34
-
35
- * Node.js
36
-
37
- ## Installation
38
-
39
- Installing the SDK into your solution is usually be done by either using NPM or Yarn.
40
-
41
- To install via [NPM](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
42
-
43
- ```
44
- npm install --save globalpayments-api
45
- ```
46
-
47
- To install via [Yarn](https://yarnpkg.com/lang/en/docs/installing-dependencies/):
48
-
49
- ```
50
- yarn add globalpayments-api
51
- ```
52
-
53
- ## Documentation and Examples
54
-
55
- You can find the latest SDK documentation along with code examples and test cards on the [Global Payments](https://developer.realexpayments.com) and [Heartland](https://developer.heartlandpaymentsystems.com/documentation) Developer Hubs.
56
-
57
- In addition you can find working examples in the our example code repository.
58
-
59
- _Quick Tip_: The included [test suite](https://github.com/globalpayments/node-sdk/tree/master/test) can be a great source of code samples for using the SDK!
60
-
61
- #### Process a Payment Example
62
-
63
- ```javascript
64
- const card = new CreditCardData();
65
- card.number = "4111111111111111";
66
- card.expMonth = "12";
67
- card.expYear = "2025";
68
- card.cvn = "123";
69
-
70
- card
71
- .charge(129.99)
72
- .withCurrency("EUR")
73
- .execute()
74
- .then((response) => {
75
- const result = response.responseCode;
76
- const message = response.responseMessage;
77
- })
78
- .catch((e) => {
79
- // handle errors
80
- });
81
- ```
82
-
83
- #### Test Card Data
84
-
85
- | Name | Number | Exp Month | Exp Year | CVN |
86
- | ----------- | ---------------- | --------- | -------- | ---- |
87
- | Visa | 4263970000005262 | 12 | 2025 | 123 |
88
- | MasterCard | 2223000010005780 | 12 | 2019 | 900 |
89
- | MasterCard | 5425230000004415 | 12 | 2025 | 123 |
90
- | Discover | 6011000000000087 | 12 | 2025 | 123 |
91
- | Amex | 374101000000608 | 12 | 2025 | 1234 |
92
- | JCB | 3566000000000000 | 12 | 2025 | 123 |
93
- | Diners Club | 36256000000725 | 12 | 2025 | 123 |
94
-
95
- #### Testing Exceptions
96
-
97
- During your integration you will want to test for specific issuer responses such as 'Card Declined'. Because our sandbox environments do not actually reach out to issuing banks for authorizations, there are specific transaction amounts and/or card numbers that will trigger gateway and issuing bank responses. Please contact your support representative for a complete listing of values used to simulate transaction AVS/CVV results, declines, errors, and other responses that can be caught in your code. Example error handling code:
98
-
99
- ```javascript
100
- card
101
- .charge(-5)
102
- .withCurrency("USD")
103
- .withAddress(address)
104
- .execute()
105
- .catch((e) => {
106
- switch (e.name) {
107
- case BuilderError.constructor.name:
108
- // handle builder errors
109
- break;
110
- case ConfigurationError.constructor.name:
111
- // handle errors related to your services configuration
112
- break;
113
- case GatewayError.constructor.name:
114
- // handle gateway errors/exceptions
115
- break;
116
- case UnsupportedTransactionError.constructor.name:
117
- // handle errors when the configured gateway doesn't support
118
- // desired transaction
119
- break;
120
- case ApiError.constructor.name:
121
- default:
122
- // handle all other errors
123
- break;
124
- }
125
- });
126
- ```
127
-
128
- ## Contributing
129
-
130
- All our code is open sourced and we encourage fellow developers to contribute and help improve it!
131
-
132
- 1. Fork it
133
- 2. Create your feature branch (`git checkout -b my-new-feature`)
134
- 3. Ensure SDK tests are passing
135
- 4. Commit your changes (`git commit -am 'Add some feature'`)
136
- 5. Push to the branch (`git push origin my-new-feature`)
137
- 6. Create new Pull Request
138
-
139
- ## License
140
-
141
- This project is licensed under the GNU General Public License v2.0. Please see [LICENSE.md](LICENSE.md) located at the project's root for more details.
1
+ <a href="https://github.com/globalpayments" target="_blank">
2
+ <img src="https://globalpayments.github.io/images/globapaymentsLogo.png" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
3
+ </a>
4
+
5
+ # Heartland & Global Payments Node.js SDK
6
+
7
+ This SDK makes it easy to integrate your Node.js application with our Card Not Present and Card Present APIs.
8
+
9
+ ## Solutions
10
+
11
+ ### General / Omnichannel
12
+
13
+ * API Payment Processing
14
+ * Apple Pay & Google Pay
15
+ * Secure Card Storage & Customer Management
16
+ * Subscriptions / Recurring Billing Solutions
17
+ * Credit, Debit, Gift & Loyalty, and eCheck/ACH
18
+
19
+ ### Card Not Present (Ecommerce & MOTO) Specific
20
+
21
+ * Minimize PCI compliance requirements with Hosted Payment Solutions
22
+ * 140+ Authorization Currencies & 16 Settlement Currencies
23
+ * 150+ Local Payment Methods Worldwide
24
+ * Account Updater
25
+ * Inbuilt Fraud Prevention Rules
26
+ * 3D Secure, AVS and CVV Checks
27
+ * 260+ Global Enterprise Fraud Rules
28
+
29
+ ### Card Present (Terminal & POS) Specific
30
+
31
+ * Secure End-To-End Encryption
32
+
33
+ ## Requirements
34
+
35
+ * Node.js
36
+
37
+ ## Installation
38
+
39
+ Installing the SDK into your solution is usually be done by either using NPM or Yarn.
40
+
41
+ To install via [NPM](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
42
+
43
+ ```
44
+ npm install --save globalpayments-api
45
+ ```
46
+
47
+ To install via [Yarn](https://yarnpkg.com/lang/en/docs/installing-dependencies/):
48
+
49
+ ```
50
+ yarn add globalpayments-api
51
+ ```
52
+
53
+ ## Documentation and Examples
54
+
55
+ You can find the latest SDK documentation along with code examples and test cards on the [Global Payments](https://developer.realexpayments.com) and [Heartland](https://developer.heartlandpaymentsystems.com/documentation) Developer Hubs.
56
+
57
+ In addition you can find working examples in the our example code repository.
58
+
59
+ _Quick Tip_: The included [test suite](https://github.com/globalpayments/node-sdk/tree/master/test) can be a great source of code samples for using the SDK!
60
+
61
+ #### Process a Payment Example
62
+
63
+ ```javascript
64
+ const card = new CreditCardData();
65
+ card.number = "4111111111111111";
66
+ card.expMonth = "12";
67
+ card.expYear = "2025";
68
+ card.cvn = "123";
69
+
70
+ card
71
+ .charge(129.99)
72
+ .withCurrency("EUR")
73
+ .execute()
74
+ .then((response) => {
75
+ const result = response.responseCode;
76
+ const message = response.responseMessage;
77
+ })
78
+ .catch((e) => {
79
+ // handle errors
80
+ });
81
+ ```
82
+
83
+ #### Test Card Data
84
+
85
+ | Name | Number | Exp Month | Exp Year | CVN |
86
+ | ----------- | ---------------- | --------- | -------- | ---- |
87
+ | Visa | 4263970000005262 | 12 | 2025 | 123 |
88
+ | MasterCard | 2223000010005780 | 12 | 2019 | 900 |
89
+ | MasterCard | 5425230000004415 | 12 | 2025 | 123 |
90
+ | Discover | 6011000000000087 | 12 | 2025 | 123 |
91
+ | Amex | 374101000000608 | 12 | 2025 | 1234 |
92
+ | JCB | 3566000000000000 | 12 | 2025 | 123 |
93
+ | Diners Club | 36256000000725 | 12 | 2025 | 123 |
94
+
95
+ #### Testing Exceptions
96
+
97
+ During your integration you will want to test for specific issuer responses such as 'Card Declined'. Because our sandbox environments do not actually reach out to issuing banks for authorizations, there are specific transaction amounts and/or card numbers that will trigger gateway and issuing bank responses. Please contact your support representative for a complete listing of values used to simulate transaction AVS/CVV results, declines, errors, and other responses that can be caught in your code. Example error handling code:
98
+
99
+ ```javascript
100
+ card
101
+ .charge(-5)
102
+ .withCurrency("USD")
103
+ .withAddress(address)
104
+ .execute()
105
+ .catch((e) => {
106
+ switch (e.name) {
107
+ case BuilderError.constructor.name:
108
+ // handle builder errors
109
+ break;
110
+ case ConfigurationError.constructor.name:
111
+ // handle errors related to your services configuration
112
+ break;
113
+ case GatewayError.constructor.name:
114
+ // handle gateway errors/exceptions
115
+ break;
116
+ case UnsupportedTransactionError.constructor.name:
117
+ // handle errors when the configured gateway doesn't support
118
+ // desired transaction
119
+ break;
120
+ case ApiError.constructor.name:
121
+ default:
122
+ // handle all other errors
123
+ break;
124
+ }
125
+ });
126
+ ```
127
+
128
+ ## Contributing
129
+
130
+ All our code is open sourced and we encourage fellow developers to contribute and help improve it!
131
+
132
+ 1. Fork it
133
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
134
+ 3. Ensure SDK tests are passing
135
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
136
+ 5. Push to the branch (`git push origin my-new-feature`)
137
+ 6. Create new Pull Request
138
+
139
+ ## License
140
+
141
+ This project is licensed under the GNU General Public License v2.0. Please see [LICENSE.md](LICENSE.md) located at the project's root for more details.
@@ -1,28 +1,30 @@
1
1
  import { DisputeDocument, LodgingData, PaymentMethod, PaymentMethodUsageMode, ReasonCode, StoredCredentialSequence, TaxType, Transaction } from "../";
2
2
  import { TransactionBuilder } from "./TransactionBuilder";
3
+ import { CommercialData } from "../Entities/CommercialData";
3
4
  export declare class ManagementBuilder extends TransactionBuilder<Transaction> {
4
5
  amount: string | number | null;
5
6
  authAmount: string | number;
6
- get authorizationCode(): string | undefined;
7
- get clientTransactionId(): string | undefined;
8
7
  currency: string;
8
+ commercialData?: CommercialData;
9
9
  description: string;
10
10
  gratuity: string | number | null;
11
11
  lodgingData: LodgingData;
12
- get orderId(): string | undefined;
13
12
  poNumber: string;
14
13
  reasonCode?: ReasonCode;
15
14
  taxAmount: string | number;
16
15
  taxType: TaxType;
17
- get transactionId(): string | undefined;
16
+ cardType?: string;
18
17
  constructor(type: number, paymentMethod?: PaymentMethod);
18
+ get authorizationCode(): string | undefined;
19
+ get clientTransactionId(): string | undefined;
20
+ get orderId(): string | undefined;
21
+ get transactionId(): string | undefined;
19
22
  /**
20
23
  * Executes the builder against the gateway.
21
24
  *
22
25
  * @returns Promise<Transaction>
23
26
  */
24
27
  execute(configName?: string): Promise<Transaction>;
25
- protected setupValidations(): void;
26
28
  /**
27
29
  * Sets the current transaction's amount.
28
30
  *
@@ -47,6 +49,7 @@ export declare class ManagementBuilder extends TransactionBuilder<Transaction> {
47
49
  * @returns ManagementBuilder
48
50
  */
49
51
  withCurrency(currency?: string): this;
52
+ withCommercialData(cd: CommercialData): this;
50
53
  /**
51
54
  * Sets the transaction's description.
52
55
  *
@@ -135,4 +138,5 @@ export declare class ManagementBuilder extends TransactionBuilder<Transaction> {
135
138
  * @return $this
136
139
  */
137
140
  withDisputeDocuments(value: DisputeDocument[]): this;
141
+ protected setupValidations(): void;
138
142
  }
@@ -6,6 +6,20 @@ const TransactionBuilder_1 = require("./TransactionBuilder");
6
6
  class ManagementBuilder extends TransactionBuilder_1.TransactionBuilder {
7
7
  amount;
8
8
  authAmount;
9
+ currency;
10
+ commercialData;
11
+ description;
12
+ gratuity;
13
+ lodgingData;
14
+ poNumber;
15
+ reasonCode;
16
+ taxAmount;
17
+ taxType;
18
+ cardType;
19
+ constructor(type, paymentMethod) {
20
+ super(type, paymentMethod);
21
+ this.supplementaryData = {};
22
+ }
9
23
  get authorizationCode() {
10
24
  if (this.paymentMethod instanceof __1.TransactionReference) {
11
25
  return this.paymentMethod.authCode;
@@ -18,30 +32,18 @@ class ManagementBuilder extends TransactionBuilder_1.TransactionBuilder {
18
32
  }
19
33
  return undefined;
20
34
  }
21
- currency;
22
- description;
23
- gratuity;
24
- lodgingData;
25
35
  get orderId() {
26
36
  if (this.paymentMethod instanceof __1.TransactionReference) {
27
37
  return this.paymentMethod.orderId;
28
38
  }
29
39
  return undefined;
30
40
  }
31
- poNumber;
32
- reasonCode;
33
- taxAmount;
34
- taxType;
35
41
  get transactionId() {
36
42
  if (this.paymentMethod instanceof __1.TransactionReference) {
37
43
  return this.paymentMethod.transactionId;
38
44
  }
39
45
  return undefined;
40
46
  }
41
- constructor(type, paymentMethod) {
42
- super(type, paymentMethod);
43
- this.supplementaryData = {};
44
- }
45
47
  /**
46
48
  * Executes the builder against the gateway.
47
49
  *
@@ -53,28 +55,6 @@ class ManagementBuilder extends TransactionBuilder_1.TransactionBuilder {
53
55
  .getClient(configName)
54
56
  .manageTransaction(this);
55
57
  }
56
- setupValidations() {
57
- this.validations
58
- .of("transactionType",
59
- /* tslint:disable:trailing-comma */
60
- __1.TransactionType.Capture |
61
- __1.TransactionType.Edit |
62
- __1.TransactionType.Hold |
63
- __1.TransactionType.Release)
64
- .check("transactionId")
65
- .isNotNull();
66
- this.validations
67
- .of("transactionType", __1.TransactionType.Edit)
68
- .with("transactionModifier", __1.TransactionModifier.LevelII)
69
- .check("taxType")
70
- .isNotNull();
71
- this.validations
72
- .of("transactionType", __1.TransactionType.Refund)
73
- .when("amount")
74
- .isNotNull()
75
- .check("currency")
76
- .isNotNull();
77
- }
78
58
  /**
79
59
  * Sets the current transaction's amount.
80
60
  *
@@ -114,6 +94,14 @@ class ManagementBuilder extends TransactionBuilder_1.TransactionBuilder {
114
94
  }
115
95
  return this;
116
96
  }
97
+ withCommercialData(cd) {
98
+ this.commercialData = cd;
99
+ this.transactionModifier =
100
+ cd.commercialIndicator === __1.TransactionModifier.LevelII
101
+ ? __1.TransactionModifier.LevelII
102
+ : __1.TransactionModifier.LevelIII;
103
+ return this;
104
+ }
117
105
  /**
118
106
  * Sets the transaction's description.
119
107
  *
@@ -261,6 +249,28 @@ class ManagementBuilder extends TransactionBuilder_1.TransactionBuilder {
261
249
  this.disputeDocuments = value;
262
250
  return this;
263
251
  }
252
+ setupValidations() {
253
+ this.validations
254
+ .of("transactionType",
255
+ /* tslint:disable:trailing-comma */
256
+ __1.TransactionType.Capture |
257
+ __1.TransactionType.Edit |
258
+ __1.TransactionType.Hold |
259
+ __1.TransactionType.Release)
260
+ .check("transactionId")
261
+ .isNotNull();
262
+ this.validations
263
+ .of("transactionType", __1.TransactionType.Edit)
264
+ .with("transactionModifier", __1.TransactionModifier.LevelII)
265
+ .check("taxType")
266
+ .isNotNull();
267
+ this.validations
268
+ .of("transactionType", __1.TransactionType.Refund)
269
+ .when("amount")
270
+ .isNotNull()
271
+ .check("currency")
272
+ .isNotNull();
273
+ }
264
274
  }
265
275
  exports.ManagementBuilder = ManagementBuilder;
266
276
  //# sourceMappingURL=ManagementBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManagementBuilder.js","sourceRoot":"","sources":["../../../src/Builders/ManagementBuilder.ts"],"names":[],"mappings":";;;AAAA,2BAaa;AACb,6DAA0D;AAE1D,MAAa,iBAAkB,SAAQ,uCAA+B;IAC7D,MAAM,CAAyB;IAC/B,UAAU,CAAkB;IACnC,IAAW,iBAAiB;QAC1B,IAAI,IAAI,CAAC,aAAa,YAAY,wBAAoB,EAAE;YACtD,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAW,mBAAmB;QAC5B,IAAI,IAAI,CAAC,aAAa,YAAY,wBAAoB,EAAE;YACtD,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC;SAC/C;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACM,QAAQ,CAAS;IACjB,WAAW,CAAS;IACpB,QAAQ,CAAyB;IACjC,WAAW,CAAc;IAChC,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,aAAa,YAAY,wBAAoB,EAAE;YACtD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;SACnC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACM,QAAQ,CAAS;IACjB,UAAU,CAAc;IACxB,SAAS,CAAkB;IAC3B,OAAO,CA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aACb,EAAE,CAAC,iBAAiB,EAAE,mBAAe,CAAC,MAAM,CAAC;aAC7C,IAAI,CAAC,QAAQ,CAAC;aACd,SAAS,EAAE;aACX,KAAK,CAAC,UAAU,CAAC;aACjB,SAAS,EAAE,CAAC;IACjB,CAAC;CACF;AApTD,8CAoTC"}
@@ -0,0 +1,5 @@
1
+ export declare class AdditionalTaxDetails {
2
+ taxAmount: string | number | undefined;
3
+ taxRate: string | number | undefined;
4
+ taxType: string;
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdditionalTaxDetails = void 0;
4
+ class AdditionalTaxDetails {
5
+ taxAmount;
6
+ taxRate;
7
+ taxType;
8
+ }
9
+ exports.AdditionalTaxDetails = AdditionalTaxDetails;
10
+ //# sourceMappingURL=AdditionalTaxDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdditionalTaxDetails.js","sourceRoot":"","sources":["../../../src/Entities/AdditionalTaxDetails.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;IACxB,SAAS,CAA8B;IACvC,OAAO,CAA8B;IACrC,OAAO,CAAS;CACxB;AAJD,oDAIC"}
@@ -0,0 +1,26 @@
1
+ import { AdditionalTaxDetails } from "./AdditionalTaxDetails";
2
+ import { TaxType, TransactionModifier } from "./Enums";
3
+ import { CommercialLineItem } from "./CommercialLineItem";
4
+ export declare class CommercialData {
5
+ additionalTaxDetails?: AdditionalTaxDetails;
6
+ commercialIndicator: TransactionModifier;
7
+ customerVAT_Number?: string;
8
+ customerReferenceId?: string;
9
+ description?: string;
10
+ discountAmount?: string | number;
11
+ dutyAmount?: string | number;
12
+ destinationPostalCode?: string;
13
+ destinationCountryCode?: string;
14
+ freightAmount?: string | number;
15
+ lineItems: CommercialLineItem[];
16
+ orderDate?: Date;
17
+ originPostalCode?: string;
18
+ poNumber?: string;
19
+ supplierReferenceNumber?: string;
20
+ taxAmount?: string | number;
21
+ taxType: TaxType;
22
+ summaryCommodityCode?: string;
23
+ vat_InvoiceNumber?: string;
24
+ constructor(taxType: TaxType, level?: TransactionModifier);
25
+ addLineItems(items: CommercialLineItem): CommercialData;
26
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommercialData = void 0;
4
+ const Enums_1 = require("./Enums");
5
+ class CommercialData {
6
+ additionalTaxDetails;
7
+ commercialIndicator;
8
+ customerVAT_Number;
9
+ customerReferenceId;
10
+ description;
11
+ discountAmount;
12
+ dutyAmount;
13
+ destinationPostalCode;
14
+ destinationCountryCode;
15
+ freightAmount;
16
+ lineItems;
17
+ orderDate;
18
+ originPostalCode;
19
+ poNumber;
20
+ supplierReferenceNumber;
21
+ taxAmount;
22
+ taxType;
23
+ summaryCommodityCode;
24
+ vat_InvoiceNumber;
25
+ constructor(taxType, level = Enums_1.TransactionModifier.LevelII) {
26
+ this.taxType = taxType;
27
+ this.commercialIndicator = level;
28
+ this.lineItems = [];
29
+ }
30
+ addLineItems(items) {
31
+ this.lineItems.push(items);
32
+ return this;
33
+ }
34
+ }
35
+ exports.CommercialData = CommercialData;
36
+ //# sourceMappingURL=CommercialData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommercialData.js","sourceRoot":"","sources":["../../../src/Entities/CommercialData.ts"],"names":[],"mappings":";;;AACA,mCAAuD;AAGvD,MAAa,cAAc;IAClB,oBAAoB,CAAwB;IAC5C,mBAAmB,CAAsB;IACzC,kBAAkB,CAAU;IAC5B,mBAAmB,CAAU;IAC7B,WAAW,CAAU;IACrB,cAAc,CAAmB;IACjC,UAAU,CAAmB;IAC7B,qBAAqB,CAAU;IAC/B,sBAAsB,CAAU;IAChC,aAAa,CAAmB;IAChC,SAAS,CAAuB;IAChC,SAAS,CAAQ;IACjB,gBAAgB,CAAU;IAC1B,QAAQ,CAAU;IAClB,uBAAuB,CAAU;IACjC,SAAS,CAAmB;IAC5B,OAAO,CAAU;IACjB,oBAAoB,CAAU;IAC9B,iBAAiB,CAAU;IAElC,YACE,OAAgB,EAChB,QAA6B,2BAAmB,CAAC,OAAO;QAExD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IAEM,YAAY,CAAC,KAAyB;QAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlCD,wCAkCC"}
@@ -0,0 +1,21 @@
1
+ import { DiscountDetails } from "./DiscountDetails";
2
+ import { CreditDebitIndicator, NetGrossIndicator } from "./Enums";
3
+ export declare class CommercialLineItem {
4
+ alternateTaxId?: string;
5
+ commodityCode?: string;
6
+ description?: string;
7
+ extendedAmount?: string | number;
8
+ creditDebitIndicator?: CreditDebitIndicator;
9
+ netGrossIndicator?: NetGrossIndicator;
10
+ name?: string;
11
+ productCode?: string;
12
+ quantity?: string | number;
13
+ unitOfMeasure?: string;
14
+ unitCost?: string | number;
15
+ taxAmount?: string | number;
16
+ taxName?: string | number;
17
+ upc?: string;
18
+ taxPercentage?: string | number;
19
+ discountDetails?: DiscountDetails;
20
+ totalAmount?: string | number;
21
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommercialLineItem = void 0;
4
+ class CommercialLineItem {
5
+ alternateTaxId;
6
+ commodityCode;
7
+ description;
8
+ extendedAmount;
9
+ creditDebitIndicator;
10
+ netGrossIndicator;
11
+ name;
12
+ productCode;
13
+ quantity;
14
+ unitOfMeasure;
15
+ unitCost;
16
+ taxAmount;
17
+ taxName;
18
+ upc;
19
+ taxPercentage;
20
+ discountDetails;
21
+ totalAmount;
22
+ }
23
+ exports.CommercialLineItem = CommercialLineItem;
24
+ //# sourceMappingURL=CommercialLineItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommercialLineItem.js","sourceRoot":"","sources":["../../../src/Entities/CommercialLineItem.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAC7B,cAAc,CAAU;IACxB,aAAa,CAAU;IACvB,WAAW,CAAU;IACrB,cAAc,CAAmB;IACjC,oBAAoB,CAAwB;IAC5C,iBAAiB,CAAqB;IACtC,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,QAAQ,CAAmB;IAC3B,aAAa,CAAU;IACvB,QAAQ,CAAmB;IAC3B,SAAS,CAAmB;IAC5B,OAAO,CAAmB;IAC1B,GAAG,CAAU;IACb,aAAa,CAAmB;IAChC,eAAe,CAAmB;IAClC,WAAW,CAAmB;CAC/B;AAlBD,gDAkBC"}
@@ -0,0 +1,8 @@
1
+ export declare class DiscountDetails {
2
+ discountName?: string;
3
+ discountAmount: string | number | undefined;
4
+ discountPercentage: string | number | undefined;
5
+ discountType?: string;
6
+ discountPriority?: number;
7
+ discountIsStackable?: boolean;
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscountDetails = void 0;
4
+ class DiscountDetails {
5
+ discountName;
6
+ discountAmount;
7
+ discountPercentage;
8
+ discountType;
9
+ discountPriority;
10
+ discountIsStackable;
11
+ }
12
+ exports.DiscountDetails = DiscountDetails;
13
+ //# sourceMappingURL=DiscountDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscountDetails.js","sourceRoot":"","sources":["../../../src/Entities/DiscountDetails.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAe;IACnB,YAAY,CAAU;IACtB,cAAc,CAA8B;IAC5C,kBAAkB,CAA8B;IAChD,YAAY,CAAU;IACtB,gBAAgB,CAAU;IAC1B,mBAAmB,CAAW;CACtC;AAPD,0CAOC"}