connect-sdk-nodejs 4.2.0 → 4.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/lib/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  const sdkcontext = require("./utils/context");
3
+ const obfuscate = require("./utils/obfuscate");
3
4
  const hostedcheckouts = require("./hostedcheckouts");
4
5
  const hostedmandatemanagements = require("./hostedmandatemanagements");
5
6
  const payments = require("./payments");
@@ -79,7 +80,13 @@ const connectSdk = {
79
80
  sessions: sessions,
80
81
  files: files,
81
82
  context: sdkcontext,
82
- webhooks: webhooks
83
+ webhooks: webhooks,
84
+ obfuscate: {
85
+ all: obfuscate.all,
86
+ allButLast: obfuscate.allButLast,
87
+ allButFirst: obfuscate.allButFirst,
88
+ withFixedLength: obfuscate.withFixedLength
89
+ }
83
90
  };
84
91
  module.exports = connectSdk;
85
92
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,8CAA+C;AAE/C,qDAAsD;AACtD,uEAAwE;AACxE,uCAAwC;AACxC,uCAAwC;AACxC,qCAAsC;AACtC,uCAAwC;AACxC,qCAAsC;AACtC,iDAAkD;AAClD,uCAAwC;AACxC,qDAAsD;AACtD,uCAAwC;AACxC,mCAAoC;AACpC,uCAAwC;AACxC,uCAAwC;AACxC,iCAAkC;AAElC,uCAAwC;AAExC,IAAI,OAAuC,CAAC;AAC5C,IAAI,QAAiB,CAAC;AAEtB,MAAM,WAAW,GAAyB;IACxC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,GAAS,EAAE;IACjC,WAAW,CAAC,IAAI,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AE,OAAO;IAChB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;IAChB,aAAa,EAAE,aAAa;IAC5B,QAAQ,EAAE,QAAQ;IAClB,eAAe,EAAE,eAAe;IAChC,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,UAAU;IAEnB,QAAQ,EAAE,QAAQ;IAElB,SAAS,EAAE;QACT,GAAG,EAAE,SAAS,CAAC,GAAG;QAClB,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,eAAe,EAAE,SAAS,CAAC,eAAe;KAC3C;CACF,CAAC;AACF,iBAAS,UAAU,CAAC"}
@@ -756,11 +756,13 @@ export interface Seller {
756
756
  address?: Address | null;
757
757
  channelCode?: string | null;
758
758
  description?: string | null;
759
+ externalReferenceId?: string | null;
759
760
  geocode?: string | null;
760
761
  id?: string | null;
761
762
  invoiceNumber?: string | null;
762
763
  mcc?: string | null;
763
764
  name?: string | null;
765
+ phoneNumber?: string | null;
764
766
  type?: string | null;
765
767
  }
766
768
  export interface SepaDirectDebitPaymentMethodSpecificInput extends AbstractSepaDirectDebitPaymentMethodSpecificInput {
@@ -72,6 +72,7 @@ export interface PaymentProduct {
72
72
  paymentProduct320SpecificData?: PaymentProduct320SpecificData | null;
73
73
  paymentProduct863SpecificData?: PaymentProduct863SpecificData | null;
74
74
  paymentProductGroup?: string | null;
75
+ supportsMandates?: boolean | null;
75
76
  usesRedirectionTo3rdParty?: boolean | null;
76
77
  }
77
78
  export interface PaymentProduct302SpecificData {
@@ -1,4 +1,4 @@
1
- import { AmountOfMoney, BankAccountBban, BankAccountIban } from "../definitions";
1
+ import { BankAccountBban, BankAccountIban } from "../definitions";
2
2
  import { BankData, BankDetails, IINDetail, PaymentContext, Swift } from "./definitions";
3
3
  export interface BankDetailsRequest extends BankDetails {
4
4
  }
@@ -24,12 +24,6 @@ export interface GetIINDetailsResponse {
24
24
  export interface GetPrivacyPolicyResponse {
25
25
  htmlContent?: string | null;
26
26
  }
27
- export interface SettlementDetails {
28
- acquirerReferenceNumber?: string | null;
29
- amountOfMoney?: AmountOfMoney | null;
30
- paymentId?: string | null;
31
- retrievalReferenceNumber?: string | null;
32
- }
33
27
  export interface TestConnection {
34
28
  result?: string | null;
35
29
  }
@@ -1,4 +1,4 @@
1
- import { Context, SdkContext } from "./types";
1
+ import { Context, ObfuscationRules, SdkContext } from "./types";
2
2
  import { HostedcheckoutsClient } from "./hostedcheckouts";
3
3
  import { HostedmandatemanagementsClient } from "./hostedmandatemanagements";
4
4
  import { PaymentsClient } from "./payments";
@@ -34,5 +34,6 @@ export interface ConnectSdk {
34
34
  readonly files: FilesClient;
35
35
  readonly context: SdkContext;
36
36
  readonly webhooks: WebhooksHelper;
37
+ readonly obfuscate: ObfuscationRules;
37
38
  }
38
39
  export * from "./types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA8CA,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgDA,0CAAwB"}
@@ -36,13 +36,6 @@ export interface ServicesClient {
36
36
  * If the call was not successful, the response body type will be {@link ErrorResponse}.
37
37
  */
38
38
  testconnection(merchantId: string, paymentContext: PaymentContext | null, cb: SdkCallback): void;
39
- /**
40
- * Resource /{merchantId}/services/settlementdetails/{paymentId} - <a href="https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/nodejs/services/settlementdetails.html">Get Settlement details</a>
41
- * @param cb The callback for the response.
42
- * If the call was successfull, the response body type will be {@link SettlementDetails}.
43
- * If the call was not successful, the response body type will be {@link ErrorResponse}.
44
- */
45
- settlementdetails(merchantId: string, paymentId: string, paymentContext: PaymentContext | null, cb: SdkCallback): void;
46
39
  }
47
40
  export interface ConvertAmountParams extends PaymentContext {
48
41
  source?: string;
@@ -18,6 +18,9 @@ export interface Context {
18
18
  integrator: string;
19
19
  shoppingCartExtension?: ShoppingCartExtension;
20
20
  httpOptions?: https.RequestOptions;
21
+ obfuscationRules?: {
22
+ [key: string]: ObfuscationRule;
23
+ };
21
24
  }
22
25
  export interface FileMetaData {
23
26
  contentType: string | null;
@@ -42,6 +45,25 @@ export interface MultipartFormDataObject {
42
45
  export interface MultipartFormDataRequest extends SdkRequest {
43
46
  body: MultipartFormDataObject;
44
47
  }
48
+ export interface ObfuscationRules {
49
+ /**
50
+ * @returns An obfuscation rule that will replace all characters with *.
51
+ */
52
+ all(): ObfuscationRule;
53
+ /**
54
+ * @returns An obfuscation rule that will keep a fixed number of characters at the end, then replaces all other characters with *.
55
+ */
56
+ allButLast(count: number): ObfuscationRule;
57
+ /**
58
+ * @returns An obfuscation rule that will keep a fixed number of characters at the start, then replaces all other characters with *.
59
+ */
60
+ allButFirst(count: number): ObfuscationRule;
61
+ /**
62
+ * @returns An obfuscation rule that will replace values with a fixed length string containing only *.
63
+ */
64
+ withFixedLength(count: number): ObfuscationRule;
65
+ }
66
+ export declare type ObfuscationRule = (value: string) => string;
45
67
  export interface PaymentContext {
46
68
  extraHeaders?: Header[];
47
69
  idemPotence?: IdemPotence;
@@ -8,14 +8,12 @@ const bankaccount = require("./bankaccount");
8
8
  const getIINdetails = require("./getIINdetails");
9
9
  const privacypolicy = require("./privacypolicy");
10
10
  const testconnection = require("./testconnection");
11
- const settlementdetails = require("./settlementdetails");
12
11
  const servicesClient = {
13
12
  convertAmount: convertAmount,
14
13
  bankaccount: bankaccount,
15
14
  getIINdetails: getIINdetails,
16
15
  privacypolicy: privacypolicy,
17
- testconnection: testconnection,
18
- settlementdetails: settlementdetails
16
+ testconnection: testconnection
19
17
  };
20
18
  module.exports = servicesClient;
21
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,iDAAkD;AAClD,6CAA8C;AAC9C,iDAAkD;AAClD,iDAAkD;AAClD,mDAAoD;AACpD,yDAA0D;AAG1D,MAAM,cAAc,GAAmB;IACrC,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,cAAc;IAC9B,iBAAiB,EAAE,iBAAiB;CACrC,CAAC;AACF,iBAAS,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,iDAAkD;AAClD,6CAA8C;AAC9C,iDAAkD;AAClD,iDAAkD;AAClD,mDAAoD;AAGpD,MAAM,cAAc,GAAmB;IACrC,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,cAAc;CAC/B,CAAC;AACF,iBAAS,cAAc,CAAC"}
@@ -9,7 +9,7 @@ exports.date = date;
9
9
  function serverMetaInfo(sdkContext) {
10
10
  const info = {
11
11
  sdkCreator: "Ingenico",
12
- sdkIdentifier: "NodejsServerSDK/v4.2.0",
12
+ sdkIdentifier: "NodejsServerSDK/v4.4.0",
13
13
  platformIdentifier: process.env["OS"] + " Node.js/" + process.versions.node
14
14
  };
15
15
  if (sdkContext.getIntegrator() !== null) {
@@ -1,2 +1,18 @@
1
- import { SdkContext } from "../model";
1
+ import { ObfuscationRule, SdkContext } from "../model";
2
+ /**
3
+ * @returns An obfuscation rule that will keep a fixed number of characters at the end, then replaces all other characters with *.
4
+ */
5
+ export declare function allButLast(count: number): ObfuscationRule;
6
+ /**
7
+ * @returns An obfuscation rule that will replace all characters with *.
8
+ */
9
+ export declare function all(): ObfuscationRule;
10
+ /**
11
+ * @returns An obfuscation rule that will keep a fixed number of characters at the start, then replaces all other characters with *.
12
+ */
13
+ export declare function allButFirst(count: number): ObfuscationRule;
14
+ /**
15
+ * @returns An obfuscation rule that will replace values with a fixed length string containing only *.
16
+ */
17
+ export declare function withFixedLength(count: number): ObfuscationRule;
2
18
  export declare function getObfuscated(input: any, context?: SdkContext | null, caseInsensitive?: boolean): string;
@@ -1,50 +1,68 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getObfuscated = void 0;
3
+ exports.getObfuscated = exports.withFixedLength = exports.allButFirst = exports.all = exports.allButLast = void 0;
4
4
  const traverse = require("traverse");
5
5
  const _ = require("lodash");
6
6
  const sdkContext = require("./context");
7
7
  const REPLACECHAR = "*";
8
8
  const INDENT = 2;
9
- function keyMatches(key, property, caseInsensitive = false) {
10
- return caseInsensitive ? key.toLocaleLowerCase() === property.toLowerCase() : property === key;
9
+ const ALL = value => {
10
+ const l = value.length;
11
+ return _.padStart("", l, REPLACECHAR);
12
+ };
13
+ /**
14
+ * @returns An obfuscation rule that will keep a fixed number of characters at the end, then replaces all other characters with *.
15
+ */
16
+ function allButLast(count) {
17
+ const rule = value => {
18
+ const l = value.length;
19
+ const end = value.substring(l - count);
20
+ return _.padStart(end, l, REPLACECHAR);
21
+ };
22
+ return rule;
11
23
  }
12
- function withKeepEndCount(json, property, count, caseInsensitive = false) {
13
- traverse(json).forEach(function (node) {
14
- if (this.key && keyMatches(this.key, property, caseInsensitive) && typeof node !== "object") {
15
- node = "" + node; // make sure it's a string
16
- const l = node.length;
17
- const end = node.substring(l - count);
18
- this.update(_.padStart(end, l, REPLACECHAR));
19
- }
20
- });
21
- return json;
24
+ exports.allButLast = allButLast;
25
+ /**
26
+ * @returns An obfuscation rule that will replace all characters with *.
27
+ */
28
+ function all() {
29
+ return ALL;
22
30
  }
23
- function withAll(json, property, caseInsensitive = false) {
24
- traverse(json).forEach(function (node) {
25
- if (this.key && keyMatches(this.key, property, caseInsensitive) && typeof node !== "object") {
26
- node = "" + node; // make sure it's a string
27
- const l = node.length;
28
- this.update(_.padStart("", l, REPLACECHAR));
29
- }
30
- });
31
- return json;
31
+ exports.all = all;
32
+ /**
33
+ * @returns An obfuscation rule that will keep a fixed number of characters at the start, then replaces all other characters with *.
34
+ */
35
+ function allButFirst(count) {
36
+ const rule = value => {
37
+ const l = value.length;
38
+ const start = value.substring(0, count);
39
+ return _.padEnd(start, l, REPLACECHAR);
40
+ };
41
+ return rule;
32
42
  }
33
- function withKeepStartCount(json, property, count, caseInsensitive = false) {
34
- traverse(json).forEach(function (node) {
35
- if (this.key && keyMatches(this.key, property, caseInsensitive) && typeof node !== "object") {
36
- node = "" + node; // make sure it's a string
37
- const l = node.length;
38
- const start = node.substring(0, count);
39
- this.update(_.padEnd(start, l, REPLACECHAR));
40
- }
41
- });
42
- return json;
43
+ exports.allButFirst = allButFirst;
44
+ /**
45
+ * @returns An obfuscation rule that will replace values with a fixed length string containing only *.
46
+ */
47
+ function withFixedLength(count) {
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
+ const rule = _value => {
50
+ return _.padEnd("", count, REPLACECHAR);
51
+ };
52
+ return rule;
43
53
  }
44
- function withFixedLength(json, property, count, caseInsensitive = false) {
54
+ exports.withFixedLength = withFixedLength;
55
+ function obfuscationRuleKey(name, toLowerCase) {
56
+ return toLowerCase ? name.toLowerCase() : name;
57
+ }
58
+ function applyObfuscationRules(json, obfuscationRules, toLowerCase) {
45
59
  traverse(json).forEach(function (node) {
46
- if (this.key && keyMatches(this.key, property, caseInsensitive) && typeof node !== "object") {
47
- this.update(_.padEnd("", count, REPLACECHAR));
60
+ if (this.key && typeof node !== "object") {
61
+ const obfuscationRule = obfuscationRules[obfuscationRuleKey(this.key, toLowerCase)];
62
+ if (obfuscationRule) {
63
+ const value = "" + node; // make sure it's a string
64
+ this.update(obfuscationRule(value));
65
+ }
48
66
  }
49
67
  });
50
68
  return json;
@@ -69,33 +87,41 @@ function getObfuscated(input, context, caseInsensitive = false) {
69
87
  return input;
70
88
  }
71
89
  }
72
- let obfuscated = JSON.parse(JSON.stringify(input));
73
- obfuscated = withKeepEndCount(obfuscated, "cardNumber", 4);
74
- obfuscated = withKeepEndCount(obfuscated, "expiryDate", 2);
75
- obfuscated = withAll(obfuscated, "cvv");
76
- obfuscated = withKeepEndCount(obfuscated, "iban", 4);
77
- obfuscated = withKeepEndCount(obfuscated, "accountNumber", 4);
78
- obfuscated = withKeepEndCount(obfuscated, "reformattedAccountNumber", 4);
79
- obfuscated = withKeepStartCount(obfuscated, "bin", 6);
90
+ const obfuscationRules = {};
91
+ obfuscationRules[obfuscationRuleKey("cardNumber", caseInsensitive)] = allButLast(4);
92
+ obfuscationRules[obfuscationRuleKey("expiryDate", caseInsensitive)] = allButLast(2);
93
+ obfuscationRules[obfuscationRuleKey("cvv", caseInsensitive)] = all();
94
+ obfuscationRules[obfuscationRuleKey("iban", caseInsensitive)] = allButLast(4);
95
+ obfuscationRules[obfuscationRuleKey("accountNumber", caseInsensitive)] = allButLast(4);
96
+ obfuscationRules[obfuscationRuleKey("reformattedAccountNumber", caseInsensitive)] = allButLast(4);
97
+ obfuscationRules[obfuscationRuleKey("bin", caseInsensitive)] = allButFirst(6);
80
98
  // key-value pairs can contain any value, like credit card numbers or other private data; mask all values
81
- obfuscated = withAll(obfuscated, "value");
82
- obfuscated = withFixedLength(obfuscated, "keyId", 8);
83
- obfuscated = withFixedLength(obfuscated, "secretKey", 8);
84
- obfuscated = withFixedLength(obfuscated, "publicKey", 8);
85
- obfuscated = withFixedLength(obfuscated, "userAuthenticationToken", 8);
99
+ obfuscationRules[obfuscationRuleKey("value", caseInsensitive)] = all();
100
+ obfuscationRules[obfuscationRuleKey("keyId", caseInsensitive)] = withFixedLength(8);
101
+ obfuscationRules[obfuscationRuleKey("secretKey", caseInsensitive)] = withFixedLength(8);
102
+ obfuscationRules[obfuscationRuleKey("publicKey", caseInsensitive)] = withFixedLength(8);
103
+ obfuscationRules[obfuscationRuleKey("userAuthenticationToken", caseInsensitive)] = withFixedLength(8);
86
104
  // encrypted payload is a base64 string that contains an encrypted value; to make decrypting even harder, just mask the entire thing
87
- obfuscated = withFixedLength(obfuscated, "encryptedPayload", 8);
105
+ obfuscationRules[obfuscationRuleKey("encryptedPayload", caseInsensitive)] = withFixedLength(8);
88
106
  // decrypted payload is a simple base64 string that may contain credit card numbers or other private data; just mask the entire thing
89
- obfuscated = withFixedLength(obfuscated, "decryptedPayload", 8);
107
+ obfuscationRules[obfuscationRuleKey("decryptedPayload", caseInsensitive)] = withFixedLength(8);
90
108
  // encrypted customer input is similar to encrypted payload
91
- obfuscated = withFixedLength(obfuscated, "encryptedCustomerInput", 8);
109
+ obfuscationRules[obfuscationRuleKey("encryptedCustomerInput", caseInsensitive)] = withFixedLength(8);
92
110
  // headers
93
- obfuscated = withFixedLength(obfuscated, "Authorization", 8, caseInsensitive);
94
- obfuscated = withFixedLength(obfuscated, "WWW-Authenticate", 8, caseInsensitive);
95
- obfuscated = withFixedLength(obfuscated, "Proxy-Authenticate", 8, caseInsensitive);
96
- obfuscated = withFixedLength(obfuscated, "Proxy-Authorization", 8, caseInsensitive);
97
- obfuscated = withFixedLength(obfuscated, "X-GCS-Authentication-Token", 8, caseInsensitive);
98
- obfuscated = withFixedLength(obfuscated, "X-GCS-CallerPassword", 8, caseInsensitive);
111
+ obfuscationRules[obfuscationRuleKey("Authorization", caseInsensitive)] = withFixedLength(8);
112
+ obfuscationRules[obfuscationRuleKey("WWW-Authenticate", caseInsensitive)] = withFixedLength(8);
113
+ obfuscationRules[obfuscationRuleKey("Proxy-Authenticate", caseInsensitive)] = withFixedLength(8);
114
+ obfuscationRules[obfuscationRuleKey("Proxy-Authorization", caseInsensitive)] = withFixedLength(8);
115
+ obfuscationRules[obfuscationRuleKey("X-GCS-Authentication-Token", caseInsensitive)] = withFixedLength(8);
116
+ obfuscationRules[obfuscationRuleKey("X-GCS-CallerPassword", caseInsensitive)] = withFixedLength(8);
117
+ const customObfuscationRules = context.getContext().obfuscationRules;
118
+ if (customObfuscationRules) {
119
+ for (const key in customObfuscationRules) {
120
+ obfuscationRules[obfuscationRuleKey(key, caseInsensitive)] = customObfuscationRules[key];
121
+ }
122
+ }
123
+ let obfuscated = JSON.parse(JSON.stringify(input));
124
+ obfuscated = applyObfuscationRules(obfuscated, obfuscationRules, caseInsensitive);
99
125
  return JSON.stringify(obfuscated, null, INDENT);
100
126
  }
101
127
  exports.getObfuscated = getObfuscated;
@@ -1 +1 @@
1
- {"version":3,"file":"obfuscate.js","sourceRoot":"","sources":["../../src/utils/obfuscate.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AACtC,4BAA6B;AAE7B,wCAAyC;AAEzC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,SAAS,UAAU,CAAC,GAAW,EAAE,QAAgB,EAAE,eAAe,GAAG,KAAK;IACxE,OAAO,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC;AACjG,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAa,EAAE,QAAgB,EAAE,KAAa,EAAE,eAAe,GAAG,KAAK;IAC/F,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;QAClC,IAAI,IAAI,CAAC,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC3F,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,0BAA0B;YAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YACtB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC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CAAC;IAC/F,gBAAgB,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IACjG,gBAAgB,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAClG,gBAAgB,CAAC,kBAAkB,CAAC,4BAA4B,EAAE,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IACzG,gBAAgB,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAEnG,MAAM,sBAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,gBAAgB,CAAC;IACrE,IAAI,sBAAsB,EAAE;QAC1B,KAAK,MAAM,GAAG,IAAI,sBAAsB,EAAE;YACxC,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;SAC1F;KACF;IAED,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,UAAU,GAAG,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAElF,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AA1DD,sCA0DC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connect-sdk-nodejs",
3
- "version": "4.2.0",
3
+ "version": "4.4.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": {
@@ -1577,6 +1577,9 @@
1577
1577
  "description" : {
1578
1578
  "type" : "string"
1579
1579
  },
1580
+ "externalReferenceId" : {
1581
+ "type" : "string"
1582
+ },
1580
1583
  "geocode" : {
1581
1584
  "type" : "string"
1582
1585
  },
@@ -1592,6 +1595,9 @@
1592
1595
  "name" : {
1593
1596
  "type" : "string"
1594
1597
  },
1598
+ "phoneNumber" : {
1599
+ "type" : "string"
1600
+ },
1595
1601
  "type" : {
1596
1602
  "type" : "string"
1597
1603
  }
@@ -1033,6 +1033,9 @@
1033
1033
  "description" : {
1034
1034
  "type" : "string"
1035
1035
  },
1036
+ "externalReferenceId" : {
1037
+ "type" : "string"
1038
+ },
1036
1039
  "geocode" : {
1037
1040
  "type" : "string"
1038
1041
  },
@@ -1048,6 +1051,9 @@
1048
1051
  "name" : {
1049
1052
  "type" : "string"
1050
1053
  },
1054
+ "phoneNumber" : {
1055
+ "type" : "string"
1056
+ },
1051
1057
  "type" : {
1052
1058
  "type" : "string"
1053
1059
  }
@@ -1934,6 +1934,9 @@
1934
1934
  "description" : {
1935
1935
  "type" : "string"
1936
1936
  },
1937
+ "externalReferenceId" : {
1938
+ "type" : "string"
1939
+ },
1937
1940
  "geocode" : {
1938
1941
  "type" : "string"
1939
1942
  },
@@ -1949,6 +1952,9 @@
1949
1952
  "name" : {
1950
1953
  "type" : "string"
1951
1954
  },
1955
+ "phoneNumber" : {
1956
+ "type" : "string"
1957
+ },
1952
1958
  "type" : {
1953
1959
  "type" : "string"
1954
1960
  }
@@ -1,3 +0,0 @@
1
- import { PaymentContext, SdkCallback } from "../model";
2
- declare const getSettlementDetails: (merchantId: string, paymentId: string, paymentContext: PaymentContext | null, cb: SdkCallback) => void;
3
- export = getSettlementDetails;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /*
3
- * This file was auto-generated from the API references found at
4
- * https://epayments-api.developer-ingenico.com/s2sapi/v1/
5
- */
6
- const communicator = require("../utils/communicator");
7
- const getSettlementDetails = function (merchantId, paymentId, paymentContext, cb) {
8
- communicator.json({
9
- method: "GET",
10
- modulePath: "/v1/" + merchantId + "/services/settlementdetails/" + paymentId,
11
- body: null,
12
- paymentContext: paymentContext,
13
- cb: cb
14
- });
15
- };
16
- module.exports = getSettlementDetails;
17
- //# sourceMappingURL=settlementdetails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settlementdetails.js","sourceRoot":"","sources":["../../src/services/settlementdetails.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,sDAAuD;AAGvD,MAAM,oBAAoB,GAAG,UAAS,UAAkB,EAAE,SAAiB,EAAE,cAAqC,EAAE,EAAe;IACjI,YAAY,CAAC,IAAI,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,8BAA8B,GAAG,SAAS;QAC5E,IAAI,EAAE,IAAI;QACV,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,EAAE;KACP,CAAC,CAAC;AACL,CAAC,CAAC;AACF,iBAAS,oBAAoB,CAAC"}