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.
- package/CHANGELOG.md +11 -1
- package/package.json +3 -4
- package/lib/src/Builders/AuthorizationBuilder.d.ts +0 -325
- package/lib/src/Builders/AuthorizationBuilder.js +0 -599
- package/lib/src/Builders/BaseBuilder/ValidationClause.d.ts +0 -14
- package/lib/src/Builders/BaseBuilder/ValidationClause.js +0 -61
- package/lib/src/Builders/BaseBuilder/ValidationTarget.d.ts +0 -16
- package/lib/src/Builders/BaseBuilder/ValidationTarget.js +0 -28
- package/lib/src/Builders/BaseBuilder/Validations.d.ts +0 -11
- package/lib/src/Builders/BaseBuilder/Validations.js +0 -56
- package/lib/src/Builders/BaseBuilder.d.ts +0 -11
- package/lib/src/Builders/BaseBuilder.js +0 -16
- package/lib/src/Builders/ManagementBuilder.d.ts +0 -103
- package/lib/src/Builders/ManagementBuilder.js +0 -227
- package/lib/src/Builders/RecurringBuilder.d.ts +0 -13
- package/lib/src/Builders/RecurringBuilder.js +0 -47
- package/lib/src/Builders/ReportBuilder.d.ts +0 -8
- package/lib/src/Builders/ReportBuilder.js +0 -36
- package/lib/src/Builders/TransactionBuilder.d.ts +0 -10
- package/lib/src/Builders/TransactionBuilder.js +0 -46
- package/lib/src/Builders/TransactionReportBuilder.d.ts +0 -15
- package/lib/src/Builders/TransactionReportBuilder.js +0 -79
- package/lib/src/Builders/index.d.ts +0 -7
- package/lib/src/Builders/index.js +0 -19
- package/lib/src/Entities/Address.d.ts +0 -13
- package/lib/src/Entities/Address.js +0 -19
- package/lib/src/Entities/BatchSummary.d.ts +0 -6
- package/lib/src/Entities/BatchSummary.js +0 -9
- package/lib/src/Entities/Customer.d.ts +0 -64
- package/lib/src/Entities/Customer.js +0 -47
- package/lib/src/Entities/EcommerceInfo.d.ts +0 -12
- package/lib/src/Entities/EcommerceInfo.js +0 -14
- package/lib/src/Entities/EncryptionData.d.ts +0 -6
- package/lib/src/Entities/EncryptionData.js +0 -9
- package/lib/src/Entities/Enums.d.ts +0 -230
- package/lib/src/Entities/Enums.js +0 -267
- package/lib/src/Entities/Errors.d.ts +0 -23
- package/lib/src/Entities/Errors.js +0 -106
- package/lib/src/Entities/HostedPaymentData.d.ts +0 -10
- package/lib/src/Entities/HostedPaymentData.js +0 -10
- package/lib/src/Entities/RecurringEntity.d.ts +0 -14
- package/lib/src/Entities/RecurringEntity.js +0 -86
- package/lib/src/Entities/Schedule.d.ts +0 -47
- package/lib/src/Entities/Schedule.js +0 -253
- package/lib/src/Entities/Transaction.d.ts +0 -76
- package/lib/src/Entities/Transaction.js +0 -108
- package/lib/src/Entities/TransactionSummary.d.ts +0 -61
- package/lib/src/Entities/TransactionSummary.js +0 -9
- package/lib/src/Entities/index.d.ts +0 -12
- package/lib/src/Entities/index.js +0 -24
- package/lib/src/Gateways/Gateway.d.ts +0 -10
- package/lib/src/Gateways/Gateway.js +0 -42
- package/lib/src/Gateways/IPaymentGateway.d.ts +0 -8
- package/lib/src/Gateways/IPaymentGateway.js +0 -2
- package/lib/src/Gateways/IRecurringService.d.ts +0 -6
- package/lib/src/Gateways/IRecurringService.js +0 -2
- package/lib/src/Gateways/PayPlanConnector.d.ts +0 -42
- package/lib/src/Gateways/PayPlanConnector.js +0 -552
- package/lib/src/Gateways/PorticoConnector.d.ts +0 -44
- package/lib/src/Gateways/PorticoConnector.js +0 -1018
- package/lib/src/Gateways/RealexConnector.d.ts +0 -30
- package/lib/src/Gateways/RealexConnector.js +0 -523
- package/lib/src/Gateways/RestGateway.d.ts +0 -6
- package/lib/src/Gateways/RestGateway.js +0 -31
- package/lib/src/Gateways/XmlGateway.d.ts +0 -6
- package/lib/src/Gateways/XmlGateway.js +0 -38
- package/lib/src/Gateways/https-wrapper.d.ts +0 -3
- package/lib/src/Gateways/https-wrapper.js +0 -35
- package/lib/src/Gateways/index.d.ts +0 -7
- package/lib/src/Gateways/index.js +0 -19
- package/lib/src/HostedPaymentConfig.d.ts +0 -12
- package/lib/src/HostedPaymentConfig.js +0 -9
- package/lib/src/PaymentMethods/Cash.d.ts +0 -8
- package/lib/src/PaymentMethods/Cash.js +0 -36
- package/lib/src/PaymentMethods/Credit.d.ts +0 -85
- package/lib/src/PaymentMethods/Credit.js +0 -106
- package/lib/src/PaymentMethods/CreditCardData.d.ts +0 -19
- package/lib/src/PaymentMethods/CreditCardData.js +0 -51
- package/lib/src/PaymentMethods/CreditTrackData.d.ts +0 -7
- package/lib/src/PaymentMethods/CreditTrackData.js +0 -27
- package/lib/src/PaymentMethods/Debit.d.ts +0 -40
- package/lib/src/PaymentMethods/Debit.js +0 -70
- package/lib/src/PaymentMethods/DebitTrackData.d.ts +0 -7
- package/lib/src/PaymentMethods/DebitTrackData.js +0 -27
- package/lib/src/PaymentMethods/EBT.d.ts +0 -48
- package/lib/src/PaymentMethods/EBT.js +0 -88
- package/lib/src/PaymentMethods/EBTCardData.d.ts +0 -16
- package/lib/src/PaymentMethods/EBTCardData.js +0 -32
- package/lib/src/PaymentMethods/EBTTrackData.d.ts +0 -8
- package/lib/src/PaymentMethods/EBTTrackData.js +0 -27
- package/lib/src/PaymentMethods/ECheck.d.ts +0 -32
- package/lib/src/PaymentMethods/ECheck.js +0 -40
- package/lib/src/PaymentMethods/GiftCard.d.ts +0 -131
- package/lib/src/PaymentMethods/GiftCard.js +0 -205
- package/lib/src/PaymentMethods/Interfaces.d.ts +0 -55
- package/lib/src/PaymentMethods/Interfaces.js +0 -2
- package/lib/src/PaymentMethods/PaymentMethod.d.ts +0 -19
- package/lib/src/PaymentMethods/PaymentMethod.js +0 -114
- package/lib/src/PaymentMethods/RecurringPaymentMethod.d.ts +0 -23
- package/lib/src/PaymentMethods/RecurringPaymentMethod.js +0 -77
- package/lib/src/PaymentMethods/TransactionReference.d.ts +0 -10
- package/lib/src/PaymentMethods/TransactionReference.js +0 -12
- package/lib/src/PaymentMethods/index.d.ts +0 -15
- package/lib/src/PaymentMethods/index.js +0 -27
- package/lib/src/Services/BatchService.d.ts +0 -4
- package/lib/src/Services/BatchService.js +0 -17
- package/lib/src/Services/CheckService.d.ts +0 -6
- package/lib/src/Services/CheckService.js +0 -20
- package/lib/src/Services/CreditService.d.ts +0 -12
- package/lib/src/Services/CreditService.js +0 -54
- package/lib/src/Services/DebitService.d.ts +0 -7
- package/lib/src/Services/DebitService.js +0 -28
- package/lib/src/Services/EBTService.d.ts +0 -8
- package/lib/src/Services/EBTService.js +0 -32
- package/lib/src/Services/GiftService.d.ts +0 -16
- package/lib/src/Services/GiftService.js +0 -54
- package/lib/src/Services/HostedService.d.ts +0 -9
- package/lib/src/Services/HostedService.js +0 -59
- package/lib/src/Services/RecurringService.d.ts +0 -8
- package/lib/src/Services/RecurringService.js +0 -27
- package/lib/src/Services/ReportingService.d.ts +0 -6
- package/lib/src/Services/ReportingService.js +0 -19
- package/lib/src/Services/index.d.ts +0 -9
- package/lib/src/Services/index.js +0 -21
- package/lib/src/ServicesConfig.d.ts +0 -23
- package/lib/src/ServicesConfig.js +0 -50
- package/lib/src/ServicesContainer.d.ts +0 -11
- package/lib/src/ServicesContainer.js +0 -73
- package/lib/src/Utils/GenerationUtils.d.ts +0 -5
- package/lib/src/Utils/GenerationUtils.js +0 -36
- package/lib/src/Utils/InputValidation.d.ts +0 -12
- package/lib/src/Utils/InputValidation.js +0 -72
- package/lib/src/Utils/Sha1.d.ts +0 -6
- package/lib/src/Utils/Sha1.js +0 -225
- package/lib/src/Utils/StringUtils.d.ts +0 -6
- package/lib/src/Utils/StringUtils.js +0 -53
- package/lib/src/Utils/index.d.ts +0 -2
- package/lib/src/Utils/index.js +0 -14
- package/lib/src/index.d.ts +0 -11
- package/lib/src/index.js +0 -27
- package/lib/test/Data/TestCards.d.ts +0 -24
- package/lib/test/Data/TestCards.js +0 -232
- package/lib/test/Data/TestChecks.d.ts +0 -4
- package/lib/test/Data/TestChecks.js +0 -32
- package/lib/test/Data/index.d.ts +0 -2
- package/lib/test/Data/index.js +0 -14
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -112
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -483
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -83
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1720
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -83
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1757
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -682
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2218
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -708
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -151
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -171
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -192
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -377
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -196
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -47
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +0 -4373
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +0 -758
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +0 -2399
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +0 -1656
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +0 -5650
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +0 -1985
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +0 -2369
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +0 -1703
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +0 -2053
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +0 -2469
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +0 -3116
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +0 -2031
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +0 -322
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +0 -98
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +0 -263
- package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/CheckServiceTest.js +0 -98
- package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/CreditServiceTest.js +0 -313
- package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/DebitServiceTest.js +0 -154
- package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/EBTServiceTest.js +0 -135
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -161
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -139
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -202
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.d.ts +0 -1
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +0 -29
- package/logger.txt +0 -4
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentMethod = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var PaymentMethod = /** @class */ (function () {
|
|
6
|
-
function PaymentMethod() {
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(PaymentMethod.prototype, "isAuthable", {
|
|
9
|
-
get: function () {
|
|
10
|
-
return this.authorize !== undefined;
|
|
11
|
-
},
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(PaymentMethod.prototype, "isBalanceable", {
|
|
16
|
-
get: function () {
|
|
17
|
-
return this.balanceInquiry !== undefined;
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(PaymentMethod.prototype, "isCardData", {
|
|
23
|
-
get: function () {
|
|
24
|
-
return (((this.isTokenizable &&
|
|
25
|
-
this.token !== undefined) ||
|
|
26
|
-
this.number !== undefined) &&
|
|
27
|
-
this.paymentMethodType !== __1.PaymentMethodType.Gift);
|
|
28
|
-
},
|
|
29
|
-
enumerable: false,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(PaymentMethod.prototype, "isChargable", {
|
|
33
|
-
get: function () {
|
|
34
|
-
return this.charge !== undefined;
|
|
35
|
-
},
|
|
36
|
-
enumerable: false,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(PaymentMethod.prototype, "isEditable", {
|
|
40
|
-
get: function () {
|
|
41
|
-
return this.edit !== undefined;
|
|
42
|
-
},
|
|
43
|
-
enumerable: false,
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(PaymentMethod.prototype, "isEncryptable", {
|
|
47
|
-
get: function () {
|
|
48
|
-
return this.encryptionData !== undefined;
|
|
49
|
-
},
|
|
50
|
-
enumerable: false,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(PaymentMethod.prototype, "isPinProtected", {
|
|
54
|
-
get: function () {
|
|
55
|
-
return this.pinBlock !== undefined;
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(PaymentMethod.prototype, "isPrePayable", {
|
|
61
|
-
get: function () {
|
|
62
|
-
return this.addValue !== undefined;
|
|
63
|
-
},
|
|
64
|
-
enumerable: false,
|
|
65
|
-
configurable: true
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(PaymentMethod.prototype, "isRefundable", {
|
|
68
|
-
get: function () {
|
|
69
|
-
return this.refund !== undefined;
|
|
70
|
-
},
|
|
71
|
-
enumerable: false,
|
|
72
|
-
configurable: true
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(PaymentMethod.prototype, "isReversable", {
|
|
75
|
-
get: function () {
|
|
76
|
-
return this.reverse !== undefined;
|
|
77
|
-
},
|
|
78
|
-
enumerable: false,
|
|
79
|
-
configurable: true
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(PaymentMethod.prototype, "isTokenizable", {
|
|
82
|
-
get: function () {
|
|
83
|
-
return this.tokenize !== undefined;
|
|
84
|
-
},
|
|
85
|
-
enumerable: false,
|
|
86
|
-
configurable: true
|
|
87
|
-
});
|
|
88
|
-
Object.defineProperty(PaymentMethod.prototype, "isTrackData", {
|
|
89
|
-
get: function () {
|
|
90
|
-
return (this.value !== undefined &&
|
|
91
|
-
(this.entryMethod !== undefined ||
|
|
92
|
-
this.pinBlock !== undefined ||
|
|
93
|
-
this.encryptionData !== undefined));
|
|
94
|
-
},
|
|
95
|
-
enumerable: false,
|
|
96
|
-
configurable: true
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(PaymentMethod.prototype, "isVerifyable", {
|
|
99
|
-
get: function () {
|
|
100
|
-
return this.verify !== undefined;
|
|
101
|
-
},
|
|
102
|
-
enumerable: false,
|
|
103
|
-
configurable: true
|
|
104
|
-
});
|
|
105
|
-
Object.defineProperty(PaymentMethod.prototype, "isVoidable", {
|
|
106
|
-
get: function () {
|
|
107
|
-
return this.void !== undefined;
|
|
108
|
-
},
|
|
109
|
-
enumerable: false,
|
|
110
|
-
configurable: true
|
|
111
|
-
});
|
|
112
|
-
return PaymentMethod;
|
|
113
|
-
}());
|
|
114
|
-
exports.PaymentMethod = PaymentMethod;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Address, AuthorizationBuilder, IPaymentMethod, PaymentMethodType, Schedule } from "../";
|
|
2
|
-
import { RecurringEntity } from "../Entities";
|
|
3
|
-
export declare class RecurringPaymentMethod extends RecurringEntity<RecurringPaymentMethod> {
|
|
4
|
-
address: Address;
|
|
5
|
-
commercialIndicator: string;
|
|
6
|
-
customerKey: string;
|
|
7
|
-
expirationDate: string;
|
|
8
|
-
nameOnAccount: string;
|
|
9
|
-
paymentMethodType: PaymentMethodType;
|
|
10
|
-
paymentType: string;
|
|
11
|
-
preferredPayment: boolean;
|
|
12
|
-
status: string;
|
|
13
|
-
taxType: string;
|
|
14
|
-
private _paymentMethod;
|
|
15
|
-
get paymentMethod(): IPaymentMethod;
|
|
16
|
-
set paymentMethod(value: IPaymentMethod);
|
|
17
|
-
constructor(customerIdOrPaymentMethod?: string | IPaymentMethod, paymentId?: string);
|
|
18
|
-
authorize(amount?: number | string): AuthorizationBuilder;
|
|
19
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
20
|
-
refund(amount?: number | string): AuthorizationBuilder;
|
|
21
|
-
verify(): AuthorizationBuilder;
|
|
22
|
-
addSchedule(scheduleId: string): Schedule;
|
|
23
|
-
}
|
|
@@ -1,77 +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.RecurringPaymentMethod = void 0;
|
|
19
|
-
var __1 = require("../");
|
|
20
|
-
var Entities_1 = require("../Entities");
|
|
21
|
-
var RecurringPaymentMethod = /** @class */ (function (_super) {
|
|
22
|
-
__extends(RecurringPaymentMethod, _super);
|
|
23
|
-
function RecurringPaymentMethod(customerIdOrPaymentMethod, paymentId) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.paymentMethodType = __1.PaymentMethodType.Recurring;
|
|
26
|
-
if (customerIdOrPaymentMethod &&
|
|
27
|
-
(typeof customerIdOrPaymentMethod === "string" ||
|
|
28
|
-
customerIdOrPaymentMethod instanceof String)) {
|
|
29
|
-
_this.paymentType = "Credit Card";
|
|
30
|
-
_this.customerKey = customerIdOrPaymentMethod;
|
|
31
|
-
if (paymentId) {
|
|
32
|
-
_this.key = paymentId;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else if (customerIdOrPaymentMethod) {
|
|
36
|
-
_this._paymentMethod = customerIdOrPaymentMethod;
|
|
37
|
-
}
|
|
38
|
-
return _this;
|
|
39
|
-
}
|
|
40
|
-
Object.defineProperty(RecurringPaymentMethod.prototype, "paymentMethod", {
|
|
41
|
-
get: function () {
|
|
42
|
-
return this._paymentMethod;
|
|
43
|
-
},
|
|
44
|
-
set: function (value) {
|
|
45
|
-
var client = __1.ServicesContainer.instance().getRecurringClient();
|
|
46
|
-
if (!client.supportsUpdatePaymentDetails) {
|
|
47
|
-
throw new __1.UnsupportedTransactionError();
|
|
48
|
-
}
|
|
49
|
-
this._paymentMethod = value;
|
|
50
|
-
},
|
|
51
|
-
enumerable: false,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
RecurringPaymentMethod.prototype.authorize = function (amount) {
|
|
55
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Auth, this)
|
|
56
|
-
.withAmount(amount)
|
|
57
|
-
.withOneTimePayment(true);
|
|
58
|
-
};
|
|
59
|
-
RecurringPaymentMethod.prototype.charge = function (amount) {
|
|
60
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale, this)
|
|
61
|
-
.withAmount(amount)
|
|
62
|
-
.withOneTimePayment(true);
|
|
63
|
-
};
|
|
64
|
-
RecurringPaymentMethod.prototype.refund = function (amount) {
|
|
65
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Refund, this).withAmount(amount);
|
|
66
|
-
};
|
|
67
|
-
RecurringPaymentMethod.prototype.verify = function () {
|
|
68
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Verify, this);
|
|
69
|
-
};
|
|
70
|
-
RecurringPaymentMethod.prototype.addSchedule = function (scheduleId) {
|
|
71
|
-
var schedule = new __1.Schedule(this.customerKey, this.key);
|
|
72
|
-
schedule.id = scheduleId;
|
|
73
|
-
return schedule;
|
|
74
|
-
};
|
|
75
|
-
return RecurringPaymentMethod;
|
|
76
|
-
}(Entities_1.RecurringEntity));
|
|
77
|
-
exports.RecurringPaymentMethod = RecurringPaymentMethod;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PaymentMethodType } from "../";
|
|
2
|
-
import { IPaymentMethod } from "./Interfaces";
|
|
3
|
-
export declare class TransactionReference implements IPaymentMethod {
|
|
4
|
-
authCode: string;
|
|
5
|
-
orderId: string;
|
|
6
|
-
transactionId: string;
|
|
7
|
-
paymentMethodType: PaymentMethodType;
|
|
8
|
-
clientTransactionId: string;
|
|
9
|
-
constructor(transactionId?: string);
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionReference = void 0;
|
|
4
|
-
var TransactionReference = /** @class */ (function () {
|
|
5
|
-
function TransactionReference(transactionId) {
|
|
6
|
-
if (transactionId) {
|
|
7
|
-
this.transactionId = transactionId;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return TransactionReference;
|
|
11
|
-
}());
|
|
12
|
-
exports.TransactionReference = TransactionReference;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from "./Cash";
|
|
2
|
-
export * from "./Credit";
|
|
3
|
-
export * from "./CreditCardData";
|
|
4
|
-
export * from "./CreditTrackData";
|
|
5
|
-
export * from "./Debit";
|
|
6
|
-
export * from "./DebitTrackData";
|
|
7
|
-
export * from "./EBT";
|
|
8
|
-
export * from "./EBTCardData";
|
|
9
|
-
export * from "./EBTTrackData";
|
|
10
|
-
export * from "./ECheck";
|
|
11
|
-
export * from "./GiftCard";
|
|
12
|
-
export * from "./PaymentMethod";
|
|
13
|
-
export * from "./RecurringPaymentMethod";
|
|
14
|
-
export * from "./Interfaces";
|
|
15
|
-
export * from "./TransactionReference";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Cash"), exports);
|
|
14
|
-
__exportStar(require("./Credit"), exports);
|
|
15
|
-
__exportStar(require("./CreditCardData"), exports);
|
|
16
|
-
__exportStar(require("./CreditTrackData"), exports);
|
|
17
|
-
__exportStar(require("./Debit"), exports);
|
|
18
|
-
__exportStar(require("./DebitTrackData"), exports);
|
|
19
|
-
__exportStar(require("./EBT"), exports);
|
|
20
|
-
__exportStar(require("./EBTCardData"), exports);
|
|
21
|
-
__exportStar(require("./EBTTrackData"), exports);
|
|
22
|
-
__exportStar(require("./ECheck"), exports);
|
|
23
|
-
__exportStar(require("./GiftCard"), exports);
|
|
24
|
-
__exportStar(require("./PaymentMethod"), exports);
|
|
25
|
-
__exportStar(require("./RecurringPaymentMethod"), exports);
|
|
26
|
-
__exportStar(require("./Interfaces"), exports);
|
|
27
|
-
__exportStar(require("./TransactionReference"), exports);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BatchService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var BatchService = /** @class */ (function () {
|
|
6
|
-
function BatchService() {
|
|
7
|
-
}
|
|
8
|
-
BatchService.closeBatch = function () {
|
|
9
|
-
return new __1.ManagementBuilder(__1.TransactionType.BatchClose)
|
|
10
|
-
.execute()
|
|
11
|
-
.then(function (_response) {
|
|
12
|
-
return new __1.BatchSummary();
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
return BatchService;
|
|
16
|
-
}());
|
|
17
|
-
exports.BatchService = BatchService;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var CheckService = /** @class */ (function () {
|
|
6
|
-
function CheckService(config) {
|
|
7
|
-
__1.ServicesContainer.configure(config);
|
|
8
|
-
}
|
|
9
|
-
CheckService.prototype.charge = function (amount) {
|
|
10
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
11
|
-
};
|
|
12
|
-
CheckService.prototype.void = function (transactionId) {
|
|
13
|
-
var ref = new __1.TransactionReference();
|
|
14
|
-
ref.paymentMethodType = __1.PaymentMethodType.ACH;
|
|
15
|
-
ref.transactionId = transactionId;
|
|
16
|
-
return new __1.ManagementBuilder(__1.TransactionType.Void).withPaymentMethod(ref);
|
|
17
|
-
};
|
|
18
|
-
return CheckService;
|
|
19
|
-
}());
|
|
20
|
-
exports.CheckService = CheckService;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBuilder, ManagementBuilder, ServicesConfig } from "../";
|
|
2
|
-
export declare class CreditService {
|
|
3
|
-
constructor(config: ServicesConfig);
|
|
4
|
-
authorize(amount?: number | string): AuthorizationBuilder;
|
|
5
|
-
capture(transactionId: string): ManagementBuilder;
|
|
6
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
7
|
-
edit(transactionId?: string): ManagementBuilder;
|
|
8
|
-
refund(amount?: number | string): AuthorizationBuilder;
|
|
9
|
-
reverse(amount?: number | string): AuthorizationBuilder;
|
|
10
|
-
verify(): AuthorizationBuilder;
|
|
11
|
-
void(transactionId: string): ManagementBuilder;
|
|
12
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreditService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var CreditService = /** @class */ (function () {
|
|
6
|
-
function CreditService(config) {
|
|
7
|
-
__1.ServicesContainer.configure(config);
|
|
8
|
-
}
|
|
9
|
-
CreditService.prototype.authorize = function (amount) {
|
|
10
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Auth).withAmount(amount);
|
|
11
|
-
};
|
|
12
|
-
CreditService.prototype.capture = function (transactionId) {
|
|
13
|
-
var ref = new __1.TransactionReference();
|
|
14
|
-
ref.paymentMethodType = __1.PaymentMethodType.Credit;
|
|
15
|
-
ref.transactionId = transactionId;
|
|
16
|
-
return new __1.ManagementBuilder(__1.TransactionType.Capture).withPaymentMethod(ref);
|
|
17
|
-
};
|
|
18
|
-
CreditService.prototype.charge = function (amount) {
|
|
19
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
20
|
-
};
|
|
21
|
-
CreditService.prototype.edit = function (transactionId) {
|
|
22
|
-
var ref = new __1.TransactionReference();
|
|
23
|
-
ref.paymentMethodType = __1.PaymentMethodType.Credit;
|
|
24
|
-
if (transactionId) {
|
|
25
|
-
ref.transactionId = transactionId;
|
|
26
|
-
}
|
|
27
|
-
return new __1.ManagementBuilder(__1.TransactionType.Edit).withPaymentMethod(ref);
|
|
28
|
-
};
|
|
29
|
-
CreditService.prototype.refund = function (amount) {
|
|
30
|
-
var ref = new __1.TransactionReference();
|
|
31
|
-
ref.paymentMethodType = __1.PaymentMethodType.Credit;
|
|
32
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Refund)
|
|
33
|
-
.withAmount(amount)
|
|
34
|
-
.withPaymentMethod(ref);
|
|
35
|
-
};
|
|
36
|
-
CreditService.prototype.reverse = function (amount) {
|
|
37
|
-
var ref = new __1.TransactionReference();
|
|
38
|
-
ref.paymentMethodType = __1.PaymentMethodType.Credit;
|
|
39
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Reversal)
|
|
40
|
-
.withAmount(amount)
|
|
41
|
-
.withPaymentMethod(ref);
|
|
42
|
-
};
|
|
43
|
-
CreditService.prototype.verify = function () {
|
|
44
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Verify);
|
|
45
|
-
};
|
|
46
|
-
CreditService.prototype.void = function (transactionId) {
|
|
47
|
-
var ref = new __1.TransactionReference();
|
|
48
|
-
ref.paymentMethodType = __1.PaymentMethodType.Credit;
|
|
49
|
-
ref.transactionId = transactionId;
|
|
50
|
-
return new __1.ManagementBuilder(__1.TransactionType.Void).withPaymentMethod(ref);
|
|
51
|
-
};
|
|
52
|
-
return CreditService;
|
|
53
|
-
}());
|
|
54
|
-
exports.CreditService = CreditService;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBuilder, ServicesConfig } from "../";
|
|
2
|
-
export declare class DebitService {
|
|
3
|
-
constructor(config: ServicesConfig);
|
|
4
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
5
|
-
refund(amount?: number | string): AuthorizationBuilder;
|
|
6
|
-
reverse(amount?: number | string): AuthorizationBuilder;
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DebitService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var DebitService = /** @class */ (function () {
|
|
6
|
-
function DebitService(config) {
|
|
7
|
-
__1.ServicesContainer.configure(config);
|
|
8
|
-
}
|
|
9
|
-
DebitService.prototype.charge = function (amount) {
|
|
10
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
11
|
-
};
|
|
12
|
-
DebitService.prototype.refund = function (amount) {
|
|
13
|
-
var ref = new __1.TransactionReference();
|
|
14
|
-
ref.paymentMethodType = __1.PaymentMethodType.Debit;
|
|
15
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Refund)
|
|
16
|
-
.withAmount(amount)
|
|
17
|
-
.withPaymentMethod(ref);
|
|
18
|
-
};
|
|
19
|
-
DebitService.prototype.reverse = function (amount) {
|
|
20
|
-
var ref = new __1.TransactionReference();
|
|
21
|
-
ref.paymentMethodType = __1.PaymentMethodType.Debit;
|
|
22
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Reversal)
|
|
23
|
-
.withAmount(amount)
|
|
24
|
-
.withPaymentMethod(ref);
|
|
25
|
-
};
|
|
26
|
-
return DebitService;
|
|
27
|
-
}());
|
|
28
|
-
exports.DebitService = DebitService;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBuilder, InquiryType, ServicesConfig } from "../";
|
|
2
|
-
export declare class EBTService {
|
|
3
|
-
constructor(config: ServicesConfig);
|
|
4
|
-
balanceInquiry(type?: InquiryType): AuthorizationBuilder;
|
|
5
|
-
benefitWithdrawal(amount?: number | string): AuthorizationBuilder;
|
|
6
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
7
|
-
refund(amount?: number | string): AuthorizationBuilder;
|
|
8
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EBTService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var EBTService = /** @class */ (function () {
|
|
6
|
-
function EBTService(config) {
|
|
7
|
-
__1.ServicesContainer.configure(config);
|
|
8
|
-
}
|
|
9
|
-
EBTService.prototype.balanceInquiry = function (type) {
|
|
10
|
-
if (type === void 0) { type = __1.InquiryType.Foodstamp; }
|
|
11
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Balance)
|
|
12
|
-
.withBalanceInquiryType(type)
|
|
13
|
-
.withAmount(0);
|
|
14
|
-
};
|
|
15
|
-
EBTService.prototype.benefitWithdrawal = function (amount) {
|
|
16
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.BenefitWithDrawal)
|
|
17
|
-
.withAmount(amount)
|
|
18
|
-
.withCashBack(0);
|
|
19
|
-
};
|
|
20
|
-
EBTService.prototype.charge = function (amount) {
|
|
21
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
22
|
-
};
|
|
23
|
-
EBTService.prototype.refund = function (amount) {
|
|
24
|
-
var ref = new __1.TransactionReference();
|
|
25
|
-
ref.paymentMethodType = __1.PaymentMethodType.EBT;
|
|
26
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Refund)
|
|
27
|
-
.withAmount(amount)
|
|
28
|
-
.withPaymentMethod(ref);
|
|
29
|
-
};
|
|
30
|
-
return EBTService;
|
|
31
|
-
}());
|
|
32
|
-
exports.EBTService = EBTService;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBuilder, GiftCard, InquiryType, ManagementBuilder, ServicesConfig } from "../";
|
|
2
|
-
export declare class GiftService {
|
|
3
|
-
constructor(config: ServicesConfig);
|
|
4
|
-
activate(amount?: number | string): AuthorizationBuilder;
|
|
5
|
-
addValue(amount?: number | string): AuthorizationBuilder;
|
|
6
|
-
addAlias(phoneNumber: string): AuthorizationBuilder;
|
|
7
|
-
balanceInquiry(type?: InquiryType): AuthorizationBuilder;
|
|
8
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
9
|
-
create(phoneNumber: string): Promise<GiftCard>;
|
|
10
|
-
deactivate(): AuthorizationBuilder;
|
|
11
|
-
removeAlias(phoneNumber: string): AuthorizationBuilder;
|
|
12
|
-
replaceWith(newCard: GiftCard): AuthorizationBuilder;
|
|
13
|
-
reverse(amount?: number | string): AuthorizationBuilder;
|
|
14
|
-
rewards(amount?: number | string): AuthorizationBuilder;
|
|
15
|
-
void(transactionId: string): ManagementBuilder;
|
|
16
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GiftService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var GiftService = /** @class */ (function () {
|
|
6
|
-
function GiftService(config) {
|
|
7
|
-
__1.ServicesContainer.configure(config);
|
|
8
|
-
}
|
|
9
|
-
GiftService.prototype.activate = function (amount) {
|
|
10
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Activate).withAmount(amount);
|
|
11
|
-
};
|
|
12
|
-
GiftService.prototype.addValue = function (amount) {
|
|
13
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.AddValue).withAmount(amount);
|
|
14
|
-
};
|
|
15
|
-
GiftService.prototype.addAlias = function (phoneNumber) {
|
|
16
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Alias).withAlias(__1.AliasAction.Add, phoneNumber);
|
|
17
|
-
};
|
|
18
|
-
GiftService.prototype.balanceInquiry = function (type) {
|
|
19
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Balance).withBalanceInquiryType(type);
|
|
20
|
-
};
|
|
21
|
-
GiftService.prototype.charge = function (amount) {
|
|
22
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
23
|
-
};
|
|
24
|
-
GiftService.prototype.create = function (phoneNumber) {
|
|
25
|
-
return __1.GiftCard.create(phoneNumber);
|
|
26
|
-
};
|
|
27
|
-
GiftService.prototype.deactivate = function () {
|
|
28
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Deactivate);
|
|
29
|
-
};
|
|
30
|
-
GiftService.prototype.removeAlias = function (phoneNumber) {
|
|
31
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Alias).withAlias(__1.AliasAction.Delete, phoneNumber);
|
|
32
|
-
};
|
|
33
|
-
GiftService.prototype.replaceWith = function (newCard) {
|
|
34
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Replace).withReplacementCard(newCard);
|
|
35
|
-
};
|
|
36
|
-
GiftService.prototype.reverse = function (amount) {
|
|
37
|
-
var ref = new __1.TransactionReference();
|
|
38
|
-
ref.paymentMethodType = __1.PaymentMethodType.Gift;
|
|
39
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Reversal)
|
|
40
|
-
.withAmount(amount)
|
|
41
|
-
.withPaymentMethod(ref);
|
|
42
|
-
};
|
|
43
|
-
GiftService.prototype.rewards = function (amount) {
|
|
44
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Reward).withAmount(amount);
|
|
45
|
-
};
|
|
46
|
-
GiftService.prototype.void = function (transactionId) {
|
|
47
|
-
var ref = new __1.TransactionReference();
|
|
48
|
-
ref.paymentMethodType = __1.PaymentMethodType.Gift;
|
|
49
|
-
ref.transactionId = transactionId;
|
|
50
|
-
return new __1.ManagementBuilder(__1.TransactionType.Void).withPaymentMethod(ref);
|
|
51
|
-
};
|
|
52
|
-
return GiftService;
|
|
53
|
-
}());
|
|
54
|
-
exports.GiftService = GiftService;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBuilder, ServicesConfig, Transaction } from "../";
|
|
2
|
-
export declare class HostedService {
|
|
3
|
-
protected config: ServicesConfig;
|
|
4
|
-
constructor(config: ServicesConfig);
|
|
5
|
-
authorize(amount?: number | string): AuthorizationBuilder;
|
|
6
|
-
charge(amount?: number | string): AuthorizationBuilder;
|
|
7
|
-
verify(amount?: number | string): AuthorizationBuilder;
|
|
8
|
-
parseResponse(json: string, encoded?: boolean): Transaction;
|
|
9
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HostedService = void 0;
|
|
4
|
-
var __1 = require("../");
|
|
5
|
-
var HostedService = /** @class */ (function () {
|
|
6
|
-
function HostedService(config) {
|
|
7
|
-
this.config = config;
|
|
8
|
-
__1.ServicesContainer.configure(config);
|
|
9
|
-
}
|
|
10
|
-
HostedService.prototype.authorize = function (amount) {
|
|
11
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Auth).withAmount(amount);
|
|
12
|
-
};
|
|
13
|
-
HostedService.prototype.charge = function (amount) {
|
|
14
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Sale).withAmount(amount);
|
|
15
|
-
};
|
|
16
|
-
HostedService.prototype.verify = function (amount) {
|
|
17
|
-
return new __1.AuthorizationBuilder(__1.TransactionType.Verify).withAmount(amount);
|
|
18
|
-
};
|
|
19
|
-
HostedService.prototype.parseResponse = function (json, encoded) {
|
|
20
|
-
if (encoded === void 0) { encoded = true; }
|
|
21
|
-
var response = JSON.parse(json);
|
|
22
|
-
var decoder = encoded ? __1.StringUtils.atob : function (t) { return t; };
|
|
23
|
-
var timestamp = decoder(response.TIMESTAMP);
|
|
24
|
-
var merchantId = decoder(response.MERCHANT_ID);
|
|
25
|
-
var orderId = decoder(response.ORDER_ID);
|
|
26
|
-
var result = decoder(response.RESULT);
|
|
27
|
-
var message = decoder(response.MESSAGE);
|
|
28
|
-
var transactionId = decoder(response.PASREF);
|
|
29
|
-
var authCode = decoder(response.AUTHCODE);
|
|
30
|
-
var sha1Hash = decoder(response.SHA1HASH);
|
|
31
|
-
var hash = __1.GenerationUtils.generateHash([
|
|
32
|
-
timestamp,
|
|
33
|
-
merchantId,
|
|
34
|
-
orderId,
|
|
35
|
-
result,
|
|
36
|
-
message,
|
|
37
|
-
transactionId,
|
|
38
|
-
authCode,
|
|
39
|
-
].join("."), this.config.sharedSecret);
|
|
40
|
-
if (hash !== sha1Hash) {
|
|
41
|
-
throw new __1.ApiError("Incorrect hash. Please check your code and the Developers Documentation.");
|
|
42
|
-
}
|
|
43
|
-
var transaction = new __1.Transaction();
|
|
44
|
-
transaction.authorizedAmount = decoder(response.AMOUNT);
|
|
45
|
-
transaction.cvnResponseCode = decoder(response.CVNRESULT);
|
|
46
|
-
transaction.responseCode = result;
|
|
47
|
-
transaction.responseMessage = message;
|
|
48
|
-
transaction.avsResponseCode = decoder(response.AVSPOSTCODERESULT);
|
|
49
|
-
transaction.transactionReference = new __1.TransactionReference();
|
|
50
|
-
transaction.transactionReference.authCode = authCode;
|
|
51
|
-
transaction.transactionReference.orderId = orderId;
|
|
52
|
-
transaction.transactionReference.paymentMethodType =
|
|
53
|
-
__1.PaymentMethodType.Credit;
|
|
54
|
-
transaction.transactionReference.transactionId = transactionId;
|
|
55
|
-
return transaction;
|
|
56
|
-
};
|
|
57
|
-
return HostedService;
|
|
58
|
-
}());
|
|
59
|
-
exports.HostedService = HostedService;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IRecurringEntity, RecurringBuilder } from "../";
|
|
2
|
-
export declare class RecurringService {
|
|
3
|
-
static create<T extends IRecurringEntity>(entity: T): Promise<T>;
|
|
4
|
-
static delete<T extends IRecurringEntity>(entity: T, _force?: boolean): Promise<T>;
|
|
5
|
-
static edit<T extends IRecurringEntity>(entity: T): Promise<T>;
|
|
6
|
-
static get<T extends IRecurringEntity>(key: string): Promise<T>;
|
|
7
|
-
static search<T extends IRecurringEntity>(enity: IRecurringEntity | Function): RecurringBuilder<T>;
|
|
8
|
-
}
|