globalpayments-api 3.10.14 → 3.10.15
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 +246 -240
- package/LICENSE.md +257 -257
- package/README.md +148 -148
- package/appsec.properties +8 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.d.ts +11 -2
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.js +44 -5
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiSessionInfo.js.map +1 -1
- package/lib/src/Entities/GpApi/PorticoTokenConfig.d.ts +25 -0
- package/lib/src/Entities/GpApi/PorticoTokenConfig.js +30 -0
- package/lib/src/Entities/GpApi/PorticoTokenConfig.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/Transaction.d.ts +2 -0
- package/lib/src/Entities/Transaction.js +2 -0
- package/lib/src/Entities/Transaction.js.map +1 -1
- package/lib/src/Entities/TransactionSummary.d.ts +1 -0
- package/lib/src/Entities/TransactionSummary.js +1 -0
- package/lib/src/Entities/TransactionSummary.js.map +1 -1
- package/lib/src/Entities/UPA/ExtraChargeType.d.ts +8 -0
- package/lib/src/Entities/UPA/ExtraChargeType.js +13 -0
- package/lib/src/Entities/UPA/ExtraChargeType.js.map +1 -0
- package/lib/src/Entities/UPA/Lodging.d.ts +11 -0
- package/lib/src/Entities/UPA/Lodging.js +15 -0
- package/lib/src/Entities/UPA/Lodging.js.map +1 -0
- package/lib/src/Entities/UPA/POSData.d.ts +6 -0
- package/lib/src/Entities/UPA/POSData.js +11 -0
- package/lib/src/Entities/UPA/POSData.js.map +1 -0
- package/lib/src/Gateways/GpApiConnector.js +21 -2
- package/lib/src/Gateways/GpApiConnector.js.map +1 -1
- package/lib/src/Gateways/PorticoConnector.js +2 -0
- package/lib/src/Gateways/PorticoConnector.js.map +1 -1
- package/lib/src/Mapping/GpApiMapping.js +7 -0
- package/lib/src/Mapping/GpApiMapping.js.map +1 -1
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.d.ts +6 -0
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.js +25 -2
- package/lib/src/ServiceConfigs/Gateways/GpApiConfig.js.map +1 -1
- package/lib/src/Services/GpApiServices.js +4 -1
- package/lib/src/Services/GpApiServices.js.map +1 -1
- package/lib/src/Terminals/Builders/TerminalReportBuilder.d.ts +15 -0
- package/lib/src/Terminals/Builders/TerminalReportBuilder.js +49 -0
- package/lib/src/Terminals/Builders/TerminalReportBuilder.js.map +1 -0
- package/lib/src/Terminals/UPA/Entities/UpaModels.d.ts +62 -0
- package/lib/src/Terminals/UPA/Entities/UpaModels.js +28 -0
- package/lib/src/Terminals/UPA/Entities/UpaModels.js.map +1 -0
- package/lib/src/Terminals/UPA/Entities/UpaSearchCriteria.d.ts +5 -0
- package/lib/src/Terminals/UPA/Entities/UpaSearchCriteria.js +10 -0
- package/lib/src/Terminals/UPA/Entities/UpaSearchCriteria.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/BatchList.d.ts +16 -0
- package/lib/src/Terminals/UPA/Reponses/BatchList.js +82 -0
- package/lib/src/Terminals/UPA/Reponses/BatchList.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/BatchReportResponse.d.ts +55 -0
- package/lib/src/Terminals/UPA/Reponses/BatchReportResponse.js +213 -0
- package/lib/src/Terminals/UPA/Reponses/BatchReportResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/OpenTabDetailsResponse.d.ts +25 -0
- package/lib/src/Terminals/UPA/Reponses/OpenTabDetailsResponse.js +109 -0
- package/lib/src/Terminals/UPA/Reponses/OpenTabDetailsResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/SafReportResponse.d.ts +36 -0
- package/lib/src/Terminals/UPA/Reponses/SafReportResponse.js +181 -0
- package/lib/src/Terminals/UPA/Reponses/SafReportResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/UpaEODResponse.d.ts +21 -0
- package/lib/src/Terminals/UPA/Reponses/UpaEODResponse.js +106 -0
- package/lib/src/Terminals/UPA/Reponses/UpaEODResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/UpaGiftCardResponse.d.ts +41 -0
- package/lib/src/Terminals/UPA/Reponses/UpaGiftCardResponse.js +93 -0
- package/lib/src/Terminals/UPA/Reponses/UpaGiftCardResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSAFResponse.d.ts +35 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSAFResponse.js +194 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSAFResponse.js.map +1 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSignatureResponse.d.ts +18 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSignatureResponse.js +94 -0
- package/lib/src/Terminals/UPA/Reponses/UpaSignatureResponse.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +15 -15
- package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +5 -5
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenPorticoCredentials.test.d.ts +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenPorticoCredentials.test.js +175 -0
- package/lib/test/Integration/Gateways/GpApiConnector/AccessTokenPorticoCredentials.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiCreateTokenWithPorticoCredentialTests.test.d.ts +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiCreateTokenWithPorticoCredentialTests.test.js +205 -0
- package/lib/test/Integration/Gateways/GpApiConnector/GpApiCreateTokenWithPorticoCredentialTests.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +4 -4
- package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +8 -8
- package/lib/test/Integration/Gateways/PorticoConnector/GlobalTransactionId.test.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/GlobalTransactionId.test.js +243 -0
- package/lib/test/Integration/Gateways/PorticoConnector/GlobalTransactionId.test.js.map +1 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/SupplementaryData.test.d.ts +1 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/SupplementaryData.test.js +147 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/SupplementaryData.test.js.map +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory1Methods.test.d.ts +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory1Methods.test.js +250 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory1Methods.test.js.map +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory2Methods.test.d.ts +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory2Methods.test.js +1277 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory2Methods.test.js.map +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory3_4Methods.test.d.ts +1 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory3_4Methods.test.js +411 -0
- package/lib/test/Unit/Terminals/UPA/UpaStory3_4Methods.test.js.map +1 -0
- package/package.json +63 -63
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ITerminalReport } from "../../../src";
|
|
2
|
+
import { BaseBuilder } from "../../Builders/BaseBuilder";
|
|
3
|
+
import { TerminalReportType } from "../Enums";
|
|
4
|
+
import { UpaSearchCriteria } from "../UPA/Entities/UpaSearchCriteria";
|
|
5
|
+
export declare class TerminalReportBuilder<T extends ITerminalReport = ITerminalReport> extends BaseBuilder<T> {
|
|
6
|
+
reportType: TerminalReportType;
|
|
7
|
+
ecrId?: string;
|
|
8
|
+
batch?: string;
|
|
9
|
+
reportOutput?: string;
|
|
10
|
+
constructor(reportType: TerminalReportType);
|
|
11
|
+
protected setupValidations(): void;
|
|
12
|
+
where(criteria: UpaSearchCriteria, value: unknown): this;
|
|
13
|
+
and(criteria: UpaSearchCriteria, value: unknown): this;
|
|
14
|
+
execute(configName?: string): Promise<T>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalReportBuilder = void 0;
|
|
4
|
+
const src_1 = require("../../../src");
|
|
5
|
+
const BaseBuilder_1 = require("../../Builders/BaseBuilder");
|
|
6
|
+
const UpaSearchCriteria_1 = require("../UPA/Entities/UpaSearchCriteria");
|
|
7
|
+
class TerminalReportBuilder extends BaseBuilder_1.BaseBuilder {
|
|
8
|
+
reportType;
|
|
9
|
+
ecrId;
|
|
10
|
+
batch;
|
|
11
|
+
reportOutput;
|
|
12
|
+
constructor(reportType) {
|
|
13
|
+
super();
|
|
14
|
+
this.reportType = reportType;
|
|
15
|
+
}
|
|
16
|
+
setupValidations() {
|
|
17
|
+
// UPA report requests do not currently require builder-level validation.
|
|
18
|
+
}
|
|
19
|
+
where(criteria, value) {
|
|
20
|
+
return this.and(criteria, value);
|
|
21
|
+
}
|
|
22
|
+
and(criteria, value) {
|
|
23
|
+
if (value === undefined || value === null) {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
switch (criteria) {
|
|
27
|
+
case UpaSearchCriteria_1.UpaSearchCriteria.EcrId:
|
|
28
|
+
this.ecrId = value.toString();
|
|
29
|
+
break;
|
|
30
|
+
case UpaSearchCriteria_1.UpaSearchCriteria.Batch:
|
|
31
|
+
this.batch = value.toString();
|
|
32
|
+
break;
|
|
33
|
+
case UpaSearchCriteria_1.UpaSearchCriteria.ReportOutput:
|
|
34
|
+
this.reportOutput = value.toString();
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
execute(configName = "default") {
|
|
42
|
+
super.execute();
|
|
43
|
+
return src_1.ServicesContainer.instance()
|
|
44
|
+
.getDeviceController(configName)
|
|
45
|
+
.processReport(this);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TerminalReportBuilder = TerminalReportBuilder;
|
|
49
|
+
//# sourceMappingURL=TerminalReportBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalReportBuilder.js","sourceRoot":"","sources":["../../../../src/Terminals/Builders/TerminalReportBuilder.ts"],"names":[],"mappings":";;;AAAA,sCAAkE;AAClE,4DAAyD;AAEzD,yEAAsE;AAEtE,MAAa,qBAEX,SAAQ,yBAAc;IACf,UAAU,CAAqB;IAC/B,KAAK,CAAU;IACf,KAAK,CAAU;IACf,YAAY,CAAU;IAE7B,YAAY,UAA8B;QACxC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAES,gBAAgB;QACxB,yEAAyE;IAC3E,CAAC;IAEM,KAAK,CAAC,QAA2B,EAAE,KAAc;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;IAEM,GAAG,CAAC,QAA2B,EAAE,KAAc;QACpD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;YACzC,OAAO,IAAI,CAAC;SACb;QAED,QAAQ,QAAQ,EAAE;YAChB,KAAK,qCAAiB,CAAC,KAAK;gBAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAC9B,MAAM;YACR,KAAK,qCAAiB,CAAC,KAAK;gBAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAC9B,MAAM;YACR,KAAK,qCAAiB,CAAC,YAAY;gBACjC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACrC,MAAM;YACR;gBACE,MAAM;SACT;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,OAAO,CAAC,aAAqB,SAAS;QAC3C,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,OAAO,uBAAiB,CAAC,QAAQ,EAAE;aAChC,mBAAmB,CAAC,UAAU,CAAC;aAC/B,aAAa,CAAC,IAAI,CAAe,CAAC;IACvC,CAAC;CACF;AAjDD,sDAiDC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TransactionType } from "../../../../src";
|
|
2
|
+
/**
|
|
3
|
+
* Bit-flag enum controlling which card acquisition methods the device presents.
|
|
4
|
+
* AcquisitionType.Contact | AcquisitionType.Swipe
|
|
5
|
+
*/
|
|
6
|
+
export declare enum AcquisitionType {
|
|
7
|
+
None = 0,
|
|
8
|
+
Contact = 1,
|
|
9
|
+
Contactless = 2,
|
|
10
|
+
Swipe = 4,
|
|
11
|
+
Manual = 8
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Bit-flag enum for filtering accepted card brands.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum CardTypeFilter {
|
|
17
|
+
None = 0,
|
|
18
|
+
VISA = 1,
|
|
19
|
+
MC = 2,
|
|
20
|
+
AMEX = 4,
|
|
21
|
+
DISCOVER = 8,
|
|
22
|
+
GIFT = 16
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* UI / acquisition configuration passed to startCardTransaction().
|
|
26
|
+
*/
|
|
27
|
+
export interface UpaParam {
|
|
28
|
+
/** Seconds to wait for card presentation. */
|
|
29
|
+
timeout?: number;
|
|
30
|
+
/** Bit-flag combination of AcquisitionType values. */
|
|
31
|
+
acquisitionTypes?: AcquisitionType;
|
|
32
|
+
/** Header text displayed on the device. */
|
|
33
|
+
header?: string;
|
|
34
|
+
/** "Yes" or "Y" to display total amount; "No" or "N" to hide. */
|
|
35
|
+
displayTotalAmount?: string;
|
|
36
|
+
/** Whether to prompt for manual entry password. */
|
|
37
|
+
promptForManual?: boolean;
|
|
38
|
+
brandIcon1?: number;
|
|
39
|
+
brandIcon2?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Chip / security processing settings for startCardTransaction().
|
|
43
|
+
*/
|
|
44
|
+
export interface UpaProcessingIndicator {
|
|
45
|
+
quickChip?: string;
|
|
46
|
+
checkLuhn?: string;
|
|
47
|
+
securityCode?: string;
|
|
48
|
+
/** Bit-flag combination of CardTypeFilter values. */
|
|
49
|
+
cardTypeFilter?: CardTypeFilter;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Transaction amounts and type for startCardTransaction().
|
|
53
|
+
*/
|
|
54
|
+
export interface UpaTransactionData {
|
|
55
|
+
totalAmount?: number;
|
|
56
|
+
cashBackAmount?: number;
|
|
57
|
+
/** Used for tranDate field (formatted MMddyyyy). */
|
|
58
|
+
tranDate?: Date;
|
|
59
|
+
/** Used for tranTime field (formatted HH:mm:ss). */
|
|
60
|
+
tranTime?: Date;
|
|
61
|
+
transType?: TransactionType;
|
|
62
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardTypeFilter = exports.AcquisitionType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Bit-flag enum controlling which card acquisition methods the device presents.
|
|
6
|
+
* AcquisitionType.Contact | AcquisitionType.Swipe
|
|
7
|
+
*/
|
|
8
|
+
var AcquisitionType;
|
|
9
|
+
(function (AcquisitionType) {
|
|
10
|
+
AcquisitionType[AcquisitionType["None"] = 0] = "None";
|
|
11
|
+
AcquisitionType[AcquisitionType["Contact"] = 1] = "Contact";
|
|
12
|
+
AcquisitionType[AcquisitionType["Contactless"] = 2] = "Contactless";
|
|
13
|
+
AcquisitionType[AcquisitionType["Swipe"] = 4] = "Swipe";
|
|
14
|
+
AcquisitionType[AcquisitionType["Manual"] = 8] = "Manual";
|
|
15
|
+
})(AcquisitionType || (exports.AcquisitionType = AcquisitionType = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Bit-flag enum for filtering accepted card brands.
|
|
18
|
+
*/
|
|
19
|
+
var CardTypeFilter;
|
|
20
|
+
(function (CardTypeFilter) {
|
|
21
|
+
CardTypeFilter[CardTypeFilter["None"] = 0] = "None";
|
|
22
|
+
CardTypeFilter[CardTypeFilter["VISA"] = 1] = "VISA";
|
|
23
|
+
CardTypeFilter[CardTypeFilter["MC"] = 2] = "MC";
|
|
24
|
+
CardTypeFilter[CardTypeFilter["AMEX"] = 4] = "AMEX";
|
|
25
|
+
CardTypeFilter[CardTypeFilter["DISCOVER"] = 8] = "DISCOVER";
|
|
26
|
+
CardTypeFilter[CardTypeFilter["GIFT"] = 16] = "GIFT";
|
|
27
|
+
})(CardTypeFilter || (exports.CardTypeFilter = CardTypeFilter = {}));
|
|
28
|
+
//# sourceMappingURL=UpaModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpaModels.js","sourceRoot":"","sources":["../../../../../src/Terminals/UPA/Entities/UpaModels.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,2DAAgB,CAAA;IAChB,mEAAoB,CAAA;IACpB,uDAAc,CAAA;IACd,yDAAe,CAAA;AACjB,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED;;GAEG;AACH,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,mDAAQ,CAAA;IACR,mDAAa,CAAA;IACb,+CAAW,CAAA;IACX,mDAAa,CAAA;IACb,2DAAiB,CAAA;IACjB,oDAAa,CAAA;AACf,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpaSearchCriteria = void 0;
|
|
4
|
+
var UpaSearchCriteria;
|
|
5
|
+
(function (UpaSearchCriteria) {
|
|
6
|
+
UpaSearchCriteria["EcrId"] = "EcrId";
|
|
7
|
+
UpaSearchCriteria["Batch"] = "Batch";
|
|
8
|
+
UpaSearchCriteria["ReportOutput"] = "ReportOutput";
|
|
9
|
+
})(UpaSearchCriteria || (exports.UpaSearchCriteria = UpaSearchCriteria = {}));
|
|
10
|
+
//# sourceMappingURL=UpaSearchCriteria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpaSearchCriteria.js","sourceRoot":"","sources":["../../../../../src/Terminals/UPA/Entities/UpaSearchCriteria.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,oCAAe,CAAA;IACf,kDAA6B,CAAA;AAC/B,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ITerminalReport } from "../../../../src";
|
|
2
|
+
export declare class BatchList implements ITerminalReport {
|
|
3
|
+
status: string;
|
|
4
|
+
command: string;
|
|
5
|
+
version: string;
|
|
6
|
+
deviceResponseCode: string;
|
|
7
|
+
deviceResponseText: string;
|
|
8
|
+
referenceNumber: string;
|
|
9
|
+
ecrId: string;
|
|
10
|
+
batches: number[];
|
|
11
|
+
constructor(jsonResponse: any);
|
|
12
|
+
private isGpApiResponse;
|
|
13
|
+
private extractVersion;
|
|
14
|
+
private extractReferenceNumber;
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BatchList = void 0;
|
|
4
|
+
const src_1 = require("../../../../src");
|
|
5
|
+
class BatchList {
|
|
6
|
+
status = "";
|
|
7
|
+
command = "";
|
|
8
|
+
version = "";
|
|
9
|
+
deviceResponseCode = "";
|
|
10
|
+
deviceResponseText = "";
|
|
11
|
+
referenceNumber = "";
|
|
12
|
+
ecrId = "";
|
|
13
|
+
batches = [];
|
|
14
|
+
constructor(jsonResponse) {
|
|
15
|
+
if (typeof jsonResponse === "string") {
|
|
16
|
+
try {
|
|
17
|
+
jsonResponse = JSON.parse(jsonResponse);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
throw new src_1.NotImplementedError("Invalid JSON string");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.version = this.extractVersion(jsonResponse);
|
|
24
|
+
this.referenceNumber = this.extractReferenceNumber(jsonResponse);
|
|
25
|
+
if (this.isGpApiResponse(jsonResponse)) {
|
|
26
|
+
this.deviceResponseText = jsonResponse.status;
|
|
27
|
+
this.deviceResponseCode = jsonResponse.action?.result_code || "";
|
|
28
|
+
}
|
|
29
|
+
const data = this.isGpApiResponse(jsonResponse)
|
|
30
|
+
? jsonResponse?.response
|
|
31
|
+
: jsonResponse?.data;
|
|
32
|
+
const cmdResult = data?.cmdResult;
|
|
33
|
+
if (!data || !cmdResult) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.status = cmdResult.result ?? "";
|
|
37
|
+
this.command = data.response ?? "";
|
|
38
|
+
this.ecrId = data.ecrId ?? data.EcrId ?? "";
|
|
39
|
+
this.deviceResponseCode =
|
|
40
|
+
cmdResult.errorCode ?? this.deviceResponseCode ?? "00";
|
|
41
|
+
if (this.status === "Success") {
|
|
42
|
+
this.deviceResponseText = this.status;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.deviceResponseText = `Error: ${cmdResult.errorCode ?? ""} - ${cmdResult.errorMessage ?? ""}`;
|
|
46
|
+
}
|
|
47
|
+
if (this.status !== "Success") {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const availableBatches = data.data?.batchesAvail;
|
|
51
|
+
if (Array.isArray(availableBatches)) {
|
|
52
|
+
this.batches = availableBatches
|
|
53
|
+
.map((batch) => Number(batch.batchId))
|
|
54
|
+
.filter((batchId) => !Number.isNaN(batchId));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
isGpApiResponse(jsonResponse) {
|
|
58
|
+
return !!(jsonResponse?.provider && jsonResponse.provider === src_1.GatewayProvider.GpApi);
|
|
59
|
+
}
|
|
60
|
+
extractVersion(jsonResponse) {
|
|
61
|
+
return (jsonResponse?.version ??
|
|
62
|
+
jsonResponse?.response?.version ??
|
|
63
|
+
jsonResponse?.data?.version ??
|
|
64
|
+
jsonResponse?.data?.data?.version ??
|
|
65
|
+
"");
|
|
66
|
+
}
|
|
67
|
+
extractReferenceNumber(jsonResponse) {
|
|
68
|
+
return (jsonResponse?.referenceNumber ??
|
|
69
|
+
jsonResponse?.response?.referenceNumber ??
|
|
70
|
+
jsonResponse?.response?.data?.referenceNumber ??
|
|
71
|
+
jsonResponse?.response?.data?.host?.referenceNumber ??
|
|
72
|
+
jsonResponse?.data?.referenceNumber ??
|
|
73
|
+
jsonResponse?.data?.data?.referenceNumber ??
|
|
74
|
+
jsonResponse?.data?.data?.host?.referenceNumber ??
|
|
75
|
+
"");
|
|
76
|
+
}
|
|
77
|
+
toString() {
|
|
78
|
+
return JSON.stringify(this);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.BatchList = BatchList;
|
|
82
|
+
//# sourceMappingURL=BatchList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchList.js","sourceRoot":"","sources":["../../../../../src/Terminals/UPA/Reponses/BatchList.ts"],"names":[],"mappings":";;;AAAA,yCAIyB;AAEzB,MAAa,SAAS;IACb,MAAM,GAAG,EAAE,CAAC;IACZ,OAAO,GAAG,EAAE,CAAC;IACb,OAAO,GAAG,EAAE,CAAC;IACb,kBAAkB,GAAG,EAAE,CAAC;IACxB,kBAAkB,GAAG,EAAE,CAAC;IACxB,eAAe,GAAG,EAAE,CAAC;IACrB,KAAK,GAAG,EAAE,CAAC;IACX,OAAO,GAAa,EAAE,CAAC;IAE9B,YAAY,YAAiB;QAC3B,IAAI,OAAO,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,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe;YAC/C,EAAE,CACH,CAAC;IACJ,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF;AA5FD,8BA4FC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ITerminalReport, TransactionSummary } from "../../../../src";
|
|
2
|
+
export declare class BatchTransactionResponse {
|
|
3
|
+
cardType: string;
|
|
4
|
+
totalAmount?: number;
|
|
5
|
+
totalCnt?: number;
|
|
6
|
+
creditCnt?: number;
|
|
7
|
+
creditAmt?: number;
|
|
8
|
+
debitCnt?: number;
|
|
9
|
+
debitAmt?: number;
|
|
10
|
+
saleCnt?: number;
|
|
11
|
+
saleAmt?: number;
|
|
12
|
+
returnCnt?: number;
|
|
13
|
+
returnAmt?: number;
|
|
14
|
+
totalGratuityAmt?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class BatchRecordResponse {
|
|
17
|
+
batchId?: number;
|
|
18
|
+
batchSeqNbr?: number;
|
|
19
|
+
batchStatus: string;
|
|
20
|
+
openUtcDateTime: string;
|
|
21
|
+
closeUtcDateTime: string;
|
|
22
|
+
openTnxId: string;
|
|
23
|
+
totalAmount?: number;
|
|
24
|
+
totalCnt?: number;
|
|
25
|
+
creditCnt?: number;
|
|
26
|
+
creditAmt?: number;
|
|
27
|
+
debitCnt?: number;
|
|
28
|
+
debitAmt?: number;
|
|
29
|
+
saleCnt?: number;
|
|
30
|
+
saleAmt?: number;
|
|
31
|
+
returnCnt?: number;
|
|
32
|
+
returnAmt?: number;
|
|
33
|
+
totalGratuityAmt?: number;
|
|
34
|
+
batchTransactions: BatchTransactionResponse[];
|
|
35
|
+
transactionDetails: TransactionSummary[];
|
|
36
|
+
}
|
|
37
|
+
export declare class BatchReportResponse implements ITerminalReport {
|
|
38
|
+
status: string;
|
|
39
|
+
command: string;
|
|
40
|
+
version: string;
|
|
41
|
+
deviceResponseCode: string;
|
|
42
|
+
deviceResponseText: string;
|
|
43
|
+
referenceNumber: string;
|
|
44
|
+
multipleMessage: string;
|
|
45
|
+
merchantName: string;
|
|
46
|
+
batchRecord?: BatchRecordResponse;
|
|
47
|
+
constructor(jsonResponse: any);
|
|
48
|
+
private mapTransactionSummary;
|
|
49
|
+
private toDate;
|
|
50
|
+
private toNumber;
|
|
51
|
+
private isGpApiResponse;
|
|
52
|
+
private extractVersion;
|
|
53
|
+
private extractReferenceNumber;
|
|
54
|
+
toString(): string;
|
|
55
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BatchReportResponse = exports.BatchRecordResponse = exports.BatchTransactionResponse = void 0;
|
|
4
|
+
const src_1 = require("../../../../src");
|
|
5
|
+
const UpaMessageId_1 = require("../Entities/UpaMessageId");
|
|
6
|
+
class BatchTransactionResponse {
|
|
7
|
+
cardType = "";
|
|
8
|
+
totalAmount;
|
|
9
|
+
totalCnt;
|
|
10
|
+
creditCnt;
|
|
11
|
+
creditAmt;
|
|
12
|
+
debitCnt;
|
|
13
|
+
debitAmt;
|
|
14
|
+
saleCnt;
|
|
15
|
+
saleAmt;
|
|
16
|
+
returnCnt;
|
|
17
|
+
returnAmt;
|
|
18
|
+
totalGratuityAmt;
|
|
19
|
+
}
|
|
20
|
+
exports.BatchTransactionResponse = BatchTransactionResponse;
|
|
21
|
+
class BatchRecordResponse {
|
|
22
|
+
batchId;
|
|
23
|
+
batchSeqNbr;
|
|
24
|
+
batchStatus = "";
|
|
25
|
+
openUtcDateTime = "";
|
|
26
|
+
closeUtcDateTime = "";
|
|
27
|
+
openTnxId = "";
|
|
28
|
+
totalAmount;
|
|
29
|
+
totalCnt;
|
|
30
|
+
creditCnt;
|
|
31
|
+
creditAmt;
|
|
32
|
+
debitCnt;
|
|
33
|
+
debitAmt;
|
|
34
|
+
saleCnt;
|
|
35
|
+
saleAmt;
|
|
36
|
+
returnCnt;
|
|
37
|
+
returnAmt;
|
|
38
|
+
totalGratuityAmt;
|
|
39
|
+
batchTransactions = [];
|
|
40
|
+
transactionDetails = [];
|
|
41
|
+
}
|
|
42
|
+
exports.BatchRecordResponse = BatchRecordResponse;
|
|
43
|
+
class BatchReportResponse {
|
|
44
|
+
status = "";
|
|
45
|
+
command = "";
|
|
46
|
+
version = "";
|
|
47
|
+
deviceResponseCode = "";
|
|
48
|
+
deviceResponseText = "";
|
|
49
|
+
referenceNumber = "";
|
|
50
|
+
multipleMessage = "";
|
|
51
|
+
merchantName = "";
|
|
52
|
+
batchRecord;
|
|
53
|
+
constructor(jsonResponse) {
|
|
54
|
+
if (typeof jsonResponse === "string") {
|
|
55
|
+
try {
|
|
56
|
+
jsonResponse = JSON.parse(jsonResponse);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
throw new src_1.NotImplementedError("Invalid JSON string");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
this.version = this.extractVersion(jsonResponse);
|
|
63
|
+
this.referenceNumber = this.extractReferenceNumber(jsonResponse);
|
|
64
|
+
if (this.isGpApiResponse(jsonResponse)) {
|
|
65
|
+
this.deviceResponseText = jsonResponse.status;
|
|
66
|
+
this.deviceResponseCode = jsonResponse.action?.result_code || "";
|
|
67
|
+
}
|
|
68
|
+
const data = this.isGpApiResponse(jsonResponse)
|
|
69
|
+
? jsonResponse?.response
|
|
70
|
+
: jsonResponse?.data;
|
|
71
|
+
const cmdResult = data?.cmdResult;
|
|
72
|
+
if (!data || !cmdResult) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.status = cmdResult.result ?? "";
|
|
76
|
+
this.command = data.response ?? "";
|
|
77
|
+
this.deviceResponseCode =
|
|
78
|
+
cmdResult.errorCode ?? this.deviceResponseCode ?? "00";
|
|
79
|
+
if (this.status === "Success") {
|
|
80
|
+
this.deviceResponseText = this.status;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.deviceResponseText = `Error: ${cmdResult.errorCode ?? ""} - ${cmdResult.errorMessage ?? ""}`;
|
|
84
|
+
}
|
|
85
|
+
if (this.status !== "Success") {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const reportData = data.data;
|
|
89
|
+
if (!reportData) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.merchantName = reportData.merchantName ?? "";
|
|
93
|
+
this.multipleMessage = reportData.multipleMessage ?? "";
|
|
94
|
+
const batchRecord = reportData.batchRecord;
|
|
95
|
+
if (!batchRecord) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.batchRecord = {
|
|
99
|
+
batchId: this.toNumber(batchRecord.batchId),
|
|
100
|
+
batchSeqNbr: this.toNumber(batchRecord.batchSeqNbr),
|
|
101
|
+
batchStatus: batchRecord.batchStatus,
|
|
102
|
+
openUtcDateTime: batchRecord.openUtcDateTime,
|
|
103
|
+
closeUtcDateTime: batchRecord.closeUtcDateTime,
|
|
104
|
+
openTnxId: batchRecord.openTnxId,
|
|
105
|
+
totalAmount: this.toNumber(batchRecord.totalAmount),
|
|
106
|
+
totalCnt: this.toNumber(batchRecord.totalCnt),
|
|
107
|
+
creditCnt: this.toNumber(batchRecord.creditCnt ?? batchRecord.credictCnt),
|
|
108
|
+
creditAmt: this.toNumber(batchRecord.creditAmt),
|
|
109
|
+
debitCnt: this.toNumber(batchRecord.debitCnt),
|
|
110
|
+
debitAmt: this.toNumber(batchRecord.debitAmt),
|
|
111
|
+
saleCnt: this.toNumber(batchRecord.saleCnt),
|
|
112
|
+
saleAmt: this.toNumber(batchRecord.saleAmt),
|
|
113
|
+
returnCnt: this.toNumber(batchRecord.returnCnt),
|
|
114
|
+
returnAmt: this.toNumber(batchRecord.returnAmt),
|
|
115
|
+
totalGratuityAmt: this.toNumber(batchRecord.totalGratuityAmt),
|
|
116
|
+
batchTransactions: [],
|
|
117
|
+
transactionDetails: [],
|
|
118
|
+
};
|
|
119
|
+
if (this.command === UpaMessageId_1.UpaMessageId.GET_BATCH_REPORT) {
|
|
120
|
+
if (Array.isArray(batchRecord.batchTransactions)) {
|
|
121
|
+
this.batchRecord.batchTransactions = batchRecord.batchTransactions.map((transaction) => ({
|
|
122
|
+
cardType: transaction.cardType,
|
|
123
|
+
totalAmount: this.toNumber(transaction.totalAmount),
|
|
124
|
+
totalCnt: this.toNumber(transaction.totalCnt),
|
|
125
|
+
creditCnt: this.toNumber(transaction.creditCnt),
|
|
126
|
+
creditAmt: this.toNumber(transaction.creditAmt),
|
|
127
|
+
debitCnt: this.toNumber(transaction.debitCnt),
|
|
128
|
+
debitAmt: this.toNumber(transaction.debitAmt),
|
|
129
|
+
saleCnt: this.toNumber(transaction.saleCnt),
|
|
130
|
+
saleAmt: this.toNumber(transaction.saleAmt),
|
|
131
|
+
returnCnt: this.toNumber(transaction.returnCnt),
|
|
132
|
+
returnAmt: this.toNumber(transaction.returnAmt),
|
|
133
|
+
totalGratuityAmt: this.toNumber(transaction.totalGratuityAmt),
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.batchRecord.batchTransactions = [];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (this.command === UpaMessageId_1.UpaMessageId.GET_BATCH_DETAILS) {
|
|
141
|
+
if (Array.isArray(batchRecord.batchDetailRecords)) {
|
|
142
|
+
this.batchRecord.transactionDetails =
|
|
143
|
+
batchRecord.batchDetailRecords.map((transaction) => this.mapTransactionSummary(transaction));
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.batchRecord.transactionDetails = [];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
mapTransactionSummary(transaction) {
|
|
151
|
+
const summary = new src_1.TransactionSummary();
|
|
152
|
+
const transactionDate = this.toDate(transaction.transactionTime);
|
|
153
|
+
if (transactionDate) {
|
|
154
|
+
summary.transactionDate = transactionDate;
|
|
155
|
+
}
|
|
156
|
+
summary.authCode = transaction.approvalCode;
|
|
157
|
+
summary.authorizedAmount = transaction.authorizedAmount;
|
|
158
|
+
summary.cardType = transaction.cardType;
|
|
159
|
+
summary.maskedCardNumber = transaction.maskedPAN ?? transaction.maskedPan;
|
|
160
|
+
summary.referenceNumber = transaction.referenceNumber;
|
|
161
|
+
summary.issuerTransactionId = transaction.gatewayTxnId;
|
|
162
|
+
summary.clerkId = transaction.clerkId;
|
|
163
|
+
summary.amount = transaction.requestedAmount;
|
|
164
|
+
summary.gatewayResponseCode = transaction.responseCode;
|
|
165
|
+
summary.gatewayResponseMessage = transaction.responseText;
|
|
166
|
+
summary.transactionStatus = transaction.transactionStatus;
|
|
167
|
+
summary.transactionType = transaction.transactionType;
|
|
168
|
+
summary.gratuityAmount = transaction.tipAmount;
|
|
169
|
+
summary.settlementAmount = transaction.settleAmount;
|
|
170
|
+
summary.taxAmount = transaction.taxAmount;
|
|
171
|
+
summary.cardSwiped = transaction.cardSwiped;
|
|
172
|
+
return summary;
|
|
173
|
+
}
|
|
174
|
+
toDate(value) {
|
|
175
|
+
if (!value) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
const date = new Date(value);
|
|
179
|
+
return Number.isNaN(date.getTime()) ? undefined : date;
|
|
180
|
+
}
|
|
181
|
+
toNumber(value) {
|
|
182
|
+
if (value === undefined || value === null || value === "") {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
const parsed = Number(value);
|
|
186
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
187
|
+
}
|
|
188
|
+
isGpApiResponse(jsonResponse) {
|
|
189
|
+
return !!(jsonResponse?.provider && jsonResponse.provider === src_1.GatewayProvider.GpApi);
|
|
190
|
+
}
|
|
191
|
+
extractVersion(jsonResponse) {
|
|
192
|
+
return (jsonResponse?.version ??
|
|
193
|
+
jsonResponse?.response?.version ??
|
|
194
|
+
jsonResponse?.data?.version ??
|
|
195
|
+
jsonResponse?.data?.data?.version ??
|
|
196
|
+
"");
|
|
197
|
+
}
|
|
198
|
+
extractReferenceNumber(jsonResponse) {
|
|
199
|
+
return (jsonResponse?.referenceNumber ??
|
|
200
|
+
jsonResponse?.response?.referenceNumber ??
|
|
201
|
+
jsonResponse?.response?.data?.referenceNumber ??
|
|
202
|
+
jsonResponse?.response?.data?.host?.referenceNumber ??
|
|
203
|
+
jsonResponse?.data?.referenceNumber ??
|
|
204
|
+
jsonResponse?.data?.data?.referenceNumber ??
|
|
205
|
+
jsonResponse?.data?.data?.host?.referenceNumber ??
|
|
206
|
+
"");
|
|
207
|
+
}
|
|
208
|
+
toString() {
|
|
209
|
+
return JSON.stringify(this);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.BatchReportResponse = BatchReportResponse;
|
|
213
|
+
//# sourceMappingURL=BatchReportResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchReportResponse.js","sourceRoot":"","sources":["../../../../../src/Terminals/UPA/Reponses/BatchReportResponse.ts"],"names":[],"mappings":";;;AAAA,yCAKyB;AACzB,2DAAwD;AAExD,MAAa,wBAAwB;IAC5B,QAAQ,GAAG,EAAE,CAAC;IACd,WAAW,CAAU;IACrB,QAAQ,CAAU;IAClB,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,QAAQ,CAAU;IAClB,QAAQ,CAAU;IAClB,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,gBAAgB,CAAU;CAClC;AAbD,4DAaC;AAED,MAAa,mBAAmB;IACvB,OAAO,CAAU;IACjB,WAAW,CAAU;IACrB,WAAW,GAAG,EAAE,CAAC;IACjB,eAAe,GAAG,EAAE,CAAC;IACrB,gBAAgB,GAAG,EAAE,CAAC;IACtB,SAAS,GAAG,EAAE,CAAC;IACf,WAAW,CAAU;IACrB,QAAQ,CAAU;IAClB,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,QAAQ,CAAU;IAClB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YAC/C,EAAE,CACH,CAAC;IACJ,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF;AAxMD,kDAwMC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ITerminalReport } from "../../../../src";
|
|
2
|
+
export declare class OpenTab {
|
|
3
|
+
authorizedAmount?: number;
|
|
4
|
+
cardType: string;
|
|
5
|
+
maskedPan: string;
|
|
6
|
+
transactionId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class OpenTabDetailsResponse implements ITerminalReport {
|
|
9
|
+
status: string;
|
|
10
|
+
command: string;
|
|
11
|
+
version: string;
|
|
12
|
+
deviceResponseCode: string;
|
|
13
|
+
deviceResponseText: string;
|
|
14
|
+
referenceNumber: string;
|
|
15
|
+
multipleMessage: string;
|
|
16
|
+
merchantName: string;
|
|
17
|
+
ecrId: string;
|
|
18
|
+
openTabs: OpenTab[];
|
|
19
|
+
constructor(jsonResponse: any);
|
|
20
|
+
private toNumber;
|
|
21
|
+
private isGpApiResponse;
|
|
22
|
+
private extractVersion;
|
|
23
|
+
private extractReferenceNumber;
|
|
24
|
+
toString(): string;
|
|
25
|
+
}
|