connect-sdk-nodejs 4.17.0 → 4.18.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/lib/captures/get.js +1 -1
- package/lib/captures/index.js +1 -1
- package/lib/captures/refund.js +1 -1
- package/lib/disputes/cancel.js +1 -1
- package/lib/disputes/get.js +1 -1
- package/lib/disputes/index.js +1 -1
- package/lib/disputes/submit.js +1 -1
- package/lib/disputes/uploadFile.js +1 -1
- package/lib/files/getFile.js +1 -1
- package/lib/files/index.js +1 -1
- package/lib/hostedcheckouts/create.js +1 -1
- package/lib/hostedcheckouts/get.js +1 -1
- package/lib/hostedcheckouts/index.js +1 -1
- package/lib/hostedcheckouts/remove.js +1 -1
- package/lib/hostedmandatemanagements/create.js +1 -1
- package/lib/hostedmandatemanagements/get.js +1 -1
- package/lib/hostedmandatemanagements/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/installments/getInstallmentsInfo.js +1 -1
- package/lib/installments/index.js +1 -1
- package/lib/mandates/block.js +1 -1
- package/lib/mandates/create.js +1 -1
- package/lib/mandates/createWithMandateReference.js +1 -1
- package/lib/mandates/get.js +1 -1
- package/lib/mandates/index.js +1 -1
- package/lib/mandates/revoke.js +1 -1
- package/lib/mandates/unblock.js +1 -1
- package/lib/model/domain/errors/definitions/index.js +1 -1
- package/lib/model/domain/file/definitions/index.js +1 -1
- package/lib/model/domain/payment/definitions/index.d.ts +1 -0
- package/lib/model/installments/index.d.ts +1 -1
- package/lib/model/webhooks/index.d.ts +2 -27
- package/lib/model/webhooks/index.js +11 -22
- package/lib/model/webhooks/index.js.map +1 -1
- package/lib/model/webhooks/types.d.ts +32 -0
- package/lib/model/webhooks/types.js +25 -0
- package/lib/model/webhooks/types.js.map +1 -0
- package/lib/payments/approve.js +1 -1
- package/lib/payments/cancel.js +1 -1
- package/lib/payments/cancelapproval.js +1 -1
- package/lib/payments/capture.js +1 -1
- package/lib/payments/captures.js +1 -1
- package/lib/payments/complete.js +1 -1
- package/lib/payments/create.js +1 -1
- package/lib/payments/devicefingerprint.js +1 -1
- package/lib/payments/dispute.js +1 -1
- package/lib/payments/disputes.js +1 -1
- package/lib/payments/find.js +1 -1
- package/lib/payments/get.js +1 -1
- package/lib/payments/index.js +1 -1
- package/lib/payments/processchallenged.js +1 -1
- package/lib/payments/refund.js +1 -1
- package/lib/payments/refunds.js +1 -1
- package/lib/payments/thirdPartyStatus.js +1 -1
- package/lib/payments/tokenize.js +1 -1
- package/lib/payouts/approve.js +1 -1
- package/lib/payouts/cancel.js +1 -1
- package/lib/payouts/cancelapproval.js +1 -1
- package/lib/payouts/create.js +1 -1
- package/lib/payouts/find.js +1 -1
- package/lib/payouts/get.js +1 -1
- package/lib/payouts/index.js +1 -1
- package/lib/productgroups/deviceFingerprint.js +1 -1
- package/lib/productgroups/find.js +1 -1
- package/lib/productgroups/get.js +1 -1
- package/lib/productgroups/index.js +1 -1
- package/lib/products/customerDetails.js +1 -1
- package/lib/products/deviceFingerprint.js +1 -1
- package/lib/products/directory.js +1 -1
- package/lib/products/find.js +1 -1
- package/lib/products/get.js +1 -1
- package/lib/products/index.js +1 -1
- package/lib/products/networks.js +1 -1
- package/lib/products/sessions.js +1 -1
- package/lib/refunds/approve.js +1 -1
- package/lib/refunds/cancel.js +1 -1
- package/lib/refunds/cancelapproval.js +1 -1
- package/lib/refunds/find.js +1 -1
- package/lib/refunds/get.js +1 -1
- package/lib/refunds/index.js +1 -1
- package/lib/riskassessments/bankaccounts.js +1 -1
- package/lib/riskassessments/cards.js +1 -1
- package/lib/riskassessments/index.js +1 -1
- package/lib/services/bankaccount.js +1 -1
- package/lib/services/convertAmount.js +1 -1
- package/lib/services/getIINdetails.js +1 -1
- package/lib/services/index.js +1 -1
- package/lib/services/privacypolicy.js +1 -1
- package/lib/services/testconnection.js +1 -1
- package/lib/sessions/create.js +1 -1
- package/lib/sessions/index.js +1 -1
- package/lib/tokens/approvesepadirectdebit.js +1 -1
- package/lib/tokens/create.js +1 -1
- package/lib/tokens/get.js +1 -1
- package/lib/tokens/index.js +1 -1
- package/lib/tokens/remove.js +1 -1
- package/lib/tokens/update.js +1 -1
- package/lib/utils/headers.js +1 -1
- package/lib/webhooks/index.js +3 -55
- package/lib/webhooks/index.js.map +1 -1
- package/lib/webhooks/validation.d.ts +3 -0
- package/lib/webhooks/validation.js +63 -0
- package/lib/webhooks/validation.js.map +1 -0
- package/package.json +1 -1
- package/schemas/hostedcheckout/CreateHostedCheckoutRequest.json +3 -0
- package/schemas/payment/CreatePaymentRequest.json +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getThirdPartyStatus = function (merchantId, paymentId, paymentContext, cb) {
|
package/lib/payments/tokenize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/payouts/approve.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/payouts/cancel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const cancelPayout = function (merchantId, payoutId, paymentContext, cb) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const cancelApprovalPayout = function (merchantId, payoutId, paymentContext, cb) {
|
package/lib/payouts/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/payouts/find.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const findPayouts = function (merchantId, paymentContext, cb) {
|
package/lib/payouts/get.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPayout = function (merchantId, payoutId, paymentContext, cb) {
|
package/lib/payouts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const create = require("./create");
|
|
7
7
|
const find = require("./find");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPaymentProductGroups = function (merchantId, paymentContext, cb) {
|
package/lib/productgroups/get.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPaymentProductGroup = function (merchantId, paymentProductGroupId, paymentContext, cb) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getDirectory = function (merchantId, paymentProductId, paymentContext, cb) {
|
package/lib/products/find.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPaymentProducts = function (merchantId, paymentContext, cb) {
|
package/lib/products/get.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPaymentProduct = function (merchantId, paymentProductId, paymentContext, cb) {
|
package/lib/products/index.js
CHANGED
package/lib/products/networks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getNetworks = function (merchantId, paymentProductId, paymentContext, cb) {
|
package/lib/products/sessions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/refunds/approve.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/refunds/cancel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const cancelRefund = function (merchantId, refundId, paymentContext, cb) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const cancelApprovalRefund = function (merchantId, refundId, paymentContext, cb) {
|
package/lib/refunds/find.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const findRefunds = function (merchantId, paymentContext, cb) {
|
package/lib/refunds/get.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getRefund = function (merchantId, refundId, paymentContext, cb) {
|
package/lib/refunds/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const bankaccounts = require("./bankaccounts");
|
|
7
7
|
const cards = require("./cards");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const convertAmount = function (merchantId, paymentContext, cb) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/services/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const convertAmount = require("./convertAmount");
|
|
7
7
|
const bankaccount = require("./bankaccount");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getPrivacyPolicy = function (merchantId, paymentContext, cb) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const testConnection = function (merchantId, paymentContext, cb) {
|
package/lib/sessions/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/sessions/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/tokens/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/tokens/get.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const getToken = function (merchantId, tokenId, paymentContext, cb) {
|
package/lib/tokens/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const create = require("./create");
|
|
7
7
|
const get = require("./get");
|
package/lib/tokens/remove.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const communicator = require("../utils/communicator");
|
|
7
7
|
const deleteToken = function (merchantId, tokenId, paymentContext, cb) {
|
package/lib/tokens/update.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file was auto-generated from the API references found at
|
|
4
|
-
* https://epayments-api.developer-ingenico.com/
|
|
4
|
+
* https://epayments-api.developer-ingenico.com/
|
|
5
5
|
*/
|
|
6
6
|
const jsonschema_1 = require("jsonschema");
|
|
7
7
|
const communicator = require("../utils/communicator");
|
package/lib/utils/headers.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.date = date;
|
|
|
9
9
|
function serverMetaInfo(sdkContext) {
|
|
10
10
|
const info = {
|
|
11
11
|
sdkCreator: "Ingenico",
|
|
12
|
-
sdkIdentifier: "NodejsServerSDK/v4.
|
|
12
|
+
sdkIdentifier: "NodejsServerSDK/v4.18.0",
|
|
13
13
|
platformIdentifier: process.env["OS"] + " Node.js/" + process.versions.node
|
|
14
14
|
};
|
|
15
15
|
if (sdkContext.getIntegrator() !== null) {
|
package/lib/webhooks/index.js
CHANGED
|
@@ -1,61 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3
|
-
const crypto = require("crypto");
|
|
4
|
-
const compare = require("secure-compare");
|
|
5
3
|
const versions_1 = require("../utils/versions");
|
|
6
4
|
const webhooks_1 = require("../model/webhooks");
|
|
7
|
-
const
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
-
getSecretKey(_keyId, _cb) {
|
|
10
|
-
throw new Error("getSecretKey not initialized yet");
|
|
11
|
-
}
|
|
12
|
-
};
|
|
5
|
+
const signatureValidator = require("./validation");
|
|
13
6
|
const secretKeyStore = {};
|
|
14
|
-
function getHeaderValue(requestHeaders, headerName) {
|
|
15
|
-
const lowerCaseHeaderName = headerName.toLowerCase();
|
|
16
|
-
for (const name in requestHeaders) {
|
|
17
|
-
if (name != null && lowerCaseHeaderName === name.toLowerCase()) {
|
|
18
|
-
const value = requestHeaders[name];
|
|
19
|
-
if (typeof value === "string") {
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
if (typeof value === "undefined") {
|
|
23
|
-
throw new Error("could not find header '" + headerName + "'");
|
|
24
|
-
}
|
|
25
|
-
throw new Error("found multiple values for header '" + headerName + "'");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
throw new Error("could not find header '" + headerName + "'");
|
|
29
|
-
}
|
|
30
|
-
function validateBody(body, requestHeaders, cb) {
|
|
31
|
-
try {
|
|
32
|
-
const signature = getHeaderValue(requestHeaders, "X-GCS-Signature");
|
|
33
|
-
const keyId = getHeaderValue(requestHeaders, "X-GCS-KeyId");
|
|
34
|
-
webhooksContext.getSecretKey(keyId, (error, secretKey) => {
|
|
35
|
-
if (error) {
|
|
36
|
-
cb(error);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const expectedSignature = crypto
|
|
40
|
-
.createHmac("sha256", secretKey) // if error is falsy, secretKey isn't
|
|
41
|
-
.update(body)
|
|
42
|
-
.digest("base64");
|
|
43
|
-
if (compare(signature, expectedSignature)) {
|
|
44
|
-
cb(null);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
cb(new Error("failed to validate signature '" + signature + "'"));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
cb(e);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
7
|
function validate(body, requestHeaders, cb) {
|
|
57
8
|
try {
|
|
58
|
-
|
|
9
|
+
signatureValidator.validate(body, requestHeaders, cb);
|
|
59
10
|
}
|
|
60
11
|
catch (e) {
|
|
61
12
|
cb(e);
|
|
@@ -85,10 +36,7 @@ function unmarshal(body, requestHeaders, cb) {
|
|
|
85
36
|
}
|
|
86
37
|
const webhooksHelper = {
|
|
87
38
|
init: context => {
|
|
88
|
-
|
|
89
|
-
throw new Error("no valid secret key store given");
|
|
90
|
-
}
|
|
91
|
-
webhooksContext.getSecretKey = context.getSecretKey;
|
|
39
|
+
signatureValidator.init(context);
|
|
92
40
|
return webhooksHelper;
|
|
93
41
|
},
|
|
94
42
|
validate: validate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAE7D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAE7D,gDAA+C;AAE/C,gDAA6J;AAC7J,mDAAoD;AAEpD,MAAM,cAAc,GAAW,EAAE,CAAC;AAElC,SAAS,QAAQ,CAAC,IAAqB,EAAE,cAA8B,EAAE,EAAoB;IAC3F,IAAI;QACF,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;KACvD;IAAC,OAAO,CAAC,EAAE;QACV,EAAE,CAAC,CAAU,CAAC,CAAC;KAChB;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAoB;IAC9C,IAAI,qBAAU,KAAK,KAAK,CAAC,UAAU,EAAE;QACnC,MAAM,IAAI,kCAAuB,CAAC,oBAAoB,GAAG,KAAK,CAAC,UAAU,GAAG,0CAA0C,GAAG,qBAAU,EAAE,KAAK,CAAC,UAAW,EAAE,qBAAU,CAAC,CAAC;KACrK;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAAqB,EAAE,cAA8B,EAAE,EAAqB;IAC7F,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QACrC,IAAI,KAAK,EAAE;YACT,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SACjB;aAAM;YACL,IAAI;gBACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC1C,kBAAkB,CAAC,KAAK,CAAC,CAAC;gBAC1B,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aACjB;YAAC,OAAO,CAAC,EAAE;gBACV,EAAE,CAAC,CAAU,EAAE,IAAI,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,cAAc,GAAmB;IACrC,IAAI,EAAE,OAAO,CAAC,EAAE;QACd,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,SAAS;IAEpB,sBAAsB,EAAE;QACtB,YAAY,CAAC,KAAK,EAAE,EAAE;YACpB,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,CAAC,SAAS,EAAE;gBACd,EAAE,CAAC,IAAI,qCAA0B,CAAC,uCAAuC,GAAG,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;aAClG;iBAAM;gBACL,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;aACrB;QACH,CAAC;QACD,cAAc,CAAC,KAAK,EAAE,SAAS;YAC7B,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE;gBAC3B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;aACtC;YACD,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;gBACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;aAC1C;YACD,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;QACpC,CAAC;QACD,eAAe,CAAC,KAAK;YACnB,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,KAAK;YACH,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;gBACjC,iDAAiD;gBACjD,IAAI,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;oBACvC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;iBAC7B;aACF;QACH,CAAC;KACF;CACF,CAAC;AAEF,iBAAS,cAAc,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const crypto = require("crypto");
|
|
3
|
+
const compare = require("secure-compare");
|
|
4
|
+
let secretKeyStore = {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
getSecretKey(_keyId, _cb) {
|
|
7
|
+
throw new Error("getSecretKey not initialized yet");
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function getHeaderValue(requestHeaders, headerName) {
|
|
11
|
+
const lowerCaseHeaderName = headerName.toLowerCase();
|
|
12
|
+
for (const name in requestHeaders) {
|
|
13
|
+
if (name != null && lowerCaseHeaderName === name.toLowerCase()) {
|
|
14
|
+
const value = requestHeaders[name];
|
|
15
|
+
if (typeof value === "string") {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
if (typeof value === "undefined") {
|
|
19
|
+
throw new Error("could not find header '" + headerName + "'");
|
|
20
|
+
}
|
|
21
|
+
throw new Error("found multiple values for header '" + headerName + "'");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
throw new Error("could not find header '" + headerName + "'");
|
|
25
|
+
}
|
|
26
|
+
function validate(body, requestHeaders, cb) {
|
|
27
|
+
try {
|
|
28
|
+
const signature = getHeaderValue(requestHeaders, "X-GCS-Signature");
|
|
29
|
+
const keyId = getHeaderValue(requestHeaders, "X-GCS-KeyId");
|
|
30
|
+
secretKeyStore.getSecretKey(keyId, (error, secretKey) => {
|
|
31
|
+
if (error) {
|
|
32
|
+
cb(error);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const expectedSignature = crypto
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
|
+
.createHmac("sha256", secretKey) // if error is falsy, secretKey isn't
|
|
38
|
+
.update(body)
|
|
39
|
+
.digest("base64");
|
|
40
|
+
if (compare(signature, expectedSignature)) {
|
|
41
|
+
cb(null);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
cb(new Error("failed to validate signature '" + signature + "'"));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
cb(e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const validator = {
|
|
54
|
+
init: store => {
|
|
55
|
+
if (!store || typeof store.getSecretKey !== "function") {
|
|
56
|
+
throw new Error("no valid secret key store given");
|
|
57
|
+
}
|
|
58
|
+
secretKeyStore = store;
|
|
59
|
+
},
|
|
60
|
+
validate: validate
|
|
61
|
+
};
|
|
62
|
+
module.exports = validator;
|
|
63
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/webhooks/validation.ts"],"names":[],"mappings":";AAAA,iCAAkC;AAClC,0CAA2C;AAG3C,IAAI,cAAc,GAAmB;IACnC,6DAA6D;IAC7D,YAAY,CAAC,MAAc,EAAE,GAAsB;QACjD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;CACF,CAAC;AAEF,SAAS,cAAc,CAAC,cAA8B,EAAE,UAAkB;IACxE,MAAM,mBAAmB,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IACrD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;QACjC,IAAI,IAAI,IAAI,IAAI,IAAI,mBAAmB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE;YAC9D,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,OAAO,KAAK,CAAC;aACd;YACD,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;gBAChC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC;aAC/D;YACD,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC;SAC1E;KACF;IACD,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,QAAQ,CAAC,IAAqB,EAAE,cAA8B,EAAE,EAAoB;IAC3F,IAAI;QACF,MAAM,SAAS,GAAG,cAAc,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,cAAc,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;QAE5D,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACtD,IAAI,KAAK,EAAE;gBACT,EAAE,CAAC,KAAK,CAAC,CAAC;aACX;iBAAM;gBACL,MAAM,iBAAiB,GAAG,MAAM;oBAC9B,oEAAoE;qBACnE,UAAU,CAAC,QAAQ,EAAE,SAAU,CAAC,CAAC,qCAAqC;qBACtE,MAAM,CAAC,IAAI,CAAC;qBACZ,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACpB,IAAI,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE;oBACzC,EAAE,CAAC,IAAI,CAAC,CAAC;iBACV;qBAAM;oBACL,EAAE,CAAC,IAAI,KAAK,CAAC,gCAAgC,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,CAAC,EAAE;QACV,EAAE,CAAC,CAAU,CAAC,CAAC;KAChB;AACH,CAAC;AAED,MAAM,SAAS,GAAuB;IACpC,IAAI,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,YAAY,KAAK,UAAU,EAAE;YACtD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACpD;QACD,cAAc,GAAG,KAAK,CAAC;IACzB,CAAC;IACD,QAAQ,EAAE,QAAQ;CACnB,CAAC;AACF,iBAAS,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "connect-sdk-nodejs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API",
|
|
5
5
|
"homepage": "https://github.com/Ingenico-ePayments/connect-sdk-nodejs#readme",
|
|
6
6
|
"bugs": {
|