globalpayments-api 3.3.2 → 3.4.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 +15 -1
- package/lib/src/Builders/AuthorizationBuilder.d.ts +16 -1
- package/lib/src/Builders/AuthorizationBuilder.js +28 -0
- package/lib/src/Builders/AuthorizationBuilder.js.map +1 -1
- package/lib/src/Builders/ManagementBuilder.d.ts +16 -2
- package/lib/src/Builders/ManagementBuilder.js +23 -2
- package/lib/src/Builders/ManagementBuilder.js.map +1 -1
- package/lib/src/Builders/ReportBuilder.d.ts +3 -1
- package/lib/src/Builders/ReportBuilder.js +6 -0
- package/lib/src/Builders/ReportBuilder.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/AccessTokenRequest.d.ts +2 -2
- package/lib/src/Builders/RequestBuilder/GpApi/AccessTokenRequest.js +3 -3
- package/lib/src/Builders/RequestBuilder/GpApi/AccessTokenRequest.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.d.ts +19 -2
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js +376 -3
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.d.ts +7 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js +71 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.js.map +1 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.d.ts +10 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js +89 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.js.map +1 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.d.ts +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.js +1 -1
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.js.map +1 -1
- package/lib/src/Builders/RequestBuilder/RequestBuilderFactory.d.ts +3 -2
- package/lib/src/Builders/RequestBuilder/RequestBuilderFactory.js +4 -0
- package/lib/src/Builders/RequestBuilder/RequestBuilderFactory.js.map +1 -1
- package/lib/src/Builders/TransactionReportBuilder.d.ts +5 -1
- package/lib/src/Builders/TransactionReportBuilder.js +22 -0
- package/lib/src/Builders/TransactionReportBuilder.js.map +1 -1
- package/lib/src/Entities/Address.d.ts +1 -0
- package/lib/src/Entities/Address.js +1 -0
- package/lib/src/Entities/Address.js.map +1 -1
- package/lib/src/Entities/Card.d.ts +36 -0
- package/lib/src/Entities/Card.js +41 -0
- package/lib/src/Entities/Card.js.map +1 -0
- package/lib/src/Entities/CardIssuerResponse.d.ts +22 -0
- package/lib/src/Entities/CardIssuerResponse.js +27 -0
- package/lib/src/Entities/CardIssuerResponse.js.map +1 -0
- package/lib/src/Entities/Customer.d.ts +10 -0
- package/lib/src/Entities/Customer.js +14 -0
- package/lib/src/Entities/Customer.js.map +1 -1
- package/lib/src/Entities/Enums.d.ts +131 -4
- package/lib/src/Entities/Enums.js +135 -2
- package/lib/src/Entities/Enums.js.map +1 -1
- package/lib/src/Entities/FraudRule.d.ts +8 -0
- package/lib/src/Entities/FraudRule.js +17 -0
- package/lib/src/Entities/FraudRule.js.map +1 -0
- package/lib/src/Entities/GpApi/DTO/Card.d.ts +16 -0
- package/lib/src/Entities/GpApi/DTO/Card.js +21 -0
- package/lib/src/Entities/GpApi/DTO/Card.js.map +1 -0
- package/lib/src/Entities/GpApi/DTO/PaymentMethod.d.ts +17 -0
- package/lib/src/Entities/GpApi/DTO/PaymentMethod.js +21 -0
- package/lib/src/Entities/GpApi/DTO/PaymentMethod.js.map +1 -0
- package/lib/src/Entities/GpApi/DTO/index.d.ts +2 -0
- package/lib/src/Entities/GpApi/DTO/index.js +19 -0
- package/lib/src/Entities/GpApi/DTO/index.js.map +1 -0
- package/lib/src/Entities/GpApi/PageResult.d.ts +8 -0
- package/lib/src/Entities/GpApi/PageResult.js +13 -0
- package/lib/src/Entities/GpApi/PageResult.js.map +1 -0
- package/lib/src/Entities/GpApi/index.d.ts +1 -0
- package/lib/src/Entities/GpApi/index.js +1 -0
- package/lib/src/Entities/GpApi/index.js.map +1 -1
- package/lib/src/Entities/IRequestBuilder.d.ts +3 -3
- package/lib/src/Entities/MaskedValueCollection.d.ts +3 -3
- package/lib/src/Entities/MaskedValueCollection.js +1 -1
- package/lib/src/Entities/MaskedValueCollection.js.map +1 -1
- package/lib/src/Entities/PayerDetails.d.ts +8 -0
- package/lib/src/Entities/PayerDetails.js +12 -0
- package/lib/src/Entities/PayerDetails.js.map +1 -0
- package/lib/src/Entities/PhoneNumber.d.ts +6 -0
- package/lib/src/Entities/PhoneNumber.js +15 -0
- package/lib/src/Entities/PhoneNumber.js.map +1 -0
- package/lib/src/Entities/RecurringEntity.js +2 -2
- package/lib/src/Entities/RecurringEntity.js.map +1 -1
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.d.ts +105 -0
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js +122 -0
- package/lib/src/Entities/Reporting/SearchCriteriaBuilder.js.map +1 -0
- package/lib/src/Entities/Reporting/StoredPaymentMethodSummary.d.ts +11 -0
- package/lib/src/Entities/Reporting/StoredPaymentMethodSummary.js +16 -0
- package/lib/src/Entities/Reporting/StoredPaymentMethodSummary.js.map +1 -0
- package/lib/src/Entities/Reporting/index.d.ts +2 -0
- package/lib/src/Entities/Reporting/index.js +19 -0
- package/lib/src/Entities/Reporting/index.js.map +1 -0
- package/lib/src/Entities/Transaction.d.ts +7 -1
- package/lib/src/Entities/Transaction.js +7 -1
- package/lib/src/Entities/Transaction.js.map +1 -1
- package/lib/src/Entities/TransactionStatus.d.ts +13 -0
- package/lib/src/Entities/TransactionStatus.js +29 -0
- package/lib/src/Entities/TransactionStatus.js.map +1 -0
- package/lib/src/Entities/index.d.ts +7 -0
- package/lib/src/Entities/index.js +7 -0
- package/lib/src/Entities/index.js.map +1 -1
- package/lib/src/Gateways/Gateway.js +2 -5
- package/lib/src/Gateways/Gateway.js.map +1 -1
- package/lib/src/Gateways/GpApiConnector.js +11 -6
- package/lib/src/Gateways/GpApiConnector.js.map +1 -1
- package/lib/src/Gateways/PayPlanConnector.d.ts +1 -1
- package/lib/src/Gateways/PayPlanConnector.js +24 -11
- package/lib/src/Gateways/PayPlanConnector.js.map +1 -1
- package/lib/src/Gateways/PorticoConnector.js +2 -2
- package/lib/src/Gateways/PorticoConnector.js.map +1 -1
- package/lib/src/Gateways/RestGateway.d.ts +1 -1
- package/lib/src/Gateways/RestGateway.js +21 -3
- package/lib/src/Gateways/RestGateway.js.map +1 -1
- package/lib/src/Gateways/XmlGateway.js +6 -1
- package/lib/src/Gateways/XmlGateway.js.map +1 -1
- package/lib/src/Gateways/https-wrapper.js +6 -2
- package/lib/src/Gateways/https-wrapper.js.map +1 -1
- package/lib/src/Mapping/EnumMapping.d.ts +8 -0
- package/lib/src/Mapping/EnumMapping.js +84 -0
- package/lib/src/Mapping/EnumMapping.js.map +1 -0
- package/lib/src/Mapping/GpApiMapping.d.ts +8 -2
- package/lib/src/Mapping/GpApiMapping.js +178 -2
- package/lib/src/Mapping/GpApiMapping.js.map +1 -1
- package/lib/src/Mapping/index.d.ts +1 -0
- package/lib/src/Mapping/index.js +1 -0
- package/lib/src/Mapping/index.js.map +1 -1
- package/lib/src/PaymentMethods/AlternativePaymentMethod.d.ts +22 -0
- package/lib/src/PaymentMethods/AlternativePaymentMethod.js +47 -0
- package/lib/src/PaymentMethods/AlternativePaymentMethod.js.map +1 -0
- package/lib/src/PaymentMethods/Credit.d.ts +26 -2
- package/lib/src/PaymentMethods/Credit.js +58 -2
- package/lib/src/PaymentMethods/Credit.js.map +1 -1
- package/lib/src/PaymentMethods/Interfaces.d.ts +5 -1
- package/lib/src/PaymentMethods/PaymentMethod.d.ts +1 -1
- package/lib/src/PaymentMethods/PaymentMethod.js.map +1 -1
- package/lib/src/PaymentMethods/RecurringPaymentMethod.d.ts +3 -1
- package/lib/src/PaymentMethods/RecurringPaymentMethod.js +3 -0
- package/lib/src/PaymentMethods/RecurringPaymentMethod.js.map +1 -1
- package/lib/src/PaymentMethods/index.d.ts +2 -0
- package/lib/src/PaymentMethods/index.js +2 -0
- package/lib/src/PaymentMethods/index.js.map +1 -1
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.d.ts +2 -2
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.js +1 -1
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.js.map +1 -1
- package/lib/src/Services/ReportingService.d.ts +2 -0
- package/lib/src/Services/ReportingService.js +6 -0
- package/lib/src/Services/ReportingService.js.map +1 -1
- package/lib/src/Utils/Logging/ProtectSensitiveData.d.ts +1 -1
- package/lib/src/Utils/Logging/ProtectSensitiveData.js.map +1 -1
- package/lib/src/Utils/StringUtils.d.ts +9 -0
- package/lib/src/Utils/StringUtils.js +29 -0
- package/lib/src/Utils/StringUtils.js.map +1 -1
- package/lib/test/Data/BaseGpApiTestConfig.d.ts +2 -2
- package/lib/test/Data/BaseGpApiTestConfig.js +4 -0
- package/lib/test/Data/BaseGpApiTestConfig.js.map +1 -1
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js +17 -10
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenTest.js.map +1 -1
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js +360 -0
- package/lib/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js +217 -0
- package/lib/test/Integration/Gateways/GpApiConnector/ReportingStoredPaymentMethodsTest.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { Transaction } from "src/Entities";
|
|
1
|
+
import { ReportType, StoredPaymentMethodSummary, Transaction, TransactionSummary } from "../../src/Entities";
|
|
2
2
|
export declare class GpApiMapping {
|
|
3
3
|
static mapResponseAPM(response: string): void;
|
|
4
|
-
static mapResponse(response:
|
|
4
|
+
static mapResponse(response: any): Transaction;
|
|
5
|
+
private static mapPaymentMethodTransactionDetails;
|
|
6
|
+
private static mapCardIssuerResponse;
|
|
7
|
+
private static mapAddressObject;
|
|
8
|
+
static mapReportResponse(response: any, reportType: ReportType): TransactionSummary;
|
|
9
|
+
static mapStoredPaymentMethodSummary(response: any): StoredPaymentMethodSummary;
|
|
10
|
+
private static setPagingInfo;
|
|
5
11
|
}
|
|
@@ -1,13 +1,189 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GpApiMapping = void 0;
|
|
4
|
+
const src_1 = require("../../src");
|
|
5
|
+
const Entities_1 = require("../../src/Entities");
|
|
6
|
+
const DTO_1 = require("../../src/Entities/GpApi/DTO");
|
|
4
7
|
class GpApiMapping {
|
|
5
8
|
static mapResponseAPM(response) {
|
|
6
9
|
response;
|
|
7
10
|
}
|
|
8
11
|
static mapResponse(response) {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
const transaction = new Entities_1.Transaction();
|
|
13
|
+
if (!response) {
|
|
14
|
+
return transaction;
|
|
15
|
+
}
|
|
16
|
+
transaction.responseCode = response.action.result_code;
|
|
17
|
+
transaction.responseMessage = response.status;
|
|
18
|
+
transaction.clientTransactionId = response.reference || null;
|
|
19
|
+
transaction.timestamp = response.time_created || "";
|
|
20
|
+
transaction.referenceNumber = response.reference || null;
|
|
21
|
+
transaction.balanceAmount = src_1.StringUtils.toAmount(response.amount);
|
|
22
|
+
if (response.status === Entities_1.TransactionStatus.PREAUTHORIZED &&
|
|
23
|
+
response.amount) {
|
|
24
|
+
transaction.authorizedAmount = src_1.StringUtils.toAmount(response.amount);
|
|
25
|
+
}
|
|
26
|
+
transaction.multiCapture =
|
|
27
|
+
response.capture_mode && response.capture_mode === Entities_1.CaptureMode.MULTIPLE;
|
|
28
|
+
transaction.fingerprint = response.fingerprint || null;
|
|
29
|
+
transaction.fingerprintIndicator =
|
|
30
|
+
response.fingerprint_presence_indicator || null;
|
|
31
|
+
transaction.token = response.id.startsWith(DTO_1.PaymentMethod.PAYMENT_METHOD_TOKEN_PREFIX)
|
|
32
|
+
? response.id
|
|
33
|
+
: null;
|
|
34
|
+
transaction.tokenUsageMode = response.usage_mode || null;
|
|
35
|
+
if (response.payment_method) {
|
|
36
|
+
GpApiMapping.mapPaymentMethodTransactionDetails(transaction, response.payment_method);
|
|
37
|
+
GpApiMapping.mapPaymentMethodTransactionDetails(transaction, response.payment_method);
|
|
38
|
+
}
|
|
39
|
+
if (response.card) {
|
|
40
|
+
const cardDetails = new Entities_1.Card();
|
|
41
|
+
cardDetails.cardNumber = response.card.number || null;
|
|
42
|
+
cardDetails.brand = response.card.brand || null;
|
|
43
|
+
cardDetails.cardExpMonth = response.card.expiry_month || null;
|
|
44
|
+
cardDetails.cardExpYear = response.card.expiry_year || null;
|
|
45
|
+
transaction.cardDetails = cardDetails;
|
|
46
|
+
transaction.cardType = response.card.brand || "";
|
|
47
|
+
transaction.cvnResponseCode = response.card.cvv || null;
|
|
48
|
+
transaction.cardBrandTransactionId =
|
|
49
|
+
response.card.brand_reference || null;
|
|
50
|
+
}
|
|
51
|
+
transaction.multiCapture =
|
|
52
|
+
response.capture_mode && response.capture_mode === Entities_1.CaptureMode.MULTIPLE;
|
|
53
|
+
return transaction;
|
|
54
|
+
}
|
|
55
|
+
static mapPaymentMethodTransactionDetails(transaction, paymentMethodResponse) {
|
|
56
|
+
transaction.authorizationCode = paymentMethodResponse.result ?? null;
|
|
57
|
+
if (paymentMethodResponse.id) {
|
|
58
|
+
transaction.token = paymentMethodResponse.id;
|
|
59
|
+
}
|
|
60
|
+
transaction.fingerprint = paymentMethodResponse.fingerprint ?? null;
|
|
61
|
+
transaction.fingerprintIndicator =
|
|
62
|
+
paymentMethodResponse.fingerprint_presence_indicator ?? null;
|
|
63
|
+
if (paymentMethodResponse.card) {
|
|
64
|
+
const card = paymentMethodResponse.card;
|
|
65
|
+
const cardDetails = new Entities_1.Card();
|
|
66
|
+
cardDetails.maskedNumberLast4 = card.masked_number_last4 ?? null;
|
|
67
|
+
cardDetails.brand = card.brand ?? null;
|
|
68
|
+
transaction.cardDetails = cardDetails;
|
|
69
|
+
transaction.cardLast4 = card.masked_number_last4 ?? null;
|
|
70
|
+
transaction.cardType = card.brand ?? null;
|
|
71
|
+
transaction.cvnResponseCode = card.cvv ?? null;
|
|
72
|
+
transaction.cvnResponseMessage = card.cvv_result ?? null;
|
|
73
|
+
transaction.cardBrandTransactionId = card.brand_reference ?? null;
|
|
74
|
+
transaction.avsResponseCode = card.avs_postal_code_result ?? null;
|
|
75
|
+
transaction.avsAddressResponse = card.avs_address_result ?? null;
|
|
76
|
+
transaction.avsResponseMessage = card.avs_action ?? null;
|
|
77
|
+
if (card.provider) {
|
|
78
|
+
GpApiMapping.mapCardIssuerResponse(transaction, card.provider);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (paymentMethodResponse.apm &&
|
|
82
|
+
paymentMethodResponse.apm.provider ===
|
|
83
|
+
Entities_1.PaymentProvider.OPEN_BANKING.toLowerCase()) {
|
|
84
|
+
}
|
|
85
|
+
else if (paymentMethodResponse.bank_transfer) {
|
|
86
|
+
const bankTransfer = paymentMethodResponse.bank_transfer;
|
|
87
|
+
transaction.accountNumberLast4 =
|
|
88
|
+
bankTransfer.masked_account_number_last4 ?? null;
|
|
89
|
+
transaction.accountType = bankTransfer.account_type ?? null;
|
|
90
|
+
transaction.paymentMethodType = Entities_1.PaymentMethodType.ACH;
|
|
91
|
+
}
|
|
92
|
+
else if (paymentMethodResponse.apm) {
|
|
93
|
+
transaction.paymentMethodType = Entities_1.PaymentMethodType.APM;
|
|
94
|
+
}
|
|
95
|
+
if (paymentMethodResponse.shipping_address || paymentMethodResponse.payer) {
|
|
96
|
+
const payerDetails = new Entities_1.PayerDetails();
|
|
97
|
+
payerDetails.email = paymentMethodResponse.payer?.email ?? null;
|
|
98
|
+
if (paymentMethodResponse.payer?.billing_address) {
|
|
99
|
+
const billingAddress = paymentMethodResponse.payer.billing_address;
|
|
100
|
+
payerDetails.firstName = billingAddress.first_name ?? null;
|
|
101
|
+
payerDetails.lastName = billingAddress.last_name ?? null;
|
|
102
|
+
payerDetails.billingAddress = GpApiMapping.mapAddressObject(billingAddress, Entities_1.AddressType.Billing);
|
|
103
|
+
}
|
|
104
|
+
payerDetails.shippingAddress = GpApiMapping.mapAddressObject(paymentMethodResponse.shipping_address, Entities_1.AddressType.Shipping);
|
|
105
|
+
transaction.payerDetails = payerDetails;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
static mapCardIssuerResponse(transaction, cardIssuerResponse) {
|
|
109
|
+
transaction.cardIssuerResponse = new Entities_1.CardIssuerResponse();
|
|
110
|
+
transaction.cardIssuerResponse.result = cardIssuerResponse.result ?? null;
|
|
111
|
+
transaction.cardIssuerResponse.avsResult =
|
|
112
|
+
cardIssuerResponse.avs_result ?? null;
|
|
113
|
+
transaction.cardIssuerResponse.cvvResult =
|
|
114
|
+
cardIssuerResponse.cvv_result ?? null;
|
|
115
|
+
transaction.cardIssuerResponse.avsAddressResult =
|
|
116
|
+
cardIssuerResponse.avs_address_result ?? null;
|
|
117
|
+
transaction.cardIssuerResponse.avsPostalCodeResult =
|
|
118
|
+
cardIssuerResponse.avs_postal_code_result ?? null;
|
|
119
|
+
}
|
|
120
|
+
static mapAddressObject(address, type = null) {
|
|
121
|
+
if (!address) {
|
|
122
|
+
return new Entities_1.Address();
|
|
123
|
+
}
|
|
124
|
+
const userAddress = new Entities_1.Address();
|
|
125
|
+
userAddress.type = type;
|
|
126
|
+
userAddress.streetAddress1 = address.line_1 ?? null;
|
|
127
|
+
userAddress.streetAddress2 = address.line_2 ?? null;
|
|
128
|
+
userAddress.streetAddress3 = address.line_3 ?? null;
|
|
129
|
+
userAddress.city = address.city ?? null;
|
|
130
|
+
userAddress.state = address.state ?? null;
|
|
131
|
+
userAddress.postalCode = address.postal_code ?? null;
|
|
132
|
+
userAddress.countryCode = address.country ?? null;
|
|
133
|
+
userAddress.type = address.functions?.[0] ?? type;
|
|
134
|
+
return userAddress;
|
|
135
|
+
}
|
|
136
|
+
static mapReportResponse(response, reportType) {
|
|
137
|
+
let report;
|
|
138
|
+
switch (reportType) {
|
|
139
|
+
case Entities_1.ReportType.FindStoredPaymentMethodsPaged:
|
|
140
|
+
report = this.setPagingInfo(response);
|
|
141
|
+
response.payment_methods.forEach((spm) => {
|
|
142
|
+
report.result.push(this.mapStoredPaymentMethodSummary(spm));
|
|
143
|
+
});
|
|
144
|
+
break;
|
|
145
|
+
case Entities_1.ReportType.StoredPaymentMethodDetail:
|
|
146
|
+
report = this.mapStoredPaymentMethodSummary(response);
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
throw new Entities_1.ApiError("Report type not supported!");
|
|
150
|
+
}
|
|
151
|
+
return report;
|
|
152
|
+
}
|
|
153
|
+
static mapStoredPaymentMethodSummary(response) {
|
|
154
|
+
const summary = new Entities_1.StoredPaymentMethodSummary();
|
|
155
|
+
summary.paymentMethodId = response.id;
|
|
156
|
+
if (response.time_created) {
|
|
157
|
+
summary.timeCreated = new Date(response.time_created);
|
|
158
|
+
}
|
|
159
|
+
summary.status = !!response.status ? response.status : "";
|
|
160
|
+
summary.reference = !!response.reference ? response.reference : "";
|
|
161
|
+
summary.cardHolderName = !!response.name ? response.name : "";
|
|
162
|
+
if (response.card) {
|
|
163
|
+
const card = response.card;
|
|
164
|
+
summary.cardType = !!card.brand ? card.brand : "";
|
|
165
|
+
summary.cardNumberLastFour = !!card.number_last4 ? card.number_last4 : "";
|
|
166
|
+
summary.cardExpMonth = !!card.expiry_month ? card.expiry_month : "";
|
|
167
|
+
summary.cardExpYear = !!card.expiry_year ? card.expiry_year : "";
|
|
168
|
+
}
|
|
169
|
+
return summary;
|
|
170
|
+
}
|
|
171
|
+
static setPagingInfo(response) {
|
|
172
|
+
const pageInfo = new Entities_1.PagedResult();
|
|
173
|
+
pageInfo.totalRecordCount = !!response.total_count
|
|
174
|
+
? response.total_count
|
|
175
|
+
: !!response.total_record_count
|
|
176
|
+
? response.total_record_count
|
|
177
|
+
: null;
|
|
178
|
+
pageInfo.pageSize = !!response.paging?.page_size
|
|
179
|
+
? response.paging.page_size
|
|
180
|
+
: null;
|
|
181
|
+
pageInfo.page = !!response.paging?.page ? response.paging.page : null;
|
|
182
|
+
pageInfo.order = !!response.paging?.order ? response.paging.order : null;
|
|
183
|
+
pageInfo.orderBy = !!response.paging?.order_by
|
|
184
|
+
? response.paging.order_by
|
|
185
|
+
: null;
|
|
186
|
+
return pageInfo;
|
|
11
187
|
}
|
|
12
188
|
}
|
|
13
189
|
exports.GpApiMapping = GpApiMapping;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GpApiMapping.js","sourceRoot":"","sources":["../../../src/Mapping/GpApiMapping.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"GpApiMapping.js","sourceRoot":"","sources":["../../../src/Mapping/GpApiMapping.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AACxC,iDAgB4B;AAC5B,sDAA6D;AAE7D,MAAa,YAAY;IAChB,MAAM,CAAC,cAAc,CAAC,QAAgB;QAC3C,QAAQ,CAAC;IACX,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,QAAa;QACrC,MAAM,WAAW,GAAG,IAAI,sBAAW,EAAE,CAAC;QAEtC,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,WAAW,CAAC;SACpB;QAED,WAAW,CAAC,YAAY,GAAG,QAAQ,CAAC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AC,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QACzE,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ;YAC5C,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ;YAC1B,CAAC,CAAC,IAAI,CAAC;QAET,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAhPD,oCAgPC"}
|
package/lib/src/Mapping/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./EnumMapping"), exports);
|
|
17
18
|
__exportStar(require("./GpApiMapping"), exports);
|
|
18
19
|
__exportStar(require("./GpEcomMapping"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Mapping/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Mapping/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,kDAAgC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuthorizationBuilder, EncryptionData, PaymentMethodType } from "../../src";
|
|
2
|
+
import { IChargable, IEncryptable, IPaymentMethod, IPinProtected, IPrePayable, IRefundable, IReversable } from ".";
|
|
3
|
+
export declare class AlternativePaymentMethod implements IPaymentMethod, IPrePayable, IRefundable, IReversable, IChargable, IEncryptable, IPinProtected {
|
|
4
|
+
paymentMethodType: PaymentMethodType;
|
|
5
|
+
alternativePaymentMethodType: string;
|
|
6
|
+
returnUrl: string;
|
|
7
|
+
statusUpdateUrl: string;
|
|
8
|
+
cancelUrl: string;
|
|
9
|
+
descriptor: string;
|
|
10
|
+
country: string;
|
|
11
|
+
accountHolderName: string;
|
|
12
|
+
providerReference: string;
|
|
13
|
+
addressOverrideMode: string;
|
|
14
|
+
pinBlock: string;
|
|
15
|
+
encryptionData: EncryptionData;
|
|
16
|
+
constructor(alternativePaymentMethodType: string);
|
|
17
|
+
charge(amount: string | number): AuthorizationBuilder;
|
|
18
|
+
authorize(amount: string | number): AuthorizationBuilder;
|
|
19
|
+
addValue(amount: string | number): AuthorizationBuilder;
|
|
20
|
+
refund(amount: string | number): AuthorizationBuilder;
|
|
21
|
+
reverse(amount: string | number): AuthorizationBuilder;
|
|
22
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlternativePaymentMethod = void 0;
|
|
4
|
+
const src_1 = require("../../src");
|
|
5
|
+
/* eslint-disable indent */
|
|
6
|
+
class AlternativePaymentMethod {
|
|
7
|
+
paymentMethodType = src_1.PaymentMethodType.APM;
|
|
8
|
+
alternativePaymentMethodType;
|
|
9
|
+
returnUrl;
|
|
10
|
+
statusUpdateUrl;
|
|
11
|
+
cancelUrl;
|
|
12
|
+
descriptor;
|
|
13
|
+
country;
|
|
14
|
+
accountHolderName;
|
|
15
|
+
providerReference;
|
|
16
|
+
addressOverrideMode;
|
|
17
|
+
pinBlock;
|
|
18
|
+
encryptionData;
|
|
19
|
+
/* eslint-enable indent */
|
|
20
|
+
constructor(alternativePaymentMethodType) {
|
|
21
|
+
this.alternativePaymentMethodType = alternativePaymentMethodType;
|
|
22
|
+
}
|
|
23
|
+
charge(amount) {
|
|
24
|
+
return new src_1.AuthorizationBuilder(src_1.TransactionType.Sale, this)
|
|
25
|
+
.withModifier(src_1.TransactionModifier.AlternativePaymentMethod)
|
|
26
|
+
.withAmount(amount);
|
|
27
|
+
}
|
|
28
|
+
authorize(amount) {
|
|
29
|
+
return new src_1.AuthorizationBuilder(src_1.TransactionType.Auth, this)
|
|
30
|
+
.withModifier(src_1.TransactionModifier.AlternativePaymentMethod)
|
|
31
|
+
.withAmount(amount);
|
|
32
|
+
}
|
|
33
|
+
addValue(amount) {
|
|
34
|
+
amount;
|
|
35
|
+
throw new src_1.NotImplementedError();
|
|
36
|
+
}
|
|
37
|
+
refund(amount) {
|
|
38
|
+
amount;
|
|
39
|
+
throw new src_1.NotImplementedError();
|
|
40
|
+
}
|
|
41
|
+
reverse(amount) {
|
|
42
|
+
amount;
|
|
43
|
+
throw new src_1.NotImplementedError();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.AlternativePaymentMethod = AlternativePaymentMethod;
|
|
47
|
+
//# sourceMappingURL=AlternativePaymentMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlternativePaymentMethod.js","sourceRoot":"","sources":["../../../src/PaymentMethods/AlternativePaymentMethod.ts"],"names":[],"mappings":";;;AAAA,mCAOmB;AAWnB,2BAA2B;AAC3B,MAAa,wBAAwB;IAUnC,iBAAiB,GAAG,uBAAiB,CAAC,GAAG,CAAC;IAC1C,4BAA4B,CAAS;IACrC,SAAS,CAAS;IAClB,eAAe,CAAS;IACxB,SAAS,CAAS;IAClB,UAAU,CAAS;IACnB,OAAO,CAAS;IAChB,iBAAiB,CAAS;IAC1B,iBAAiB,CAAS;IAC1B,mBAAmB,CAAS;IAC5B,QAAQ,CAAS;IACjB,cAAc,CAAiB;IAC/B,0BAA0B;IAE1B,YAAY,4BAAoC;QAC9C,IAAI,CAAC,4BAA4B,GAAG,4BAA4B,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,MAAuB;QAC5B,OAAO,IAAI,0BAAoB,CAAC,qBAAe,CAAC,IAAI,EAAE,IAAI,CAAC;aACxD,YAAY,CAAC,yBAAmB,CAAC,wBAAwB,CAAC;aAC1D,UAAU,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,SAAS,CAAC,MAAuB;QAC/B,OAAO,IAAI,0BAAoB,CAAC,qBAAe,CAAC,IAAI,EAAE,IAAI,CAAC;aACxD,YAAY,CAAC,yBAAmB,CAAC,wBAAwB,CAAC;aAC1D,UAAU,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,QAAQ,CAAC,MAAuB;QAC9B,MAAM,CAAC;QACP,MAAM,IAAI,yBAAmB,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAuB;QAC5B,MAAM,CAAC;QACP,MAAM,IAAI,yBAAmB,EAAE,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,MAAuB;QAC7B,MAAM,CAAC;QACP,MAAM,IAAI,yBAAmB,EAAE,CAAC;IAClC,CAAC;CACF;AAtDD,4DAsDC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthorizationBuilder, EncryptionData, InquiryType, PaymentMethodType } from "../";
|
|
1
|
+
import { AuthorizationBuilder, EncryptionData, InquiryType, ManagementBuilder, PaymentMethodType, PaymentMethodUsageMode, Transaction } from "../";
|
|
2
2
|
import { IAuthable, IBalanceable, IChargable, IEncryptable, IPrePayable, IRefundable, IReversable, ITokenizable, IVerifyable } from "./Interfaces";
|
|
3
3
|
import { PaymentMethod } from "./PaymentMethod";
|
|
4
4
|
export declare abstract class Credit extends PaymentMethod implements IEncryptable, ITokenizable, IChargable, IAuthable, IRefundable, IReversable, IVerifyable, IPrePayable, IBalanceable {
|
|
@@ -81,5 +81,29 @@ export declare abstract class Credit extends PaymentMethod implements IEncryptab
|
|
|
81
81
|
*
|
|
82
82
|
* @return AuthorizationBuilder
|
|
83
83
|
*/
|
|
84
|
-
tokenize(): AuthorizationBuilder;
|
|
84
|
+
tokenize(verifyCard?: boolean, usageMode?: PaymentMethodUsageMode): AuthorizationBuilder;
|
|
85
|
+
/**
|
|
86
|
+
* Updates the token expiry date with the values proced to the card object
|
|
87
|
+
*
|
|
88
|
+
* @returns boolean value indicating success/failure
|
|
89
|
+
*/
|
|
90
|
+
updateTokenExpiry(): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Updates the payment token
|
|
93
|
+
*
|
|
94
|
+
* @returns ManagementBuilder
|
|
95
|
+
*/
|
|
96
|
+
updateToken(): ManagementBuilder;
|
|
97
|
+
/**
|
|
98
|
+
* Deletes the token associated with the current card object
|
|
99
|
+
*
|
|
100
|
+
* @returns boolean value indicating success/failure
|
|
101
|
+
*/
|
|
102
|
+
deleteToken(): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Detokenizes the payment method
|
|
105
|
+
*
|
|
106
|
+
* @returns result of the detokenization
|
|
107
|
+
*/
|
|
108
|
+
detokenize(): Promise<Transaction>;
|
|
85
109
|
}
|
|
@@ -97,8 +97,64 @@ class Credit extends PaymentMethod_1.PaymentMethod {
|
|
|
97
97
|
*
|
|
98
98
|
* @return AuthorizationBuilder
|
|
99
99
|
*/
|
|
100
|
-
tokenize() {
|
|
101
|
-
|
|
100
|
+
tokenize(verifyCard = true, usageMode = __1.PaymentMethodUsageMode.MULTIPLE) {
|
|
101
|
+
if (verifyCard !== false) {
|
|
102
|
+
verifyCard = true;
|
|
103
|
+
}
|
|
104
|
+
const type = verifyCard ? __1.TransactionType.Verify : __1.TransactionType.Tokenize;
|
|
105
|
+
return new __1.AuthorizationBuilder(type, this)
|
|
106
|
+
.withRequestMultiUseToken(true)
|
|
107
|
+
.withPaymentMethodUsageMode(usageMode);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Updates the token expiry date with the values proced to the card object
|
|
111
|
+
*
|
|
112
|
+
* @returns boolean value indicating success/failure
|
|
113
|
+
*/
|
|
114
|
+
async updateTokenExpiry() {
|
|
115
|
+
if (!this.token) {
|
|
116
|
+
throw new __1.BuilderError("Token cannot be null");
|
|
117
|
+
}
|
|
118
|
+
await new __1.ManagementBuilder(__1.TransactionType.TokenUpdate)
|
|
119
|
+
.withPaymentMethod(this)
|
|
120
|
+
.execute();
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Updates the payment token
|
|
125
|
+
*
|
|
126
|
+
* @returns ManagementBuilder
|
|
127
|
+
*/
|
|
128
|
+
updateToken() {
|
|
129
|
+
if (!this.token) {
|
|
130
|
+
throw new __1.BuilderError("Token cannot be null");
|
|
131
|
+
}
|
|
132
|
+
return new __1.ManagementBuilder(__1.TransactionType.TokenUpdate).withPaymentMethod(this);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Deletes the token associated with the current card object
|
|
136
|
+
*
|
|
137
|
+
* @returns boolean value indicating success/failure
|
|
138
|
+
*/
|
|
139
|
+
async deleteToken() {
|
|
140
|
+
if (!this.token) {
|
|
141
|
+
throw new __1.BuilderError("Token cannot be null");
|
|
142
|
+
}
|
|
143
|
+
await new __1.ManagementBuilder(__1.TransactionType.TokenUpdate)
|
|
144
|
+
.withPaymentMethod(this)
|
|
145
|
+
.execute();
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Detokenizes the payment method
|
|
150
|
+
*
|
|
151
|
+
* @returns result of the detokenization
|
|
152
|
+
*/
|
|
153
|
+
async detokenize() {
|
|
154
|
+
if (!this.token) {
|
|
155
|
+
throw new __1.BuilderError("Token cannot be null or empty");
|
|
156
|
+
}
|
|
157
|
+
return await new __1.ManagementBuilder(__1.TransactionType.Detokenize, this).execute();
|
|
102
158
|
}
|
|
103
159
|
}
|
|
104
160
|
exports.Credit = Credit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Credit.js","sourceRoot":"","sources":["../../../src/PaymentMethods/Credit.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Credit.js","sourceRoot":"","sources":["../../../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Ae,CAAC,WAAW,CAAC;aACrD,iBAAiB,CAAC,IAAI,CAAC;aACvB,OAAO,EAAE,CAAC;QAEb,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,MAAM,IAAI,gBAAY,CAAC,+BAA+B,CAAC,CAAC;SACzD;QAED,OAAO,MAAM,IAAI,qBAAiB,CAChC,mBAAe,CAAC,UAAU,EAC1B,IAAI,CACL,CAAC,OAAO,EAAE,CAAC;IACd,CAAC;CACF;AA/MD,wBA+MC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthorizationBuilder, CvnPresenceIndicator, EncryptionData, EntryMethod, InquiryType, ManagementBuilder, PaymentMethodType } from "../";
|
|
1
|
+
import { AuthorizationBuilder, CvnPresenceIndicator, EncryptionData, EntryMethod, InquiryType, ManagementBuilder, PaymentMethodType, Transaction } from "../";
|
|
2
2
|
export interface IAuthable {
|
|
3
3
|
authorize(amount?: string | number): AuthorizationBuilder;
|
|
4
4
|
}
|
|
@@ -42,6 +42,10 @@ export interface IReversable {
|
|
|
42
42
|
export interface ITokenizable {
|
|
43
43
|
token: string;
|
|
44
44
|
tokenize(): AuthorizationBuilder;
|
|
45
|
+
updateTokenExpiry(): Promise<boolean>;
|
|
46
|
+
deleteToken(): Promise<boolean>;
|
|
47
|
+
detokenize(): Promise<Transaction>;
|
|
48
|
+
updateToken(): ManagementBuilder;
|
|
45
49
|
}
|
|
46
50
|
export interface ITrackData {
|
|
47
51
|
value: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IPaymentMethod, PaymentMethodType } from "../";
|
|
2
|
-
export declare
|
|
2
|
+
export declare class PaymentMethod implements IPaymentMethod {
|
|
3
3
|
paymentMethodType: PaymentMethodType;
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
get isAuthable(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentMethod.js","sourceRoot":"","sources":["../../../src/PaymentMethods/PaymentMethod.ts"],"names":[],"mappings":";;;AAAA,2BAiBa;AAEb,
|
|
1
|
+
{"version":3,"file":"PaymentMethod.js","sourceRoot":"","sources":["../../../src/PaymentMethods/PaymentMethod.ts"],"names":[],"mappings":";;;AAAA,2BAiBa;AAEb,MAAa,aAAa;IACjB,iBAAiB,CAAoB;IAG5C,IAAI,UAAU;QACZ,OAAQ,IAA4B,CAAC,SAAS,KAAK,SAAS,CAAC;IAC/D,CAAC;IAED,IAAI,aAAa;QACf,OAAQ,IAA+B,CAAC,cAAc,KAAK,SAAS,CAAC;IACvE,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,CACL,CAAC,CAAC,IAAI,CAAC,aAAa;YACjB,IAA+B,CAAC,KAAK,KAAK,SAAS,CAAC;YACpD,IAA4B,CAAC,MAAM,KAAK,SAAS,CAAC;YACrD,IAAI,CAAC,iBAAiB,KAAK,qBAAiB,CAAC,IAAI,CAClD,CAAC;IACJ,CAAC;IAED,IAAI,WAAW;QACb,OAAQ,IAA6B,CAAC,MAAM,KAAK,SAAS,CAAC;IAC7D,CAAC;IAED,IAAI,UAAU;QACZ,OAAQ,IAA4B,CAAC,IAAI,KAAK,SAAS,CAAC;IAC1D,CAAC;IAED,IAAI,aAAa;QACf,OAAQ,IAA+B,CAAC,cAAc,KAAK,SAAS,CAAC;IACvE,CAAC;IAED,IAAI,cAAc;QAChB,OAAQ,IAAgC,CAAC,QAAQ,KAAK,SAAS,CAAC;IAClE,CAAC;IAED,IAAI,YAAY;QACd,OAAQ,IAA8B,CAAC,QAAQ,KAAK,SAAS,CAAC;IAChE,CAAC;IAED,IAAI,YAAY;QACd,OAAQ,IAA8B,CAAC,MAAM,KAAK,SAAS,CAAC;IAC9D,CAAC;IAED,IAAI,YAAY;QACd,OAAQ,IAA8B,CAAC,OAAO,KAAK,SAAS,CAAC;IAC/D,CAAC;IAED,IAAI,aAAa;QACf,OAAQ,IAA+B,CAAC,QAAQ,KAAK,SAAS,CAAC;IACjE,CAAC;IAED,IAAI,WAAW;QACb,OAAO,CACJ,IAA6B,CAAC,KAAK,KAAK,SAAS;YAClD,CAAE,IAA6B,CAAC,WAAW,KAAK,SAAS;gBACtD,IAAgC,CAAC,QAAQ,KAAK,SAAS;gBACvD,IAA+B,CAAC,cAAc,KAAK,SAAS,CAAC,CACjE,CAAC;IACJ,CAAC;IAED,IAAI,YAAY;QACd,OAAQ,IAA8B,CAAC,MAAM,KAAK,SAAS,CAAC;IAC9D,CAAC;IAED,IAAI,UAAU;QACZ,OAAQ,IAA4B,CAAC,IAAI,KAAK,SAAS,CAAC;IAC1D,CAAC;CACF;AArED,sCAqEC"}
|
|
@@ -11,7 +11,9 @@ export declare class RecurringPaymentMethod extends RecurringEntity<RecurringPay
|
|
|
11
11
|
preferredPayment: boolean;
|
|
12
12
|
status: string;
|
|
13
13
|
taxType: string;
|
|
14
|
-
|
|
14
|
+
lastFour: string;
|
|
15
|
+
cardType: string;
|
|
16
|
+
_paymentMethod: IPaymentMethod;
|
|
15
17
|
get paymentMethod(): IPaymentMethod;
|
|
16
18
|
set paymentMethod(value: IPaymentMethod);
|
|
17
19
|
constructor(customerIdOrPaymentMethod?: string | IPaymentMethod, paymentId?: string);
|
|
@@ -14,6 +14,8 @@ class RecurringPaymentMethod extends Entities_1.RecurringEntity {
|
|
|
14
14
|
preferredPayment;
|
|
15
15
|
status;
|
|
16
16
|
taxType;
|
|
17
|
+
lastFour;
|
|
18
|
+
cardType;
|
|
17
19
|
_paymentMethod;
|
|
18
20
|
get paymentMethod() {
|
|
19
21
|
return this._paymentMethod;
|
|
@@ -27,6 +29,7 @@ class RecurringPaymentMethod extends Entities_1.RecurringEntity {
|
|
|
27
29
|
}
|
|
28
30
|
constructor(customerIdOrPaymentMethod, paymentId) {
|
|
29
31
|
super();
|
|
32
|
+
this.address = new __1.Address();
|
|
30
33
|
if (customerIdOrPaymentMethod &&
|
|
31
34
|
(typeof customerIdOrPaymentMethod === "string" ||
|
|
32
35
|
customerIdOrPaymentMethod instanceof String)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurringPaymentMethod.js","sourceRoot":"","sources":["../../../src/PaymentMethods/RecurringPaymentMethod.ts"],"names":[],"mappings":";;;AAAA,2BASa;AACb,0CAA8C;AAE9C,MAAa,sBAAuB,SAAQ,0BAAuC;IAC1E,OAAO,CAAU;IACjB,mBAAmB,CAAS;IAC5B,WAAW,CAAS;IACpB,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,iBAAiB,GAAG,qBAAiB,CAAC,SAAS,CAAC;IAChD,WAAW,CAAS;IACpB,gBAAgB,CAAU;IAC1B,MAAM,CAAS;IACf,OAAO,CAAS;
|
|
1
|
+
{"version":3,"file":"RecurringPaymentMethod.js","sourceRoot":"","sources":["../../../src/PaymentMethods/RecurringPaymentMethod.ts"],"names":[],"mappings":";;;AAAA,2BASa;AACb,0CAA8C;AAE9C,MAAa,sBAAuB,SAAQ,0BAAuC;IAC1E,OAAO,CAAU;IACjB,mBAAmB,CAAS;IAC5B,WAAW,CAAS;IACpB,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,iBAAiB,GAAG,qBAAiB,CAAC,SAAS,CAAC;IAChD,WAAW,CAAS;IACpB,gBAAgB,CAAU;IAC1B,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACjB,cAAc,CAAiB;IAEtC,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,IAAW,aAAa,CAAC,KAAqB;QAC5C,MAAM,MAAM,GAAG,qBAAiB,CAAC,QAAQ,EAAE,CAAC,kBAAkB,EAAE,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE;YACxC,MAAM,IAAI,+BAA2B,EAAE,CAAC;SACzC;QACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAA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OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA5ED,wDA4EC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AlternativePaymentMethod";
|
|
1
2
|
export * from "./Cash";
|
|
2
3
|
export * from "./Credit";
|
|
3
4
|
export * from "./CreditCardData";
|
|
@@ -9,6 +10,7 @@ export * from "./EBTCardData";
|
|
|
9
10
|
export * from "./EBTTrackData";
|
|
10
11
|
export * from "./ECheck";
|
|
11
12
|
export * from "./GiftCard";
|
|
13
|
+
export * from "./Interfaces";
|
|
12
14
|
export * from "./PaymentMethod";
|
|
13
15
|
export * from "./RecurringPaymentMethod";
|
|
14
16
|
export * from "./Interfaces";
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AlternativePaymentMethod"), exports);
|
|
17
18
|
__exportStar(require("./Cash"), exports);
|
|
18
19
|
__exportStar(require("./Credit"), exports);
|
|
19
20
|
__exportStar(require("./CreditCardData"), exports);
|
|
@@ -25,6 +26,7 @@ __exportStar(require("./EBTCardData"), exports);
|
|
|
25
26
|
__exportStar(require("./EBTTrackData"), exports);
|
|
26
27
|
__exportStar(require("./ECheck"), exports);
|
|
27
28
|
__exportStar(require("./GiftCard"), exports);
|
|
29
|
+
__exportStar(require("./Interfaces"), exports);
|
|
28
30
|
__exportStar(require("./PaymentMethod"), exports);
|
|
29
31
|
__exportStar(require("./RecurringPaymentMethod"), exports);
|
|
30
32
|
__exportStar(require("./Interfaces"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/PaymentMethods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC;AAClC,0CAAwB;AACxB,mDAAiC;AACjC,wCAAsB;AACtB,gDAA8B;AAC9B,iDAA+B;AAC/B,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,2DAAyC;AACzC,+CAA6B;AAC7B,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/PaymentMethods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yCAAuB;AACvB,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC;AAClC,0CAAwB;AACxB,mDAAiC;AACjC,wCAAsB;AACtB,gDAA8B;AAC9B,iDAA+B;AAC/B,2CAAyB;AACzB,6CAA2B;AAC3B,+CAA6B;AAC7B,kDAAgC;AAChC,2DAAyC;AACzC,+CAA6B;AAC7B,yDAAuC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessTokenInfo, IntervalToExpire } from "../../../src/Entities";
|
|
1
|
+
import { AccessTokenInfo, Channel, IntervalToExpire } from "../../../src/Entities";
|
|
2
2
|
import { GatewayConfig } from "./GatewayConfig";
|
|
3
3
|
import { ConfiguredServices } from "../../../src/ConfiguredServices";
|
|
4
4
|
export declare class GpApiConfig extends GatewayConfig {
|
|
@@ -6,7 +6,7 @@ export declare class GpApiConfig extends GatewayConfig {
|
|
|
6
6
|
appKey: string;
|
|
7
7
|
accessTokenInfo: AccessTokenInfo;
|
|
8
8
|
country: string;
|
|
9
|
-
channel:
|
|
9
|
+
channel: Channel;
|
|
10
10
|
secondsToExpire: number;
|
|
11
11
|
intervalToExpire: IntervalToExpire;
|
|
12
12
|
methodNotificationUrl: string;
|
|
@@ -36,7 +36,7 @@ class GpApiConfig extends GatewayConfig_1.GatewayConfig {
|
|
|
36
36
|
}
|
|
37
37
|
validate() {
|
|
38
38
|
super.validate();
|
|
39
|
-
if (!this.accessTokenInfo && (!this.appId || this.appKey)) {
|
|
39
|
+
if (!this.accessTokenInfo && (!this.appId || !this.appKey)) {
|
|
40
40
|
throw new Entities_1.ConfigurationError("AccessTokenInfo or AppId and AppKey cannot be null");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GpApiConfig.js","sourceRoot":"","sources":["../../../../src/ServiceConfigs/Gateways/GpApiConfig.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"GpApiConfig.js","sourceRoot":"","sources":["../../../../src/ServiceConfigs/Gateways/GpApiConfig.ts"],"names":[],"mappings":";;;AAAA,oDAQ+B;AAC/B,mDAAgD;AAEhD,sCAA8C;AAE9C,MAAa,WAAY,SAAQ,6BAAa;IACrC,KAAK,CAAS;IAEd,MAAM,CAAS;IAEf,eAAe,CAAkB;IAEjC,OAAO,GAAW,IAAI,CAAC;IAEvB,OAAO,CAAU;IAEjB,eAAe,CAAS;IAExB,gBAAgB,CAAmB;IAEnC,qBAAqB,CAAS;IAE9B,wBAAwB,CAAS;IAEjC,kBAAkB,CAAS;IAE3B,WAAW,CAAW;IAEtB,UAAU,CAAS;IAEnB,cAAc,CAAS;IAE9B;QACE,KAAK,CAAC,0BAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAEM,kBAAkB,CAAC,QAA4B;QACpD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,UAAU;gBACb,IAAI,CAAC,WAAW,IAAI,sBAAW,CAAC,UAAU;oBACxC,CAAC,CAAC,2BAAgB,CAAC,iBAAiB;oBACpC,CAAC,CAAC,2BAAgB,CAAC,WAAW,CAAC;SACpC;QAED,MAAM,OAAO,GAAG,IAAI,oBAAc,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACrC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAE3C,QAAQ,CAAC,gBAAgB,GAAG,OAAO,CAAC;QACpC,QAAQ,CAAC,gBAAgB,GAAG,OAAO,CAAC;IACtC,CAAC;IAEM,QAAQ;QACb,KAAK,CAAC,QAAQ,EAAE,CAAC;QAEjB,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC1D,MAAM,IAAI,6BAAkB,CAC1B,oDAAoD,CACrD,CAAC;SACH;IACH,CAAC;CACF;AAxDD,kCAwDC"}
|
|
@@ -3,4 +3,6 @@ export declare class ReportingService {
|
|
|
3
3
|
static activity(): TransactionReportBuilder<TransactionSummary[]>;
|
|
4
4
|
static transactionDetail(transactionId?: string): TransactionReportBuilder<TransactionSummary>;
|
|
5
5
|
static findTransactions(): TransactionReportBuilder<TransactionSummary[]>;
|
|
6
|
+
static findStoredPaymentMethodsPaged(page: number, pageSize: number): TransactionReportBuilder<TransactionSummary[]>;
|
|
7
|
+
static storedPaymentMethodDetail(paymentMethodId: string): TransactionReportBuilder<TransactionSummary>;
|
|
6
8
|
}
|
|
@@ -13,6 +13,12 @@ class ReportingService {
|
|
|
13
13
|
static findTransactions() {
|
|
14
14
|
return new __1.TransactionReportBuilder(__1.ReportType.FindTransactions);
|
|
15
15
|
}
|
|
16
|
+
static findStoredPaymentMethodsPaged(page, pageSize) {
|
|
17
|
+
return new __1.TransactionReportBuilder(__1.ReportType.FindStoredPaymentMethodsPaged).withPaging(page, pageSize);
|
|
18
|
+
}
|
|
19
|
+
static storedPaymentMethodDetail(paymentMethodId) {
|
|
20
|
+
return new __1.TransactionReportBuilder(__1.ReportType.StoredPaymentMethodDetail).withStoredPaymentMethodId(paymentMethodId);
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
exports.ReportingService = ReportingService;
|
|
18
24
|
//# sourceMappingURL=ReportingService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportingService.js","sourceRoot":"","sources":["../../../src/Services/ReportingService.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,2BAA+E;AAE/E,MAAa,gBAAgB;IACpB,MAAM,CAAC,QAAQ;QACpB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,QAAQ,CACpB,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAC7B,aAAsB;QAEtB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,iBAAiB,CAC7B,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,gBAAgB;QAG5B,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,gBAAgB,CAC5B,CAAC;IACJ,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"ReportingService.js","sourceRoot":"","sources":["../../../src/Services/ReportingService.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,2BAA+E;AAE/E,MAAa,gBAAgB;IACpB,MAAM,CAAC,QAAQ;QACpB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,QAAQ,CACpB,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAC7B,aAAsB;QAEtB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,iBAAiB,CAC7B,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,gBAAgB;QAG5B,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,gBAAgB,CAC5B,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,6BAA6B,CACzC,IAAY,EACZ,QAAgB;QAEhB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,6BAA6B,CACzC,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACrC,eAAuB;QAEvB,OAAO,IAAI,4BAAwB,CACjC,cAAU,CAAC,yBAAyB,CACrC,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAC/C,CAAC;CACF;AAvCD,4CAuCC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class ProtectSensitiveData {
|
|
2
2
|
private static hideValueCollection;
|
|
3
|
-
static hideValue(key: string, value: string, unmaskedLastChars?: number, unmaskedFirstChars?: number): {
|
|
3
|
+
static hideValue(key: string, value: string | null, unmaskedLastChars?: number, unmaskedFirstChars?: number): {
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
};
|
|
6
6
|
static hideValues(list: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtectSensitiveData.js","sourceRoot":"","sources":["../../../../src/Utils/Logging/ProtectSensitiveData.ts"],"names":[],"mappings":";;;AAAA,sCAAqD;AAErD,MAAa,oBAAoB;IACvB,MAAM,CAAC,mBAAmB,CAAwB;IAEnD,MAAM,CAAC,SAAS,CACrB,GAAW,EACX,
|
|
1
|
+
{"version":3,"file":"ProtectSensitiveData.js","sourceRoot":"","sources":["../../../../src/Utils/Logging/ProtectSensitiveData.ts"],"names":[],"mappings":";;;AAAA,sCAAqD;AAErD,MAAa,oBAAoB;IACvB,MAAM,CAAC,mBAAmB,CAAwB;IAEnD,MAAM,CAAC,SAAS,CACrB,GAAW,EACX,KAAoB,EACpB,oBAA4B,CAAC,EAC7B,qBAA6B,CAAC;QAE9B,OAAO,CACL,IAAI,CAAC,mBAAmB;YACxB,CAAC,IAAI,CAAC,mBAAmB,GAAG,IAAI,2BAAqB,EAAE,CAAC,CACzD,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IACjE,CAAC;IAEM,MAAM,CAAC,UAAU,CACtB,IAA+B,EAC/B,oBAA4B,CAAC,EAC7B,qBAA6B,CAAC;QAE9B,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC7B,IAAI,CAAC,mBAAmB,GAAG,IAAI,2BAAqB,EAAE,CAAC;SACxD;QAED,IAAI,UAAU,GAA8B,EAAE,CAAC;QAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/C,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAC7C,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;SACH;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AApCD,oDAoCC"}
|