globalpayments-api 1.4.3 → 1.4.6
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/lib/src/Entities/Transaction.d.ts +2 -0
- package/lib/src/Entities/TransactionSummary.d.ts +42 -2
- package/lib/src/Gateways/PorticoConnector.js +47 -3
- package/lib/src/ServicesContainer.js +1 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +3 -1
- package/package.json +2 -2
|
@@ -23,6 +23,8 @@ export declare class Transaction {
|
|
|
23
23
|
giftCard: GiftCard;
|
|
24
24
|
clientTransactionId: string;
|
|
25
25
|
timestamp: string;
|
|
26
|
+
batchId: string;
|
|
27
|
+
batchSeqNbr: string;
|
|
26
28
|
get transactionId(): string;
|
|
27
29
|
static fromId(transactionId: string, orderId?: string | PaymentMethodType, paymentMethodType?: PaymentMethodType): Transaction;
|
|
28
30
|
/**
|
|
@@ -1,21 +1,61 @@
|
|
|
1
1
|
export declare class TransactionSummary {
|
|
2
|
+
accountDataSource: string;
|
|
2
3
|
amount: string;
|
|
3
4
|
authCode: string;
|
|
4
5
|
authorizedAmount: string;
|
|
6
|
+
batchCloseDate: Date;
|
|
7
|
+
batchSequenceNumber: string;
|
|
8
|
+
cardSwiped: string;
|
|
9
|
+
cardType: string;
|
|
10
|
+
clerkId: string;
|
|
5
11
|
clientTransactionId: string;
|
|
6
12
|
convenienceAmt: string;
|
|
7
13
|
deviceId: string;
|
|
8
14
|
issuerResponseCode: string;
|
|
9
15
|
issuerResponseMessage: string;
|
|
10
|
-
|
|
11
|
-
originalTransactionId: string;
|
|
16
|
+
issuerTransactionId: string;
|
|
12
17
|
gatewayResponseCode: string;
|
|
13
18
|
gatewayResponseMessage: string;
|
|
19
|
+
gratuityAmount: string;
|
|
20
|
+
maskedCardNumber: string;
|
|
21
|
+
originalTransactionId: string;
|
|
22
|
+
paymentType: string;
|
|
23
|
+
poNumber: string;
|
|
14
24
|
referenceNumber: string;
|
|
25
|
+
responseDate: Date;
|
|
15
26
|
serviceName: string;
|
|
16
27
|
settlementAmount: string;
|
|
17
28
|
shippingAmt: string;
|
|
29
|
+
siteTrace: string;
|
|
18
30
|
status: string;
|
|
31
|
+
taxAmount: string;
|
|
32
|
+
taxType: string;
|
|
19
33
|
transactionDate: Date;
|
|
20
34
|
transactionId: string;
|
|
35
|
+
username: string;
|
|
36
|
+
description: string;
|
|
37
|
+
invoiceNumber: string;
|
|
38
|
+
customerId: string;
|
|
39
|
+
uniqueDeviceId: string;
|
|
40
|
+
transactionDescriptor: string;
|
|
41
|
+
giftCurrency: string;
|
|
42
|
+
maskedAlias: string;
|
|
43
|
+
paymentMethodKey: string;
|
|
44
|
+
scheduleId: string;
|
|
45
|
+
oneTimePayment: string;
|
|
46
|
+
recurringDataCode: string;
|
|
47
|
+
surchargeAmount: string;
|
|
48
|
+
fraudRuleInfo: string;
|
|
49
|
+
repeatCount: string;
|
|
50
|
+
emvChipCondition: string;
|
|
51
|
+
hasEmvTags: string;
|
|
52
|
+
hasEcomPaymentData: string;
|
|
53
|
+
cavvResponseCode: string;
|
|
54
|
+
tokenPanLastFour: string;
|
|
55
|
+
companyName: string;
|
|
56
|
+
customerFirstName: string;
|
|
57
|
+
customerLastName: string;
|
|
58
|
+
debtRepaymentIndicator: string;
|
|
59
|
+
captureAmount: string;
|
|
60
|
+
fullyCaptured: string;
|
|
21
61
|
}
|
|
@@ -670,6 +670,10 @@ var PorticoConnector = /** @class */ (function (_super) {
|
|
|
670
670
|
result.giftCard.alias = cardData.findtext(".//Alias");
|
|
671
671
|
result.giftCard.pin = cardData.findtext(".//PIN");
|
|
672
672
|
}
|
|
673
|
+
if (root.find(".//BatchId")) {
|
|
674
|
+
result.batchId = root.findtext(".//BatchId");
|
|
675
|
+
result.batchSeqNbr = root.findtext(".//BatchSeqNbr");
|
|
676
|
+
}
|
|
673
677
|
return result;
|
|
674
678
|
};
|
|
675
679
|
PorticoConnector.prototype.mapReportResponse = function (rawResponse, builder) {
|
|
@@ -907,25 +911,65 @@ var PorticoConnector = /** @class */ (function (_super) {
|
|
|
907
911
|
};
|
|
908
912
|
PorticoConnector.prototype.hydrateTransactionSummary = function (root) {
|
|
909
913
|
var result = new __1.TransactionSummary();
|
|
914
|
+
result.accountDataSource = root.findtext(".//AcctDataSrc");
|
|
910
915
|
result.amount = root.findtext(".//Amt");
|
|
911
916
|
result.authorizedAmount = root.findtext(".//AuthAmt");
|
|
912
917
|
result.authCode = root.findtext(".//AuthCode");
|
|
918
|
+
result.batchCloseDate = new Date(root.findtext(".//BatchCloseDT"));
|
|
919
|
+
result.batchSequenceNumber = root.findtext(".//BatchSeqNbr");
|
|
920
|
+
result.cardSwiped = root.findtext(".//CardSwiped");
|
|
921
|
+
result.cardType = root.findtext(".//CardType");
|
|
922
|
+
result.clerkId = root.findtext(".//ClerkID");
|
|
913
923
|
result.clientTransactionId = root.findtext(".//ClientTxnId");
|
|
924
|
+
result.convenienceAmt = root.findtext(".//ConvenienceAmtInfo");
|
|
914
925
|
result.deviceId = root.findtext(".//DeviceId");
|
|
926
|
+
result.gratuityAmount = root.findtext(".//GratuityAmtInfo");
|
|
915
927
|
result.issuerResponseCode = this.normalizeResponse(root.findtext(".//IssuerRspCode"));
|
|
916
928
|
result.issuerResponseMessage = root.findtext(".//IssuerRspText");
|
|
929
|
+
result.issuerTransactionId = root.findtext(".//IssTxnId");
|
|
917
930
|
result.maskedCardNumber = root.findtext(".//MaskedCardNbr");
|
|
918
|
-
result.originalTransactionId = root.findtext(".//OriginalGatewayTxnId");
|
|
919
931
|
result.gatewayResponseCode = this.normalizeResponse(root.findtext(".//GatewayRspCode"));
|
|
920
932
|
result.gatewayResponseMessage = root.findtext(".//GatewayRspMsg");
|
|
933
|
+
result.originalTransactionId = root.findtext(".//OriginalGatewayTxnId");
|
|
934
|
+
result.paymentType = root.findtext(".//PaymentType");
|
|
935
|
+
result.poNumber = root.findtext(".//CardHolderPONbr");
|
|
921
936
|
result.referenceNumber = root.findtext(".//RefNbr");
|
|
937
|
+
result.responseDate = new Date(root.findtext(".//RspDT"));
|
|
922
938
|
result.serviceName = root.findtext(".//ServiceName");
|
|
923
939
|
result.settlementAmount = root.findtext(".//SettlementAmt");
|
|
940
|
+
result.shippingAmt = root.findtext(".//ShippingAmtInfo");
|
|
941
|
+
result.siteTrace = root.findtext(".//SiteTrace");
|
|
924
942
|
result.status = root.findtext(".//TxnStatus");
|
|
943
|
+
result.taxAmount = root.findtext(".//TaxAmtInfo");
|
|
944
|
+
result.taxType = root.findtext(".//TaxType");
|
|
925
945
|
result.transactionDate = new Date(root.findtext(".//TxnUtcDT"));
|
|
926
946
|
result.transactionId = root.findtext(".//GatewayTxnId");
|
|
927
|
-
result.
|
|
928
|
-
result.
|
|
947
|
+
result.username = root.findtext(".//UserName");
|
|
948
|
+
result.description = root.findtext(".//Description");
|
|
949
|
+
result.invoiceNumber = root.findtext(".//InvoiceNbr");
|
|
950
|
+
result.customerId = root.findtext(".//CustomerID");
|
|
951
|
+
result.uniqueDeviceId = root.findtext(".//UniqueDeviceId");
|
|
952
|
+
result.transactionDescriptor = root.findtext(".//TxnDescriptor");
|
|
953
|
+
result.giftCurrency = root.findtext(".//GiftCurrency");
|
|
954
|
+
result.maskedAlias = root.findtext(".//GiftMaskedAlias");
|
|
955
|
+
result.paymentMethodKey = root.findtext(".//PaymentMethodKey");
|
|
956
|
+
result.scheduleId = root.findtext(".//ScheduleID");
|
|
957
|
+
result.oneTimePayment = root.findtext(".//OneTime");
|
|
958
|
+
result.recurringDataCode = root.findtext(".//RecurringDataCode");
|
|
959
|
+
result.surchargeAmount = root.findtext(".//SurchargeAmtInfo");
|
|
960
|
+
result.fraudRuleInfo = root.findtext(".//FraudInfoRule");
|
|
961
|
+
result.repeatCount = root.findtext(".//RepeatCount");
|
|
962
|
+
result.emvChipCondition = root.findtext(".//EMVChipCondition");
|
|
963
|
+
result.hasEmvTags = root.findtext(".//HasEMVTag");
|
|
964
|
+
result.hasEcomPaymentData = root.findtext(".//HasEComPaymentData");
|
|
965
|
+
result.cavvResponseCode = root.findtext(".//CAVVResultCode");
|
|
966
|
+
result.tokenPanLastFour = root.findtext(".//TokenPANLast4");
|
|
967
|
+
result.companyName = root.findtext(".//Company");
|
|
968
|
+
result.customerFirstName = root.findtext(".//CustomerFirstname");
|
|
969
|
+
result.customerLastName = root.findtext(".//CustomerLastname");
|
|
970
|
+
result.debtRepaymentIndicator = root.findtext(".//DebtRepaymentIndicator");
|
|
971
|
+
result.captureAmount = root.findtext(".//CaptureAmtInfo");
|
|
972
|
+
result.fullyCaptured = root.findtext(".//FullyCapturedInd");
|
|
929
973
|
return result;
|
|
930
974
|
};
|
|
931
975
|
PorticoConnector.prototype.shouldIncludeCredentialOnFile = function (builder) {
|
|
@@ -57,7 +57,7 @@ var ServicesContainer = /** @class */ (function () {
|
|
|
57
57
|
payplan.versionNumber = config.versionNumber;
|
|
58
58
|
payplan.timeout = config.timeout;
|
|
59
59
|
payplan.serviceUrl = config.serviceUrl
|
|
60
|
-
+ (config.serviceUrl.
|
|
60
|
+
+ (config.serviceUrl.includes('cert.') ? "/Portico.PayPlan.v2/" : "/payplan.v2/");
|
|
61
61
|
ServicesContainer._instance = new ServicesContainer(gateway, payplan);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
@@ -53,7 +53,7 @@ test("ecom with moto", function (t) { return __awaiter(void 0, void 0, void 0, f
|
|
|
53
53
|
return __generator(this, function (_a) {
|
|
54
54
|
switch (_a.label) {
|
|
55
55
|
case 0:
|
|
56
|
-
t.plan(
|
|
56
|
+
t.plan(4);
|
|
57
57
|
ecom = new src_1.EcommerceInfo();
|
|
58
58
|
ecom.channel = src_1.EcommerceChannel.Moto;
|
|
59
59
|
return [4 /*yield*/, card
|
|
@@ -66,6 +66,8 @@ test("ecom with moto", function (t) { return __awaiter(void 0, void 0, void 0, f
|
|
|
66
66
|
response = _a.sent();
|
|
67
67
|
t.truthy(response);
|
|
68
68
|
t.is(response.responseCode, "00");
|
|
69
|
+
t.truthy(response.batchId);
|
|
70
|
+
t.truthy(response.batchSeqNbr);
|
|
69
71
|
return [2 /*return*/];
|
|
70
72
|
}
|
|
71
73
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "globalpayments-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "Global Payments SDK for NodeJS for Heartland and Global Payments eCommerce gateways",
|
|
5
5
|
"author": "Heartland Payment Systems",
|
|
6
6
|
"license": "GPL-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prettier": "^1.18.2",
|
|
39
39
|
"rimraf": "^2.6.3",
|
|
40
40
|
"tslint": "^4.5.1",
|
|
41
|
-
"typedoc": "^0.
|
|
41
|
+
"typedoc": "^0.22.13",
|
|
42
42
|
"typescript": "4.2.3",
|
|
43
43
|
"webpack": "^3.12.0"
|
|
44
44
|
},
|