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,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationTarget = void 0;
4
- var ValidationClause_1 = require("./ValidationClause");
5
- var ValidationTarget = /** @class */ (function () {
6
- function ValidationTarget(parent, enumName, type) {
7
- this.parent = parent;
8
- this.type = type;
9
- this.enumName = enumName;
10
- }
11
- ValidationTarget.prototype.with = function (property, constraint) {
12
- this.constraintProperty = property;
13
- this.constraint = constraint;
14
- return this;
15
- };
16
- ValidationTarget.prototype.check = function (targetProperty) {
17
- this.property = targetProperty;
18
- this.clause = new ValidationClause_1.ValidationClause(this.parent, this);
19
- return this.clause;
20
- };
21
- ValidationTarget.prototype.when = function (targetProperty) {
22
- this.property = targetProperty;
23
- this.precondition = new ValidationClause_1.ValidationClause(this.parent, this, true);
24
- return this.precondition;
25
- };
26
- return ValidationTarget;
27
- }());
28
- exports.ValidationTarget = ValidationTarget;
@@ -1,11 +0,0 @@
1
- import { BaseBuilder } from "../../";
2
- import { ValidationTarget } from "./ValidationTarget";
3
- export interface IRuleSet {
4
- [key: string]: ValidationTarget[][];
5
- }
6
- export declare class Validations {
7
- rules: IRuleSet;
8
- constructor();
9
- of(enumProperty: string, type: number): ValidationTarget;
10
- validate<T>(builder: BaseBuilder<T>): void;
11
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Validations = void 0;
4
- var __1 = require("../../");
5
- var ValidationTarget_1 = require("./ValidationTarget");
6
- var Validations = /** @class */ (function () {
7
- function Validations() {
8
- this.rules = {};
9
- }
10
- Validations.prototype.of = function (enumProperty, type) {
11
- if (!this.rules.hasOwnProperty(enumProperty)) {
12
- this.rules[enumProperty] = [];
13
- }
14
- if (!this.rules[enumProperty].hasOwnProperty(type.toString())) {
15
- this.rules[enumProperty][type] = [];
16
- }
17
- var target = new ValidationTarget_1.ValidationTarget(this, enumProperty, type);
18
- this.rules[enumProperty][type].push(target);
19
- return target;
20
- };
21
- Validations.prototype.validate = function (builder) {
22
- var _this = this;
23
- Object.keys(this.rules).forEach(function (enumName) {
24
- _this.rules[enumName].forEach(function (rules, iKey) {
25
- var value = builder[enumName];
26
- if ((value === undefined || value === null) &&
27
- builder instanceof __1.TransactionBuilder &&
28
- builder.paymentMethod) {
29
- value = builder.paymentMethod[enumName];
30
- if (value === undefined || value === null) {
31
- return;
32
- }
33
- }
34
- if ((iKey & value) !== value) {
35
- return;
36
- }
37
- for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) {
38
- var validation = rules_1[_i];
39
- if (!validation.clause) {
40
- continue;
41
- }
42
- if (validation.constraint !== undefined &&
43
- validation.constraint !== null &&
44
- validation.constraint !== builder[validation.constraintProperty]) {
45
- continue;
46
- }
47
- if (!validation.clause.callback(builder)) {
48
- throw new __1.BuilderError(validation.clause.message);
49
- }
50
- }
51
- });
52
- });
53
- };
54
- return Validations;
55
- }());
56
- exports.Validations = Validations;
@@ -1,11 +0,0 @@
1
- import { Validations } from "./BaseBuilder/Validations";
2
- export interface IDictionary<T> {
3
- [key: string]: T;
4
- }
5
- export declare abstract class BaseBuilder<T> {
6
- protected validations: Validations;
7
- [key: string]: any;
8
- constructor();
9
- execute(): Promise<T | undefined>;
10
- protected abstract setupValidations(): void;
11
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseBuilder = void 0;
4
- var Validations_1 = require("./BaseBuilder/Validations");
5
- var BaseBuilder = /** @class */ (function () {
6
- function BaseBuilder() {
7
- this.validations = new Validations_1.Validations();
8
- this.setupValidations();
9
- }
10
- BaseBuilder.prototype.execute = function () {
11
- this.validations.validate(this);
12
- return Promise.resolve(undefined);
13
- };
14
- return BaseBuilder;
15
- }());
16
- exports.BaseBuilder = BaseBuilder;
@@ -1,103 +0,0 @@
1
- import { ReasonCode, TaxType, Transaction } from "../";
2
- import { TransactionBuilder } from "./TransactionBuilder";
3
- export declare class ManagementBuilder extends TransactionBuilder<Transaction> {
4
- amount: string | number;
5
- authAmount: string | number;
6
- get authorizationCode(): string | undefined;
7
- get clientTransactionId(): string | undefined;
8
- currency: string;
9
- description: string;
10
- gratuity: string | number;
11
- get orderId(): string | undefined;
12
- poNumber: string;
13
- reasonCode?: ReasonCode;
14
- taxAmount: string | number;
15
- taxType: TaxType;
16
- get transactionId(): string | undefined;
17
- constructor(type: number);
18
- /**
19
- * Executes the builder against the gateway.
20
- *
21
- * @returns Promise<Transaction>
22
- */
23
- execute(): Promise<Transaction>;
24
- protected setupValidations(): void;
25
- /**
26
- * Sets the current transaction's amount.
27
- *
28
- * @param amount The amount
29
- * @returns ManagementBuilder
30
- */
31
- withAmount(amount?: string | number): this;
32
- /**
33
- * Sets the current transaction's authorized amount; where applicable.
34
- *
35
- * @param amount The authorized amount
36
- * @returns ManagementBuilder
37
- */
38
- withAuthAmount(amount?: string | number): this;
39
- /**
40
- * Sets the currency.
41
- *
42
- * The formatting for the supplied value will currently depend on
43
- * the configured gateway's requirements.
44
- *
45
- * @param currency The currency
46
- * @returns ManagementBuilder
47
- */
48
- withCurrency(currency?: string): this;
49
- /**
50
- * Sets the transaction's description.
51
- *
52
- * This value is not guaranteed to be sent in the authorization
53
- * or settlement process.
54
- *
55
- * @param description The description
56
- * @returns ManagementBuilder
57
- */
58
- withDescription(description?: string): this;
59
- /**
60
- * Sets the gratuity amount; where applicable.
61
- *
62
- * This value is information only and does not affect
63
- * the authorization amount.
64
- *
65
- * @param gratuity The gratuity amount
66
- * @returns ManagementBuilder
67
- */
68
- withGratuity(gratuity?: string | number): this;
69
- /**
70
- * Sets the purchase order number; where applicable.
71
- *
72
- * @param poNumber The PO number
73
- * @returns ManagementBuilder
74
- */
75
- withPoNumber(poNumber?: string): this;
76
- /**
77
- * Sets the reason code for the transaction.
78
- *
79
- * @param reasonCode The reason code
80
- * @returns ManagementBuilder
81
- */
82
- withReasonCode(reasonCode?: ReasonCode): this;
83
- /**
84
- * Sets the tax amount.
85
- *
86
- * Useful for commercial purchase card requests.
87
- *
88
- * @see AuthorizationBuilder.WithCommercialRequest
89
- * @param amount The tax amount
90
- * @returns ManagementBuilder
91
- */
92
- withTaxAmount(amount?: string | number): this;
93
- /**
94
- * Sets the tax type.
95
- *
96
- * Useful for commercial purchase card requests.
97
- *
98
- * @see AuthorizationBuilder.withCommercialRequest
99
- * @param type The tax type
100
- * @returns ManagementBuilder
101
- */
102
- withTaxType(type?: TaxType): this;
103
- }
@@ -1,227 +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.ManagementBuilder = void 0;
19
- var __1 = require("../");
20
- var TransactionBuilder_1 = require("./TransactionBuilder");
21
- var ManagementBuilder = /** @class */ (function (_super) {
22
- __extends(ManagementBuilder, _super);
23
- function ManagementBuilder(type) {
24
- return _super.call(this, type) || this;
25
- }
26
- Object.defineProperty(ManagementBuilder.prototype, "authorizationCode", {
27
- get: function () {
28
- if (this.paymentMethod instanceof __1.TransactionReference) {
29
- return this.paymentMethod.authCode;
30
- }
31
- return undefined;
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
- Object.defineProperty(ManagementBuilder.prototype, "clientTransactionId", {
37
- get: function () {
38
- if (this.paymentMethod instanceof __1.TransactionReference) {
39
- return this.paymentMethod.clientTransactionId;
40
- }
41
- return undefined;
42
- },
43
- enumerable: false,
44
- configurable: true
45
- });
46
- Object.defineProperty(ManagementBuilder.prototype, "orderId", {
47
- get: function () {
48
- if (this.paymentMethod instanceof __1.TransactionReference) {
49
- return this.paymentMethod.orderId;
50
- }
51
- return undefined;
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- Object.defineProperty(ManagementBuilder.prototype, "transactionId", {
57
- get: function () {
58
- if (this.paymentMethod instanceof __1.TransactionReference) {
59
- return this.paymentMethod.transactionId;
60
- }
61
- return undefined;
62
- },
63
- enumerable: false,
64
- configurable: true
65
- });
66
- /**
67
- * Executes the builder against the gateway.
68
- *
69
- * @returns Promise<Transaction>
70
- */
71
- ManagementBuilder.prototype.execute = function () {
72
- _super.prototype.execute.call(this);
73
- return __1.ServicesContainer.instance()
74
- .getClient()
75
- .manageTransaction(this);
76
- };
77
- ManagementBuilder.prototype.setupValidations = function () {
78
- this.validations
79
- .of("transactionType",
80
- /* tslint:disable:trailing-comma */
81
- __1.TransactionType.Capture |
82
- __1.TransactionType.Edit |
83
- __1.TransactionType.Hold |
84
- __1.TransactionType.Release)
85
- .check("transactionId")
86
- .isNotNull();
87
- this.validations
88
- .of("transactionType", __1.TransactionType.Edit)
89
- .with("transactionModifier", __1.TransactionModifier.LevelII)
90
- .check("taxType")
91
- .isNotNull();
92
- this.validations
93
- .of("transactionType", __1.TransactionType.Refund)
94
- .when("amount")
95
- .isNotNull()
96
- .check("currency")
97
- .isNotNull();
98
- };
99
- /**
100
- * Sets the current transaction's amount.
101
- *
102
- * @param amount The amount
103
- * @returns ManagementBuilder
104
- */
105
- ManagementBuilder.prototype.withAmount = function (amount) {
106
- if (amount !== undefined) {
107
- this.amount = amount;
108
- }
109
- return this;
110
- };
111
- /**
112
- * Sets the current transaction's authorized amount; where applicable.
113
- *
114
- * @param amount The authorized amount
115
- * @returns ManagementBuilder
116
- */
117
- ManagementBuilder.prototype.withAuthAmount = function (amount) {
118
- if (amount !== undefined) {
119
- this.authAmount = amount;
120
- }
121
- return this;
122
- };
123
- /**
124
- * Sets the currency.
125
- *
126
- * The formatting for the supplied value will currently depend on
127
- * the configured gateway's requirements.
128
- *
129
- * @param currency The currency
130
- * @returns ManagementBuilder
131
- */
132
- ManagementBuilder.prototype.withCurrency = function (currency) {
133
- if (currency !== undefined) {
134
- this.currency = currency;
135
- }
136
- return this;
137
- };
138
- /**
139
- * Sets the transaction's description.
140
- *
141
- * This value is not guaranteed to be sent in the authorization
142
- * or settlement process.
143
- *
144
- * @param description The description
145
- * @returns ManagementBuilder
146
- */
147
- ManagementBuilder.prototype.withDescription = function (description) {
148
- if (description !== undefined) {
149
- this.description = description;
150
- }
151
- return this;
152
- };
153
- /**
154
- * Sets the gratuity amount; where applicable.
155
- *
156
- * This value is information only and does not affect
157
- * the authorization amount.
158
- *
159
- * @param gratuity The gratuity amount
160
- * @returns ManagementBuilder
161
- */
162
- ManagementBuilder.prototype.withGratuity = function (gratuity) {
163
- if (gratuity !== undefined) {
164
- this.gratuity = gratuity;
165
- }
166
- return this;
167
- };
168
- /**
169
- * Sets the purchase order number; where applicable.
170
- *
171
- * @param poNumber The PO number
172
- * @returns ManagementBuilder
173
- */
174
- ManagementBuilder.prototype.withPoNumber = function (poNumber) {
175
- this.transactionModifier = __1.TransactionModifier.LevelII;
176
- if (poNumber !== undefined) {
177
- this.poNumber = poNumber;
178
- }
179
- return this;
180
- };
181
- /**
182
- * Sets the reason code for the transaction.
183
- *
184
- * @param reasonCode The reason code
185
- * @returns ManagementBuilder
186
- */
187
- ManagementBuilder.prototype.withReasonCode = function (reasonCode) {
188
- if (reasonCode !== undefined) {
189
- this.reasonCode = reasonCode;
190
- }
191
- return this;
192
- };
193
- /**
194
- * Sets the tax amount.
195
- *
196
- * Useful for commercial purchase card requests.
197
- *
198
- * @see AuthorizationBuilder.WithCommercialRequest
199
- * @param amount The tax amount
200
- * @returns ManagementBuilder
201
- */
202
- ManagementBuilder.prototype.withTaxAmount = function (amount) {
203
- this.transactionModifier = __1.TransactionModifier.LevelII;
204
- if (amount !== undefined) {
205
- this.taxAmount = amount;
206
- }
207
- return this;
208
- };
209
- /**
210
- * Sets the tax type.
211
- *
212
- * Useful for commercial purchase card requests.
213
- *
214
- * @see AuthorizationBuilder.withCommercialRequest
215
- * @param type The tax type
216
- * @returns ManagementBuilder
217
- */
218
- ManagementBuilder.prototype.withTaxType = function (type) {
219
- this.transactionModifier = __1.TransactionModifier.LevelII;
220
- if (type !== undefined) {
221
- this.taxType = type;
222
- }
223
- return this;
224
- };
225
- return ManagementBuilder;
226
- }(TransactionBuilder_1.TransactionBuilder));
227
- exports.ManagementBuilder = ManagementBuilder;
@@ -1,13 +0,0 @@
1
- import { IRecurringEntity, TransactionType } from "../";
2
- import { TransactionBuilder } from "./TransactionBuilder";
3
- import { IDictionary } from "./BaseBuilder";
4
- export declare class RecurringBuilder<T extends IRecurringEntity> extends TransactionBuilder<T> {
5
- key: string;
6
- orderId: string;
7
- entity: IRecurringEntity | Function;
8
- searchCriteria: IDictionary<string>;
9
- constructor(type: TransactionType, entity?: IRecurringEntity | Function);
10
- addSearchCriteria(key: string, value: string): this;
11
- execute(): Promise<T>;
12
- setupValidations(): void;
13
- }
@@ -1,47 +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.RecurringBuilder = void 0;
19
- var __1 = require("../");
20
- var TransactionBuilder_1 = require("./TransactionBuilder");
21
- var RecurringBuilder = /** @class */ (function (_super) {
22
- __extends(RecurringBuilder, _super);
23
- function RecurringBuilder(type, entity) {
24
- var _this = _super.call(this, type) || this;
25
- _this.searchCriteria = {};
26
- if (entity) {
27
- _this.entity = entity;
28
- _this.key = entity.key;
29
- }
30
- return _this;
31
- }
32
- RecurringBuilder.prototype.addSearchCriteria = function (key, value) {
33
- this.searchCriteria[key] = value;
34
- return this;
35
- };
36
- RecurringBuilder.prototype.execute = function () {
37
- _super.prototype.execute.call(this);
38
- return __1.ServicesContainer.instance()
39
- .getRecurringClient()
40
- .processRecurring(this);
41
- };
42
- RecurringBuilder.prototype.setupValidations = function () {
43
- // todo
44
- };
45
- return RecurringBuilder;
46
- }(TransactionBuilder_1.TransactionBuilder));
47
- exports.RecurringBuilder = RecurringBuilder;
@@ -1,8 +0,0 @@
1
- import { ReportType, TimeZoneConversion } from "../";
2
- import { BaseBuilder } from "./BaseBuilder";
3
- export declare abstract class ReportBuilder<T> extends BaseBuilder<T> {
4
- reportType: ReportType;
5
- timeZoneConversion: TimeZoneConversion;
6
- constructor(type: ReportType);
7
- execute(): Promise<T>;
8
- }
@@ -1,36 +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.ReportBuilder = void 0;
19
- var __1 = require("../");
20
- var BaseBuilder_1 = require("./BaseBuilder");
21
- var ReportBuilder = /** @class */ (function (_super) {
22
- __extends(ReportBuilder, _super);
23
- function ReportBuilder(type) {
24
- var _this = _super.call(this) || this;
25
- _this.reportType = type;
26
- return _this;
27
- }
28
- ReportBuilder.prototype.execute = function () {
29
- _super.prototype.execute.call(this);
30
- return __1.ServicesContainer.instance()
31
- .getClient()
32
- .processReport(this);
33
- };
34
- return ReportBuilder;
35
- }(BaseBuilder_1.BaseBuilder));
36
- exports.ReportBuilder = ReportBuilder;
@@ -1,10 +0,0 @@
1
- import { IPaymentMethod, PaymentMethod, TransactionModifier, TransactionType } from "../";
2
- import { BaseBuilder } from "./BaseBuilder";
3
- export declare abstract class TransactionBuilder<T> extends BaseBuilder<T> {
4
- paymentMethod: PaymentMethod;
5
- transactionType: TransactionType;
6
- transactionModifier: TransactionModifier;
7
- constructor(type: TransactionType, paymentMethod?: IPaymentMethod);
8
- withModifier(modifier?: TransactionModifier): this;
9
- withPaymentMethod(paymentMethod?: IPaymentMethod): this;
10
- }
@@ -1,46 +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.TransactionBuilder = void 0;
19
- var __1 = require("../");
20
- var BaseBuilder_1 = require("./BaseBuilder");
21
- var TransactionBuilder = /** @class */ (function (_super) {
22
- __extends(TransactionBuilder, _super);
23
- function TransactionBuilder(type, paymentMethod) {
24
- var _this = _super.call(this) || this;
25
- _this.transactionModifier = __1.TransactionModifier.None;
26
- _this.transactionType = type;
27
- if (paymentMethod) {
28
- _this.paymentMethod = paymentMethod;
29
- }
30
- return _this;
31
- }
32
- TransactionBuilder.prototype.withModifier = function (modifier) {
33
- if (modifier !== undefined) {
34
- this.transactionModifier = modifier;
35
- }
36
- return this;
37
- };
38
- TransactionBuilder.prototype.withPaymentMethod = function (paymentMethod) {
39
- if (paymentMethod !== undefined) {
40
- this.paymentMethod = paymentMethod;
41
- }
42
- return this;
43
- };
44
- return TransactionBuilder;
45
- }(BaseBuilder_1.BaseBuilder));
46
- exports.TransactionBuilder = TransactionBuilder;
@@ -1,15 +0,0 @@
1
- import { ReportBuilder } from "./ReportBuilder";
2
- import { IDictionary } from "./BaseBuilder";
3
- export declare class TransactionReportBuilder<T> extends ReportBuilder<T> {
4
- deviceId: string;
5
- endDate: Date;
6
- startDate: Date;
7
- transactionId: string;
8
- searchCriteria: IDictionary<string>;
9
- setupValidations(): void;
10
- withDeviceId(deviceId?: string): this;
11
- withEndDate(endDate?: Date): this;
12
- withStartDate(startDate?: Date): this;
13
- withTransactionId(transactionId?: string): this;
14
- where(criteria: string, value: string): this;
15
- }