@proxy-checkout/server-js 0.0.6-prx-101.64.1 → 0.0.6-prx-103.66.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.
@@ -73,6 +73,9 @@ class ProxySessionsResource {
73
73
  throw new Error("Proxy Checkout sessions.createHandoff requires a publishableKey option or input field.");
74
74
  }
75
75
  const payHost = input.payHost ?? this.options.payHost;
76
+ if (!payHost && this.httpClient.apiHost !== "https://api.proxycheckout.com") {
77
+ throw new Error("Proxy Checkout sessions.createHandoff requires a payHost option or input field when apiHost is overridden.");
78
+ }
76
79
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
77
80
  ...toCreateProxySessionBody(input),
78
81
  ...(input.payerDestinationUrl !== undefined
@@ -84,19 +87,13 @@ class ProxySessionsResource {
84
87
  requestId: input.requestId,
85
88
  });
86
89
  const session = toProxySessionHandoff(response);
87
- if (!session.handoffUrl &&
88
- !payHost &&
89
- this.httpClient.apiHost !== "https://api.proxycheckout.com") {
90
- throw new Error("Proxy Checkout sessions.createHandoff requires a payHost option or input field when apiHost is overridden and the API response does not include handoff_url.");
91
- }
92
90
  return {
93
91
  ...session,
94
- handoffUrl: session.handoffUrl ||
95
- buildHandoffUrl({
96
- payHost,
97
- proxySessionId: session.id,
98
- publishableKey,
99
- }),
92
+ handoffUrl: buildHandoffUrl({
93
+ payHost,
94
+ proxySessionId: session.id,
95
+ publishableKey,
96
+ }),
100
97
  };
101
98
  }
102
99
  async retrieve(proxySessionId, options = {}) {
@@ -242,11 +239,7 @@ function toProxySessionHandoff(response) {
242
239
  const integrationMode = (0, response_validators_js_1.requireString)(body.integration_mode, "sessions.createHandoff.integrationMode");
243
240
  return {
244
241
  expiresAt: (0, response_validators_js_1.requireString)(body.expires_at, "sessions.createHandoff.expiresAt"),
245
- handoffUrl: typeof body.handoff_url === "string"
246
- ? body.handoff_url
247
- : typeof body.handoffUrl === "string"
248
- ? body.handoffUrl
249
- : "",
242
+ handoffUrl: "",
250
243
  id: (0, response_validators_js_1.requireString)(body.id, "sessions.createHandoff.id"),
251
244
  integrationMode,
252
245
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.64.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.64.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.66.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.66.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.64.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.64.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.66.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.66.1";
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkName = void 0;
4
4
  exports.proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
5
- exports.proxyCheckoutServerSdkVersion = "0.0.6-prx-101.64.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.6-prx-103.66.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -70,6 +70,9 @@ export class ProxySessionsResource {
70
70
  throw new Error("Proxy Checkout sessions.createHandoff requires a publishableKey option or input field.");
71
71
  }
72
72
  const payHost = input.payHost ?? this.options.payHost;
73
+ if (!payHost && this.httpClient.apiHost !== "https://api.proxycheckout.com") {
74
+ throw new Error("Proxy Checkout sessions.createHandoff requires a payHost option or input field when apiHost is overridden.");
75
+ }
73
76
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
74
77
  ...toCreateProxySessionBody(input),
75
78
  ...(input.payerDestinationUrl !== undefined
@@ -81,19 +84,13 @@ export class ProxySessionsResource {
81
84
  requestId: input.requestId,
82
85
  });
83
86
  const session = toProxySessionHandoff(response);
84
- if (!session.handoffUrl &&
85
- !payHost &&
86
- this.httpClient.apiHost !== "https://api.proxycheckout.com") {
87
- throw new Error("Proxy Checkout sessions.createHandoff requires a payHost option or input field when apiHost is overridden and the API response does not include handoff_url.");
88
- }
89
87
  return {
90
88
  ...session,
91
- handoffUrl: session.handoffUrl ||
92
- buildHandoffUrl({
93
- payHost,
94
- proxySessionId: session.id,
95
- publishableKey,
96
- }),
89
+ handoffUrl: buildHandoffUrl({
90
+ payHost,
91
+ proxySessionId: session.id,
92
+ publishableKey,
93
+ }),
97
94
  };
98
95
  }
99
96
  async retrieve(proxySessionId, options = {}) {
@@ -237,11 +234,7 @@ function toProxySessionHandoff(response) {
237
234
  const integrationMode = requireString(body.integration_mode, "sessions.createHandoff.integrationMode");
238
235
  return {
239
236
  expiresAt: requireString(body.expires_at, "sessions.createHandoff.expiresAt"),
240
- handoffUrl: typeof body.handoff_url === "string"
241
- ? body.handoff_url
242
- : typeof body.handoffUrl === "string"
243
- ? body.handoffUrl
244
- : "",
237
+ handoffUrl: "",
245
238
  id: requireString(body.id, "sessions.createHandoff.id"),
246
239
  integrationMode,
247
240
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.64.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.64.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.66.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.66.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.64.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.66.1";
3
3
  export const proxyCheckoutServerSdkUserAgent = `${proxyCheckoutServerSdkName}/${proxyCheckoutServerSdkVersion}`;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "types": "./dist/esm/index.d.ts",
10
- "version": "0.0.6-prx-101.64.1",
10
+ "version": "0.0.6-prx-103.66.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",
@@ -48,6 +48,7 @@
48
48
  "scripts": {
49
49
  "build": "node ../../scripts/sdk/build-dual-package.mjs",
50
50
  "test:all": "vitest run",
51
+ "test:ci": "pnpm run test:coverage",
51
52
  "test:coverage": "vitest run --coverage.enabled --coverage.reportsDirectory=coverage/all",
52
53
  "test:coverage:changed": "vitest run --coverage.enabled --coverage.reportsDirectory=coverage/changed",
53
54
  "test:coverage:integration": "vitest run --project integration --coverage.enabled --coverage.reportsDirectory=coverage/integration",