@finteqhub/sdk-js 0.15.0 → 0.16.0-beta.1

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Notable changes to `@finteqhub/sdk-js`. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
 
5
+ ## 0.16.0
6
+
7
+ ### Changed
8
+
9
+ - The SDK no longer sends the `x-merchant-id` header (previously on every request) or the `x-project-id` header (previously on `submit-form` and `operations` requests, taken from the session response). The constructor signature is unchanged: `merchantId` is still accepted, but it is no longer validated (the constructor does not throw when it is empty or missing) and is not transmitted. This release requires a backend that no longer expects these headers; against older backends `submit-form` and `sessions` requests are rejected with 400.
10
+
5
11
  ## 0.15.0
6
12
 
7
13
  ### Added
package/README.md CHANGED
@@ -6,7 +6,9 @@ Use `new FinteqHubProcessing(apiUrl: string, fingerprintVisitorId: string, merch
6
6
  const processing = new FinteqHubProcessing('api-url', 'fingerprint-visitor-id', 'merchant-id', 'session-id');
7
7
  ```
8
8
 
9
- The constructor validates its arguments and throws a `TypeError` when `apiUrl`, `fingerprintVisitorId`, `merchantId` or `sessionId` is missing, empty or not a string, when `isSecure` is not a boolean, or when `retryOptions` is malformed (see [Retries and error diagnostics](#retries-and-error-diagnostics)).
9
+ The constructor validates its arguments and throws a `TypeError` when `apiUrl`, `fingerprintVisitorId` or `sessionId` is missing, empty or not a string, when `isSecure` is not a boolean, or when `retryOptions` is malformed (see [Retries and error diagnostics](#retries-and-error-diagnostics)).
10
+
11
+ `merchantId` is accepted for compatibility but is neither validated nor sent to the API since 0.16.0.
10
12
 
11
13
  ## Retries and error diagnostics
12
14
 
@@ -43,7 +43,6 @@ export class FinteqHubProcessing {
43
43
  method: "GET",
44
44
  headers: {
45
45
  "Content-Type": "application/json;charset=UTF-8",
46
- "x-merchant-id": this.merchantId,
47
46
  "x-request-id": uuid(),
48
47
  [SDK_HEADER_NAME]: SDK_HEADER_VALUE,
49
48
  },
@@ -108,11 +107,9 @@ export class FinteqHubProcessing {
108
107
  method: "POST",
109
108
  headers: {
110
109
  "Content-Type": "application/json;charset=UTF-8",
111
- "x-merchant-id": this.merchantId,
112
110
  "x-request-id": uuid(),
113
111
  "x-fingerprint": this.fingerprintVisitorId,
114
112
  "x-session-id": this.sessionId,
115
- "x-project-id": this.projectId,
116
113
  [SDK_HEADER_NAME]: SDK_HEADER_VALUE,
117
114
  },
118
115
  body: JSON.stringify(data),
package/dist/src/utils.js CHANGED
@@ -49,7 +49,7 @@ export function getDeviceType() {
49
49
  }
50
50
  return DeviceType.Unknown;
51
51
  }
52
- const REQUIRED_STRINGS = ["apiUrl", "fingerprintVisitorId", "merchantId", "sessionId"];
52
+ const REQUIRED_STRINGS = ["apiUrl", "fingerprintVisitorId", "sessionId"];
53
53
  export function validateArguments(args) {
54
54
  for (const key of REQUIRED_STRINGS) {
55
55
  if (typeof args[key] !== "string" || args[key] === "") {
@@ -1,3 +1,3 @@
1
1
  export declare const SDK_HEADER_NAME = "x-pgw-sdk";
2
- export declare const SDK_VERSION = "0.15.0";
2
+ export declare const SDK_VERSION = "0.16.0-beta.1";
3
3
  export declare const SDK_HEADER_VALUE: string;
@@ -1,3 +1,3 @@
1
1
  export const SDK_HEADER_NAME = "x-pgw-sdk";
2
- export const SDK_VERSION = "0.15.0";
2
+ export const SDK_VERSION = "0.16.0-beta.1";
3
3
  export const SDK_HEADER_VALUE = `sdk-js/${SDK_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finteqhub/sdk-js",
3
- "version": "0.15.0",
3
+ "version": "0.16.0-beta.1",
4
4
  "description": "SDK for interacting with FinteqHub processing API",
5
5
  "main": "./dist/index.js",
6
6
  "typings": "./dist/index.d.ts",