globalpayments-api 1.4.8 → 2.0.0

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 (223) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/package.json +3 -4
  3. package/lib/src/Builders/AuthorizationBuilder.d.ts +0 -325
  4. package/lib/src/Builders/AuthorizationBuilder.js +0 -599
  5. package/lib/src/Builders/BaseBuilder/ValidationClause.d.ts +0 -14
  6. package/lib/src/Builders/BaseBuilder/ValidationClause.js +0 -61
  7. package/lib/src/Builders/BaseBuilder/ValidationTarget.d.ts +0 -16
  8. package/lib/src/Builders/BaseBuilder/ValidationTarget.js +0 -28
  9. package/lib/src/Builders/BaseBuilder/Validations.d.ts +0 -11
  10. package/lib/src/Builders/BaseBuilder/Validations.js +0 -56
  11. package/lib/src/Builders/BaseBuilder.d.ts +0 -11
  12. package/lib/src/Builders/BaseBuilder.js +0 -16
  13. package/lib/src/Builders/ManagementBuilder.d.ts +0 -103
  14. package/lib/src/Builders/ManagementBuilder.js +0 -227
  15. package/lib/src/Builders/RecurringBuilder.d.ts +0 -13
  16. package/lib/src/Builders/RecurringBuilder.js +0 -47
  17. package/lib/src/Builders/ReportBuilder.d.ts +0 -8
  18. package/lib/src/Builders/ReportBuilder.js +0 -36
  19. package/lib/src/Builders/TransactionBuilder.d.ts +0 -10
  20. package/lib/src/Builders/TransactionBuilder.js +0 -46
  21. package/lib/src/Builders/TransactionReportBuilder.d.ts +0 -15
  22. package/lib/src/Builders/TransactionReportBuilder.js +0 -79
  23. package/lib/src/Builders/index.d.ts +0 -7
  24. package/lib/src/Builders/index.js +0 -19
  25. package/lib/src/Entities/Address.d.ts +0 -13
  26. package/lib/src/Entities/Address.js +0 -19
  27. package/lib/src/Entities/BatchSummary.d.ts +0 -6
  28. package/lib/src/Entities/BatchSummary.js +0 -9
  29. package/lib/src/Entities/Customer.d.ts +0 -64
  30. package/lib/src/Entities/Customer.js +0 -47
  31. package/lib/src/Entities/EcommerceInfo.d.ts +0 -12
  32. package/lib/src/Entities/EcommerceInfo.js +0 -14
  33. package/lib/src/Entities/EncryptionData.d.ts +0 -6
  34. package/lib/src/Entities/EncryptionData.js +0 -9
  35. package/lib/src/Entities/Enums.d.ts +0 -230
  36. package/lib/src/Entities/Enums.js +0 -267
  37. package/lib/src/Entities/Errors.d.ts +0 -23
  38. package/lib/src/Entities/Errors.js +0 -106
  39. package/lib/src/Entities/HostedPaymentData.d.ts +0 -10
  40. package/lib/src/Entities/HostedPaymentData.js +0 -10
  41. package/lib/src/Entities/RecurringEntity.d.ts +0 -14
  42. package/lib/src/Entities/RecurringEntity.js +0 -86
  43. package/lib/src/Entities/Schedule.d.ts +0 -47
  44. package/lib/src/Entities/Schedule.js +0 -253
  45. package/lib/src/Entities/Transaction.d.ts +0 -76
  46. package/lib/src/Entities/Transaction.js +0 -108
  47. package/lib/src/Entities/TransactionSummary.d.ts +0 -61
  48. package/lib/src/Entities/TransactionSummary.js +0 -9
  49. package/lib/src/Entities/index.d.ts +0 -12
  50. package/lib/src/Entities/index.js +0 -24
  51. package/lib/src/Gateways/Gateway.d.ts +0 -10
  52. package/lib/src/Gateways/Gateway.js +0 -42
  53. package/lib/src/Gateways/IPaymentGateway.d.ts +0 -8
  54. package/lib/src/Gateways/IPaymentGateway.js +0 -2
  55. package/lib/src/Gateways/IRecurringService.d.ts +0 -6
  56. package/lib/src/Gateways/IRecurringService.js +0 -2
  57. package/lib/src/Gateways/PayPlanConnector.d.ts +0 -42
  58. package/lib/src/Gateways/PayPlanConnector.js +0 -552
  59. package/lib/src/Gateways/PorticoConnector.d.ts +0 -44
  60. package/lib/src/Gateways/PorticoConnector.js +0 -1018
  61. package/lib/src/Gateways/RealexConnector.d.ts +0 -30
  62. package/lib/src/Gateways/RealexConnector.js +0 -523
  63. package/lib/src/Gateways/RestGateway.d.ts +0 -6
  64. package/lib/src/Gateways/RestGateway.js +0 -31
  65. package/lib/src/Gateways/XmlGateway.d.ts +0 -6
  66. package/lib/src/Gateways/XmlGateway.js +0 -38
  67. package/lib/src/Gateways/https-wrapper.d.ts +0 -3
  68. package/lib/src/Gateways/https-wrapper.js +0 -35
  69. package/lib/src/Gateways/index.d.ts +0 -7
  70. package/lib/src/Gateways/index.js +0 -19
  71. package/lib/src/HostedPaymentConfig.d.ts +0 -12
  72. package/lib/src/HostedPaymentConfig.js +0 -9
  73. package/lib/src/PaymentMethods/Cash.d.ts +0 -8
  74. package/lib/src/PaymentMethods/Cash.js +0 -36
  75. package/lib/src/PaymentMethods/Credit.d.ts +0 -85
  76. package/lib/src/PaymentMethods/Credit.js +0 -106
  77. package/lib/src/PaymentMethods/CreditCardData.d.ts +0 -19
  78. package/lib/src/PaymentMethods/CreditCardData.js +0 -51
  79. package/lib/src/PaymentMethods/CreditTrackData.d.ts +0 -7
  80. package/lib/src/PaymentMethods/CreditTrackData.js +0 -27
  81. package/lib/src/PaymentMethods/Debit.d.ts +0 -40
  82. package/lib/src/PaymentMethods/Debit.js +0 -70
  83. package/lib/src/PaymentMethods/DebitTrackData.d.ts +0 -7
  84. package/lib/src/PaymentMethods/DebitTrackData.js +0 -27
  85. package/lib/src/PaymentMethods/EBT.d.ts +0 -48
  86. package/lib/src/PaymentMethods/EBT.js +0 -88
  87. package/lib/src/PaymentMethods/EBTCardData.d.ts +0 -16
  88. package/lib/src/PaymentMethods/EBTCardData.js +0 -32
  89. package/lib/src/PaymentMethods/EBTTrackData.d.ts +0 -8
  90. package/lib/src/PaymentMethods/EBTTrackData.js +0 -27
  91. package/lib/src/PaymentMethods/ECheck.d.ts +0 -32
  92. package/lib/src/PaymentMethods/ECheck.js +0 -40
  93. package/lib/src/PaymentMethods/GiftCard.d.ts +0 -131
  94. package/lib/src/PaymentMethods/GiftCard.js +0 -205
  95. package/lib/src/PaymentMethods/Interfaces.d.ts +0 -55
  96. package/lib/src/PaymentMethods/Interfaces.js +0 -2
  97. package/lib/src/PaymentMethods/PaymentMethod.d.ts +0 -19
  98. package/lib/src/PaymentMethods/PaymentMethod.js +0 -114
  99. package/lib/src/PaymentMethods/RecurringPaymentMethod.d.ts +0 -23
  100. package/lib/src/PaymentMethods/RecurringPaymentMethod.js +0 -77
  101. package/lib/src/PaymentMethods/TransactionReference.d.ts +0 -10
  102. package/lib/src/PaymentMethods/TransactionReference.js +0 -12
  103. package/lib/src/PaymentMethods/index.d.ts +0 -15
  104. package/lib/src/PaymentMethods/index.js +0 -27
  105. package/lib/src/Services/BatchService.d.ts +0 -4
  106. package/lib/src/Services/BatchService.js +0 -17
  107. package/lib/src/Services/CheckService.d.ts +0 -6
  108. package/lib/src/Services/CheckService.js +0 -20
  109. package/lib/src/Services/CreditService.d.ts +0 -12
  110. package/lib/src/Services/CreditService.js +0 -54
  111. package/lib/src/Services/DebitService.d.ts +0 -7
  112. package/lib/src/Services/DebitService.js +0 -28
  113. package/lib/src/Services/EBTService.d.ts +0 -8
  114. package/lib/src/Services/EBTService.js +0 -32
  115. package/lib/src/Services/GiftService.d.ts +0 -16
  116. package/lib/src/Services/GiftService.js +0 -54
  117. package/lib/src/Services/HostedService.d.ts +0 -9
  118. package/lib/src/Services/HostedService.js +0 -59
  119. package/lib/src/Services/RecurringService.d.ts +0 -8
  120. package/lib/src/Services/RecurringService.js +0 -27
  121. package/lib/src/Services/ReportingService.d.ts +0 -6
  122. package/lib/src/Services/ReportingService.js +0 -19
  123. package/lib/src/Services/index.d.ts +0 -9
  124. package/lib/src/Services/index.js +0 -21
  125. package/lib/src/ServicesConfig.d.ts +0 -23
  126. package/lib/src/ServicesConfig.js +0 -50
  127. package/lib/src/ServicesContainer.d.ts +0 -11
  128. package/lib/src/ServicesContainer.js +0 -73
  129. package/lib/src/Utils/GenerationUtils.d.ts +0 -5
  130. package/lib/src/Utils/GenerationUtils.js +0 -36
  131. package/lib/src/Utils/InputValidation.d.ts +0 -12
  132. package/lib/src/Utils/InputValidation.js +0 -72
  133. package/lib/src/Utils/Sha1.d.ts +0 -6
  134. package/lib/src/Utils/Sha1.js +0 -225
  135. package/lib/src/Utils/StringUtils.d.ts +0 -6
  136. package/lib/src/Utils/StringUtils.js +0 -53
  137. package/lib/src/Utils/index.d.ts +0 -2
  138. package/lib/src/Utils/index.js +0 -14
  139. package/lib/src/index.d.ts +0 -11
  140. package/lib/src/index.js +0 -27
  141. package/lib/test/Data/TestCards.d.ts +0 -24
  142. package/lib/test/Data/TestCards.js +0 -232
  143. package/lib/test/Data/TestChecks.d.ts +0 -4
  144. package/lib/test/Data/TestChecks.js +0 -32
  145. package/lib/test/Data/index.d.ts +0 -2
  146. package/lib/test/Data/index.js +0 -14
  147. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
  148. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -112
  149. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
  150. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -483
  151. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
  152. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -83
  153. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
  154. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1720
  155. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
  156. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -83
  157. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
  158. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1757
  159. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
  160. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -682
  161. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
  162. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2218
  163. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
  164. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -708
  165. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
  166. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -151
  167. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
  168. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -171
  169. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
  170. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -192
  171. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
  172. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -377
  173. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
  174. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -196
  175. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
  176. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -47
  177. package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.d.ts +0 -1
  178. package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +0 -4373
  179. package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.d.ts +0 -1
  180. package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +0 -758
  181. package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.d.ts +0 -1
  182. package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +0 -2399
  183. package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.d.ts +0 -1
  184. package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +0 -1656
  185. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +0 -1
  186. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +0 -5650
  187. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +0 -1
  188. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +0 -1985
  189. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +0 -1
  190. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +0 -2369
  191. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +0 -1
  192. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +0 -1703
  193. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +0 -1
  194. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +0 -2053
  195. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +0 -1
  196. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +0 -2469
  197. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +0 -1
  198. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +0 -3116
  199. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +0 -1
  200. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +0 -2031
  201. package/lib/test/Integration/Gateways/RealexConnector/CreditTest.d.ts +0 -1
  202. package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +0 -322
  203. package/lib/test/Integration/Gateways/RealexConnector/HppTest.d.ts +0 -1
  204. package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +0 -98
  205. package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.d.ts +0 -1
  206. package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +0 -263
  207. package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
  208. package/lib/test/Integration/Services/CheckServiceTest.js +0 -98
  209. package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
  210. package/lib/test/Integration/Services/CreditServiceTest.js +0 -313
  211. package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
  212. package/lib/test/Integration/Services/DebitServiceTest.js +0 -154
  213. package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
  214. package/lib/test/Integration/Services/EBTServiceTest.js +0 -135
  215. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
  216. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -161
  217. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
  218. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -139
  219. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
  220. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -202
  221. package/lib/test/Unit/Gateways/RealexConnector/CreditTest.d.ts +0 -1
  222. package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +0 -29
  223. package/logger.txt +0 -4
@@ -1,599 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.AuthorizationBuilder = void 0;
19
- var __1 = require("../");
20
- var TransactionBuilder_1 = require("./TransactionBuilder");
21
- var AuthorizationBuilder = /** @class */ (function (_super) {
22
- __extends(AuthorizationBuilder, _super);
23
- function AuthorizationBuilder(type, paymentMethod) {
24
- var _this = _super.call(this, type, paymentMethod) || this;
25
- if (paymentMethod) {
26
- _this.paymentMethod = paymentMethod;
27
- }
28
- return _this;
29
- }
30
- /**
31
- * Executes the authorization builder against the gateway.
32
- *
33
- * @returns Promise<Transaction>
34
- */
35
- AuthorizationBuilder.prototype.execute = function () {
36
- _super.prototype.execute.call(this);
37
- return __1.ServicesContainer.instance()
38
- .getClient()
39
- .processAuthorization(this);
40
- };
41
- /**
42
- * Serializes an authorization builder for hosted payment page requests.
43
- *
44
- * Requires the gateway and account support hosted payment pages.
45
- *
46
- * @throws UnsupportedTransactionError Thrown when gateway doesn't support hosted payments
47
- * @returns string
48
- */
49
- AuthorizationBuilder.prototype.serialize = function () {
50
- this.transactionModifier = __1.TransactionModifier.HostedRequest;
51
- _super.prototype.execute.call(this);
52
- var client = __1.ServicesContainer.instance().getClient();
53
- if (client.supportsHostedPayments) {
54
- return client.serializeRequest(this);
55
- }
56
- throw new __1.UnsupportedTransactionError("Your current gateway does not support hosted payments");
57
- };
58
- AuthorizationBuilder.prototype.setupValidations = function () {
59
- this.validations
60
- .of("transactionType",
61
- /* tslint:disable:trailing-comma */
62
- __1.TransactionType.Auth |
63
- __1.TransactionType.Sale |
64
- __1.TransactionType.Refund |
65
- __1.TransactionType.AddValue)
66
- .with("transactionModifier", __1.TransactionModifier.None)
67
- .check("amount")
68
- .isNotNull()
69
- .check("currency")
70
- .isNotNull()
71
- .check("paymentMethod")
72
- .isNotNull();
73
- this.validations
74
- .of("transactionType",
75
- /* tslint:disable:trailing-comma */
76
- __1.TransactionType.Auth | __1.TransactionType.Sale | __1.TransactionType.Verify)
77
- .with("transactionModifier", __1.TransactionModifier.HostedRequest)
78
- .check("amount")
79
- .isNotNull()
80
- .check("currency")
81
- .isNotNull();
82
- this.validations
83
- .of("transactionType",
84
- /* tslint:disable:trailing-comma */
85
- __1.TransactionType.Auth | __1.TransactionType.Sale)
86
- .with("transactionModifier", __1.TransactionModifier.Offline)
87
- .check("amount")
88
- .isNotNull()
89
- .check("currency")
90
- .isNotNull()
91
- .check("offlineAuthCode")
92
- .isNotNull()
93
- .check("offlineAuthCode")
94
- .isNotEmpty();
95
- this.validations
96
- .of("transactionType", __1.TransactionType.Auth | __1.TransactionType.Sale)
97
- .with("transactionModifier", __1.TransactionModifier.EncryptedMobile)
98
- .check("paymentMethod")
99
- .isNotNull()
100
- .check("paymentMethod")
101
- .isNotEmpty();
102
- this.validations
103
- .of("transactionType", __1.TransactionType.BenefitWithDrawal)
104
- .with("transactionModifier", __1.TransactionModifier.CashBack)
105
- .check("amount")
106
- .isNotNull()
107
- .check("currency")
108
- .isNotNull()
109
- .check("paymentMethod")
110
- .isNotNull();
111
- this.validations
112
- .of("transactionType", __1.TransactionType.Balance)
113
- .check("paymentMethod")
114
- .isNotNull();
115
- this.validations
116
- .of("transactionType", __1.TransactionType.Alias)
117
- .check("aliasAction")
118
- .isNotNull()
119
- .check("alias")
120
- .isNotNull();
121
- this.validations
122
- .of("transactionType", __1.TransactionType.Replace)
123
- .check("replacementCard")
124
- .isNotNull();
125
- this.validations
126
- .of("paymentMethodType", __1.PaymentMethodType.ACH)
127
- .check("billingAddress")
128
- .isNotNull();
129
- };
130
- /**
131
- * Sets an address value; where applicable.
132
- *
133
- * Currently supports billing and shipping addresses.
134
- *
135
- * @param address The desired address information
136
- * @param addressType The desired address type
137
- * @returns AuthorizationBuilder
138
- */
139
- AuthorizationBuilder.prototype.withAddress = function (address, addressType) {
140
- if (addressType === void 0) { addressType = __1.AddressType.Billing; }
141
- if (address === undefined) {
142
- return this;
143
- }
144
- address.type = addressType;
145
- if (addressType === __1.AddressType.Billing) {
146
- this.billingAddress = address;
147
- }
148
- else {
149
- this.shippingAddress = address;
150
- }
151
- return this;
152
- };
153
- AuthorizationBuilder.prototype.withAlias = function (aliasAction, alias) {
154
- if (alias !== undefined) {
155
- this.alias = alias;
156
- }
157
- this.aliasAction = aliasAction;
158
- return this;
159
- };
160
- /**
161
- * Allows duplicate transactions by skipping the
162
- * gateway's duplicate checking.
163
- *
164
- * @param allowDuplicates The duplicate skip flag
165
- * @returns AuthorizationBuilder
166
- */
167
- AuthorizationBuilder.prototype.withAllowDuplicates = function (allowDuplicates) {
168
- if (allowDuplicates !== undefined) {
169
- this.allowDuplicates = allowDuplicates;
170
- }
171
- return this;
172
- };
173
- /**
174
- * Allows partial authorizations to occur.
175
- *
176
- *
177
- * @param allowPartialAuth The allow partial flag
178
- * @returns AuthorizationBuilder
179
- */
180
- AuthorizationBuilder.prototype.withAllowPartialAuth = function (allowPartialAuth) {
181
- if (allowPartialAuth !== undefined) {
182
- this.allowPartialAuth = allowPartialAuth;
183
- }
184
- return this;
185
- };
186
- /**
187
- * Sets the transaction's amount
188
- *
189
- * @param amount The amount
190
- * @returns AuthorizationBuilder
191
- */
192
- AuthorizationBuilder.prototype.withAmount = function (amount) {
193
- if (amount !== undefined) {
194
- this.amount = amount;
195
- }
196
- return this;
197
- };
198
- /**
199
- * Sets the transaction's authorization amount; where applicable.
200
- *
201
- * This is a specialized field. In most cases,
202
- * `Authorization.withAmount` should be used.
203
- *
204
- * @param authAmount The authorization amount
205
- * @returns AuthorizationBuilder
206
- */
207
- AuthorizationBuilder.prototype.withAuthAmount = function (authAmount) {
208
- if (authAmount !== undefined) {
209
- this.authAmount = authAmount;
210
- }
211
- return this;
212
- };
213
- AuthorizationBuilder.prototype.withBalanceInquiryType = function (inquiry) {
214
- if (inquiry !== undefined) {
215
- this.balanceInquiryType = inquiry;
216
- }
217
- return this;
218
- };
219
- /**
220
- * Sets Credential on File fields
221
- */
222
- AuthorizationBuilder.prototype.withCardBrandStorage = function (transactionInitiator, value) {
223
- this.transactionInitiator = transactionInitiator;
224
- if (value !== undefined) {
225
- this.cardBrandTransactionId = value;
226
- }
227
- return this;
228
- };
229
- /**
230
- * Sets the cash back amount.
231
- *
232
- * This is a specialized field for debit or EBT transactions.
233
- *
234
- * @param amount The desired cash back amount
235
- * @returns AuthorizationBuilder
236
- */
237
- AuthorizationBuilder.prototype.withCashBack = function (amount) {
238
- if (amount !== undefined) {
239
- this.cashBackAmount = amount;
240
- this.transactionModifier = __1.TransactionModifier.CashBack;
241
- }
242
- return this;
243
- };
244
- /**
245
- * Sets the client transaction ID.
246
- *
247
- * This is an application derived value that can be used to identify a
248
- * transaction in case a gateway transaction ID is not returned, e.g.
249
- * in cases of timeouts.
250
- *
251
- * The supplied value should be unique to the configured merchant or
252
- * terminal account.
253
- *
254
- * @param clientTransactionId The client transaction ID
255
- * @returns AuthorizationBuilder
256
- */
257
- AuthorizationBuilder.prototype.withClientTransactionId = function (clientTransactionId) {
258
- if (clientTransactionId === undefined) {
259
- return this;
260
- }
261
- if (this.transactionType !== __1.TransactionType.Reversal &&
262
- this.transactionType !== __1.TransactionType.Refund) {
263
- this.clientTransactionId = clientTransactionId;
264
- return this;
265
- }
266
- if (!(this.paymentMethod instanceof __1.TransactionReference)) {
267
- this.paymentMethod = new __1.TransactionReference();
268
- }
269
- this
270
- .paymentMethod.clientTransactionId = clientTransactionId;
271
- return this;
272
- };
273
- /**
274
- * Sets the transaction's currency; where applicable.
275
- *
276
- * The formatting for the supplied value will currently depend on
277
- * the configured gateway's requirements.
278
- *
279
- * @param currency The currency
280
- * @returns AuthorizationBuilder
281
- */
282
- AuthorizationBuilder.prototype.withCurrency = function (currency) {
283
- if (currency !== undefined) {
284
- this.currency = currency;
285
- }
286
- return this;
287
- };
288
- /**
289
- * Sets the customer ID; where applicable.
290
- *
291
- * This is an application/merchant generated value.
292
- *
293
- * @param customerId The customer ID
294
- * @returns AuthorizationBuilder
295
- */
296
- AuthorizationBuilder.prototype.withCustomerId = function (customerId) {
297
- if (customerId !== undefined) {
298
- this.customerId = customerId;
299
- }
300
- return this;
301
- };
302
- /**
303
- * Sets the customer's IP address; where applicable.
304
- *
305
- * This value should be obtained during the payment process.
306
- *
307
- * @param customerIpAddress The customer's IP address
308
- * @returns AuthorizationBuilder
309
- */
310
- AuthorizationBuilder.prototype.withCustomerIpAddress = function (customerIpAddress) {
311
- if (customerIpAddress !== undefined) {
312
- this.customerIpAddress = customerIpAddress;
313
- }
314
- return this;
315
- };
316
- /**
317
- * Sets the CVN value for recurring payments; where applicable.
318
- *
319
- * @param cvn CVN value to use in the request
320
- * @returns AuthorizationBuilder
321
- */
322
- AuthorizationBuilder.prototype.withCvn = function (cvn) {
323
- if (cvn !== undefined) {
324
- this.cvn = cvn;
325
- }
326
- return this;
327
- };
328
- /**
329
- * Sets the transaction's description.
330
- *
331
- * This value is not guaranteed to be sent in the authorization
332
- * or settlement process.
333
- *
334
- * @param description The description
335
- * @returns AuthorizationBuilder
336
- */
337
- AuthorizationBuilder.prototype.withDescription = function (description) {
338
- if (description !== undefined) {
339
- this.description = description;
340
- }
341
- return this;
342
- };
343
- /**
344
- * Sets the transaction's dynamic descriptor.
345
- *
346
- * This value is sent during the authorization process and is displayed
347
- * in the consumer's account.
348
- *
349
- * @param dynamicDescriptor The dynamic descriptor
350
- * @returns AuthorizationBuilder
351
- */
352
- AuthorizationBuilder.prototype.withDynamicDescriptor = function (dynamicDescriptor) {
353
- if (dynamicDescriptor !== undefined) {
354
- this.dynamicDescriptor = dynamicDescriptor;
355
- }
356
- return this;
357
- };
358
- /**
359
- * Sets eCommerce specific data; where applicable.
360
- *
361
- * This can include:
362
- *
363
- * - Consumer authentication (3DSecure) data
364
- * - Direct market data
365
- *
366
- * @param ecommerceInfo The eCommerce data
367
- * @returns AuthorizationBuilder
368
- */
369
- AuthorizationBuilder.prototype.withEcommerceInfo = function (ecommerceInfo) {
370
- if (ecommerceInfo !== undefined) {
371
- this.ecommerceInfo = ecommerceInfo;
372
- }
373
- return this;
374
- };
375
- /**
376
- * Sets the gratuity amount; where applicable.
377
- *
378
- * This value is information only and does not affect
379
- * the authorization amount.
380
- *
381
- * @param gratuity The gratuity amount
382
- * @returns AuthorizationBuilder
383
- */
384
- AuthorizationBuilder.prototype.withGratuity = function (gratuity) {
385
- if (gratuity !== undefined) {
386
- this.gratuity = gratuity;
387
- }
388
- return this;
389
- };
390
- /**
391
- * Sets the Convenience amount; where applicable.
392
- *
393
- * @param convenienceAmt The Convenience amount
394
- * @returns AuthorizationBuilder
395
- */
396
- AuthorizationBuilder.prototype.withConvenienceAmt = function (convenienceAmt) {
397
- if (convenienceAmt !== undefined) {
398
- this.convenienceAmt = convenienceAmt;
399
- }
400
- return this;
401
- };
402
- /**
403
- * Sets the Shipping amount; where applicable.
404
- *
405
- * @param shippingAmt The Shipping amount
406
- * @returns AuthorizationBuilder
407
- */
408
- AuthorizationBuilder.prototype.withShippingAmt = function (shippingAmt) {
409
- if (shippingAmt !== undefined) {
410
- this.shippingAmt = shippingAmt;
411
- }
412
- return this;
413
- };
414
- /**
415
- * Additional hosted payment specific information for Realex HPP implementation.
416
- *
417
- * @param hostedPaymentData The hosted payment data
418
- * @returns AuthorizationBuilder
419
- */
420
- AuthorizationBuilder.prototype.withHostedPaymentData = function (hostedPaymentData) {
421
- var client = __1.ServicesContainer.instance().getClient();
422
- if (!client.supportsHostedPayments) {
423
- throw new __1.UnsupportedTransactionError("Your current gateway does not support hosted payments.");
424
- }
425
- if (hostedPaymentData !== undefined) {
426
- this.hostedPaymentData = hostedPaymentData;
427
- }
428
- return this;
429
- };
430
- /**
431
- * Sets the invoice number; where applicable.
432
- *
433
- * @param invoiceNumber The invoice number
434
- * @returns AuthorizationBuilder
435
- */
436
- AuthorizationBuilder.prototype.withInvoiceNumber = function (invoiceNumber) {
437
- if (invoiceNumber !== undefined) {
438
- this.invoiceNumber = invoiceNumber;
439
- }
440
- return this;
441
- };
442
- /**
443
- * Sets the commercial request flag; where applicable.
444
- *
445
- * This flag indicates commercial purchase cards are accepted/expected.
446
- * The application should inspect the transaction response and pass the
447
- * appropriate Level II data when necessary.
448
- *
449
- * @param level2Request The commercial request flag
450
- * @returns AuthorizationBuilder
451
- */
452
- AuthorizationBuilder.prototype.withCommercialRequest = function (level2Request) {
453
- if (level2Request !== undefined) {
454
- this.level2Request = level2Request;
455
- }
456
- return this;
457
- };
458
- /**
459
- * Sets the offline authorization code; where applicable.
460
- *
461
- * The merchant is required to supply this value as obtained when
462
- * calling the issuing bank for the authorization.
463
- *
464
- * @param offlineAuthCode The offline authorization code
465
- * @returns AuthorizationBuilder
466
- */
467
- AuthorizationBuilder.prototype.withOfflineAuthCode = function (offlineAuthCode) {
468
- if (offlineAuthCode !== undefined) {
469
- this.offlineAuthCode = offlineAuthCode;
470
- this.transactionModifier = __1.TransactionModifier.Offline;
471
- }
472
- return this;
473
- };
474
- /**
475
- * Sets the one-time payment flag; where applicable.
476
- *
477
- * This is only useful when using recurring payment profiles for
478
- * one-time payments that are not a part of a recurring schedule.
479
- *
480
- * @param oneTimePayment The one-time flag
481
- * @returns AuthorizationBuilder
482
- */
483
- AuthorizationBuilder.prototype.withOneTimePayment = function (oneTimePayment) {
484
- if (oneTimePayment !== undefined) {
485
- this.oneTimePayment = oneTimePayment;
486
- this.transactionModifier = __1.TransactionModifier.Recurring;
487
- }
488
- return this;
489
- };
490
- /**
491
- * Sets the transaction's order ID; where applicable.
492
- *
493
- * @param orderId The order ID
494
- * @returns AuthorizationBuilder
495
- */
496
- AuthorizationBuilder.prototype.withOrderId = function (orderId) {
497
- if (orderId !== undefined) {
498
- this.orderId = orderId;
499
- }
500
- return this;
501
- };
502
- /**
503
- * Sets the transaction's product ID; where applicable.
504
- *
505
- * @param productId The product ID
506
- * @returns AuthorizationBuilder
507
- */
508
- AuthorizationBuilder.prototype.withProductId = function (productId) {
509
- if (productId !== undefined) {
510
- this.productId = productId;
511
- }
512
- return this;
513
- };
514
- /**
515
- * Sets the Recurring Info for Realex based recurring payments;
516
- * where applicable.
517
- *
518
- * @param type The value can be 'fixed' or 'variable' depending on whether
519
- * the amount will change for each transaction.
520
- * @param sequence Indicates where in the recurring sequence the transaction
521
- * occurs. Must be 'first' for the first transaction for this
522
- * card, 'subsequent' for transactions after that, and 'last'
523
- * for the final transaction of the set.
524
- * @returns AuthorizationBuilder
525
- */
526
- AuthorizationBuilder.prototype.withRecurringInfo = function (type, sequence) {
527
- if (type !== undefined) {
528
- this.recurringType = type;
529
- }
530
- if (sequence !== undefined) {
531
- this.recurringSequence = sequence;
532
- }
533
- return this;
534
- };
535
- /**
536
- * Requests multi-use tokenization / card storage.
537
- *
538
- * This will depend on a successful transaction. If there was a failure
539
- * or decline, the multi-use tokenization / card storage will not be
540
- * successful.
541
- *
542
- * @param requestMultiUseToken The request flag
543
- * @returns AuthorizationBuilder
544
- */
545
- AuthorizationBuilder.prototype.withRequestMultiUseToken = function (requestMultiUseToken) {
546
- if (requestMultiUseToken !== undefined) {
547
- this.requestMultiUseToken = requestMultiUseToken;
548
- }
549
- return this;
550
- };
551
- AuthorizationBuilder.prototype.withReplacementCard = function (replacementCard) {
552
- if (replacementCard !== undefined) {
553
- this.replacementCard = replacementCard;
554
- }
555
- return this;
556
- };
557
- /**
558
- * Sets the schedule ID associated with the transaction; where applicable.
559
- *
560
- * This is specific to transactions against recurring profiles that are
561
- * a part of a recurring schedule.
562
- *
563
- * @param scheduleId The schedule ID
564
- * @returns AuthorizationBuilder
565
- */
566
- AuthorizationBuilder.prototype.withScheduleId = function (scheduleId) {
567
- if (scheduleId !== undefined) {
568
- this.scheduleId = scheduleId;
569
- }
570
- return this;
571
- };
572
- /**
573
- * Sets the related gateway transaction ID; where applicable.
574
- *
575
- * This value is used to associated a previous transaction with the
576
- * current transaction.
577
- *
578
- * @param transactionId The gateway transaction ID
579
- * @returns AuthorizationBuilder
580
- */
581
- AuthorizationBuilder.prototype.withTransactionId = function (transactionId) {
582
- if (transactionId === undefined) {
583
- return this;
584
- }
585
- if (this.paymentMethod instanceof __1.TransactionReference) {
586
- this.paymentMethod.transactionId = transactionId;
587
- return this;
588
- }
589
- return this.withPaymentMethod(new __1.TransactionReference(transactionId));
590
- };
591
- AuthorizationBuilder.prototype.withTimestamp = function (timestamp) {
592
- if (timestamp !== undefined) {
593
- this.timestamp = timestamp;
594
- }
595
- return this;
596
- };
597
- return AuthorizationBuilder;
598
- }(TransactionBuilder_1.TransactionBuilder));
599
- exports.AuthorizationBuilder = AuthorizationBuilder;
@@ -1,14 +0,0 @@
1
- import { BaseBuilder } from "../";
2
- import { Validations } from "./Validations";
3
- import { ValidationTarget } from "./ValidationTarget";
4
- export declare class ValidationClause {
5
- parent: Validations;
6
- target: ValidationTarget;
7
- callback: <T>(build: BaseBuilder<T>) => boolean;
8
- message: string;
9
- precondition: boolean;
10
- constructor(parent: Validations, target: ValidationTarget, precondition?: boolean);
11
- isNotNull(message?: string): ValidationTarget;
12
- isNull(message?: string): ValidationTarget;
13
- isNotEmpty(message?: string): ValidationTarget;
14
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationClause = void 0;
4
- var ValidationClause = /** @class */ (function () {
5
- function ValidationClause(parent, target, precondition) {
6
- if (precondition === void 0) { precondition = false; }
7
- this.parent = parent;
8
- this.target = target;
9
- this.precondition = precondition;
10
- }
11
- ValidationClause.prototype.isNotNull = function (message) {
12
- var _this = this;
13
- this.callback = function (builder) {
14
- var value = builder[_this.target.property];
15
- return undefined !== value && null !== value;
16
- };
17
- this.message = message
18
- ? message
19
- : this.target.property + " cannot be null for this transaction type.";
20
- if (this.precondition) {
21
- return this.target;
22
- }
23
- return this.parent
24
- .of(this.target.enumName, this.target.type)
25
- .with(this.target.constraintProperty, this.target.constraint);
26
- };
27
- ValidationClause.prototype.isNull = function (message) {
28
- var _this = this;
29
- this.callback = function (builder) {
30
- var value = builder[_this.target.property];
31
- return undefined === value || null === value;
32
- };
33
- this.message = message
34
- ? message
35
- : this.target.property + " cannot be set for this transaction type.";
36
- if (this.precondition) {
37
- return this.target;
38
- }
39
- return this.parent
40
- .of(this.target.enumName, this.target.type)
41
- .with(this.target.constraintProperty, this.target.constraint);
42
- };
43
- ValidationClause.prototype.isNotEmpty = function (message) {
44
- var _this = this;
45
- this.callback = function (builder) {
46
- var value = builder[_this.target.property];
47
- return !!value;
48
- };
49
- this.message = message
50
- ? message
51
- : this.target.property + " cannot be empty for this transaction type.";
52
- if (this.precondition) {
53
- return this.target;
54
- }
55
- return this.parent
56
- .of(this.target.enumName, this.target.type)
57
- .with(this.target.constraintProperty, this.target.constraint);
58
- };
59
- return ValidationClause;
60
- }());
61
- exports.ValidationClause = ValidationClause;
@@ -1,16 +0,0 @@
1
- import { ValidationClause } from "./ValidationClause";
2
- import { Validations } from "./Validations";
3
- export declare class ValidationTarget {
4
- parent: Validations;
5
- type: number;
6
- property: string;
7
- clause: ValidationClause;
8
- constraint: number;
9
- constraintProperty: string;
10
- enumName: string;
11
- precondition: ValidationClause;
12
- constructor(parent: Validations, enumName: string, type: number);
13
- with(property: string, constraint: number): this;
14
- check(targetProperty: string): ValidationClause;
15
- when(targetProperty: string): ValidationClause;
16
- }