@proxy-checkout/server-js 0.0.6-prx-103.72.1 → 0.0.7-prx-97.75.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,9 +73,6 @@ 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
- }
79
76
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
80
77
  ...toCreateProxySessionBody(input),
81
78
  ...(input.payerDestinationUrl !== undefined
@@ -87,13 +84,19 @@ class ProxySessionsResource {
87
84
  requestId: input.requestId,
88
85
  });
89
86
  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
+ }
90
92
  return {
91
93
  ...session,
92
- handoffUrl: buildHandoffUrl({
93
- payHost,
94
- proxySessionId: session.id,
95
- publishableKey,
96
- }),
94
+ handoffUrl: session.handoffUrl ||
95
+ buildHandoffUrl({
96
+ payHost,
97
+ proxySessionId: session.id,
98
+ publishableKey,
99
+ }),
97
100
  };
98
101
  }
99
102
  async retrieve(proxySessionId, options = {}) {
@@ -239,7 +242,11 @@ function toProxySessionHandoff(response) {
239
242
  const integrationMode = (0, response_validators_js_1.requireString)(body.integration_mode, "sessions.createHandoff.integrationMode");
240
243
  return {
241
244
  expiresAt: (0, response_validators_js_1.requireString)(body.expires_at, "sessions.createHandoff.expiresAt"),
242
- handoffUrl: "",
245
+ handoffUrl: typeof body.handoff_url === "string"
246
+ ? body.handoff_url
247
+ : typeof body.handoffUrl === "string"
248
+ ? body.handoffUrl
249
+ : "",
243
250
  id: (0, response_validators_js_1.requireString)(body.id, "sessions.createHandoff.id"),
244
251
  integrationMode,
245
252
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.72.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.72.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.7-prx-97.75.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.7-prx-97.75.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.72.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.72.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.7-prx-97.75.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.7-prx-97.75.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-103.72.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.7-prx-97.75.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -70,9 +70,6 @@ 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
- }
76
73
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
77
74
  ...toCreateProxySessionBody(input),
78
75
  ...(input.payerDestinationUrl !== undefined
@@ -84,13 +81,19 @@ export class ProxySessionsResource {
84
81
  requestId: input.requestId,
85
82
  });
86
83
  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
+ }
87
89
  return {
88
90
  ...session,
89
- handoffUrl: buildHandoffUrl({
90
- payHost,
91
- proxySessionId: session.id,
92
- publishableKey,
93
- }),
91
+ handoffUrl: session.handoffUrl ||
92
+ buildHandoffUrl({
93
+ payHost,
94
+ proxySessionId: session.id,
95
+ publishableKey,
96
+ }),
94
97
  };
95
98
  }
96
99
  async retrieve(proxySessionId, options = {}) {
@@ -234,7 +237,11 @@ function toProxySessionHandoff(response) {
234
237
  const integrationMode = requireString(body.integration_mode, "sessions.createHandoff.integrationMode");
235
238
  return {
236
239
  expiresAt: requireString(body.expires_at, "sessions.createHandoff.expiresAt"),
237
- handoffUrl: "",
240
+ handoffUrl: typeof body.handoff_url === "string"
241
+ ? body.handoff_url
242
+ : typeof body.handoffUrl === "string"
243
+ ? body.handoffUrl
244
+ : "",
238
245
  id: requireString(body.id, "sessions.createHandoff.id"),
239
246
  integrationMode,
240
247
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.72.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-103.72.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.7-prx-97.75.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.7-prx-97.75.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.6-prx-103.72.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.7-prx-97.75.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-103.72.1",
10
+ "version": "0.0.7-prx-97.75.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",