@proxy-checkout/server-js 0.0.4-pr-76.35.1 → 0.0.4-prx-88.38.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/README.md CHANGED
@@ -41,6 +41,9 @@ const handoff = await proxy.sessions.createHandoff({
41
41
  items: [{ product_id: "prod_123", quantity: 1 }],
42
42
  },
43
43
  idempotencyKey: "order_123",
44
+ // Optional: omit in normal production flows to use the dashboard default.
45
+ // Preview/staging/multi-origin environments may override the merchant payer page.
46
+ payerDestinationUrl: "https://preview.example.com/checkout",
44
47
  });
45
48
 
46
49
  console.log(handoff.handoffUrl);
@@ -79,6 +82,14 @@ if (event.type === "subscription.renewed") {
79
82
  Production calls default to `https://api.proxycheckout.com`. Tests, local
80
83
  development, and previews can pass `apiHost`.
81
84
 
85
+ Configure a production/default payer destination and allowed hosts in the Proxy
86
+ dashboard. `payerDestinationUrl` is optional. Most production integrations can
87
+ omit it and use the dashboard default. Preview, staging, or multi-origin
88
+ environments may pass `payerDestinationUrl` to `sessions.createHandoff(...)`;
89
+ Proxy validates the host against the configured allowed hosts, stores the
90
+ destination on the handoff session, and forwards the payer there when the hosted
91
+ handoff opens.
92
+
82
93
  ## First Publish Decisions
83
94
 
84
95
  The first public package versions are intentionally `0.0.x` because the SDK API is
@@ -18,6 +18,7 @@ export interface CreateProxySessionInput extends CreateProxySessionOptions {
18
18
  };
19
19
  }
20
20
  export interface CreateProxySessionHandoffInput extends CreateProxySessionInput {
21
+ readonly payerDestinationUrl?: string;
21
22
  readonly payHost?: string;
22
23
  readonly publishableKey?: string;
23
24
  }
@@ -47,6 +48,7 @@ export interface MerchantProxySession {
47
48
  readonly email: string | null;
48
49
  readonly phone: string | null;
49
50
  } | null;
51
+ readonly payerDestinationUrl: string | null;
50
52
  readonly providerCheckoutSessionId: string | null;
51
53
  readonly providerCheckoutSessionPsp: string | null;
52
54
  readonly status: string;
@@ -18,6 +18,7 @@ export interface CreateProxySessionInput extends CreateProxySessionOptions {
18
18
  };
19
19
  }
20
20
  export interface CreateProxySessionHandoffInput extends CreateProxySessionInput {
21
+ readonly payerDestinationUrl?: string;
21
22
  readonly payHost?: string;
22
23
  readonly publishableKey?: string;
23
24
  }
@@ -47,6 +48,7 @@ export interface MerchantProxySession {
47
48
  readonly email: string | null;
48
49
  readonly phone: string | null;
49
50
  } | null;
51
+ readonly payerDestinationUrl: string | null;
50
52
  readonly providerCheckoutSessionId: string | null;
51
53
  readonly providerCheckoutSessionPsp: string | null;
52
54
  readonly status: string;
@@ -68,6 +68,9 @@ class ProxySessionsResource {
68
68
  }
69
69
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
70
70
  ...toCreateProxySessionBody(input),
71
+ ...(input.payerDestinationUrl !== undefined
72
+ ? { payer_destination_url: input.payerDestinationUrl }
73
+ : {}),
71
74
  publishable_key: publishableKey,
72
75
  }, {
73
76
  idempotencyKey: input.idempotencyKey,
@@ -232,6 +235,7 @@ function toMerchantProxySession(response) {
232
235
  integrationMode: (0, response_validators_js_1.requireString)(body.integration_mode, "sessions.retrieve.integrationMode"),
233
236
  metadata: (0, response_validators_js_1.requireJsonObject)(body.metadata, "sessions.retrieve.metadata"),
234
237
  payerContact: requireNullablePayerContact(body.payer_contact),
238
+ payerDestinationUrl: (0, response_validators_js_1.requireNullableString)(body.payer_destination_url, "sessions.retrieve.payerDestinationUrl"),
235
239
  providerCheckoutSessionId: (0, response_validators_js_1.requireNullableString)(body.provider_checkout_session_id, "sessions.retrieve.providerCheckoutSessionId"),
236
240
  providerCheckoutSessionPsp: (0, response_validators_js_1.requireNullableString)(body.provider_checkout_session_psp, "sessions.retrieve.providerCheckoutSessionPsp"),
237
241
  status: (0, response_validators_js_1.requireString)(body.status, "sessions.retrieve.status"),
@@ -257,6 +261,7 @@ function toPayerOpenedResult(response) {
257
261
  integrationMode: (0, response_validators_js_1.requireString)(body.integration_mode, "sessions.payerOpened.integrationMode"),
258
262
  metadata: (0, response_validators_js_1.requireJsonObject)(body.metadata, "sessions.payerOpened.metadata"),
259
263
  payerContact: requireNullablePayerContact(body.payer_contact, "sessions.payerOpened"),
264
+ payerDestinationUrl: (0, response_validators_js_1.requireNullableString)(body.payer_destination_url, "sessions.payerOpened.payerDestinationUrl"),
260
265
  providerCheckoutSessionId: (0, response_validators_js_1.requireNullableString)(body.provider_checkout_session_id, "sessions.payerOpened.providerCheckoutSessionId"),
261
266
  providerCheckoutSessionPsp: (0, response_validators_js_1.requireNullableString)(body.provider_checkout_session_psp, "sessions.payerOpened.providerCheckoutSessionPsp"),
262
267
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.35.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-pr-76.35.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.4-prx-88.38.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-prx-88.38.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.35.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-pr-76.35.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.4-prx-88.38.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-prx-88.38.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.4-pr-76.35.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.4-prx-88.38.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -18,6 +18,7 @@ export interface CreateProxySessionInput extends CreateProxySessionOptions {
18
18
  };
19
19
  }
20
20
  export interface CreateProxySessionHandoffInput extends CreateProxySessionInput {
21
+ readonly payerDestinationUrl?: string;
21
22
  readonly payHost?: string;
22
23
  readonly publishableKey?: string;
23
24
  }
@@ -47,6 +48,7 @@ export interface MerchantProxySession {
47
48
  readonly email: string | null;
48
49
  readonly phone: string | null;
49
50
  } | null;
51
+ readonly payerDestinationUrl: string | null;
50
52
  readonly providerCheckoutSessionId: string | null;
51
53
  readonly providerCheckoutSessionPsp: string | null;
52
54
  readonly status: string;
@@ -65,6 +65,9 @@ export class ProxySessionsResource {
65
65
  }
66
66
  const response = await this.httpClient.request("POST", "/proxy_sessions/handoff", {
67
67
  ...toCreateProxySessionBody(input),
68
+ ...(input.payerDestinationUrl !== undefined
69
+ ? { payer_destination_url: input.payerDestinationUrl }
70
+ : {}),
68
71
  publishable_key: publishableKey,
69
72
  }, {
70
73
  idempotencyKey: input.idempotencyKey,
@@ -227,6 +230,7 @@ function toMerchantProxySession(response) {
227
230
  integrationMode: requireString(body.integration_mode, "sessions.retrieve.integrationMode"),
228
231
  metadata: requireJsonObject(body.metadata, "sessions.retrieve.metadata"),
229
232
  payerContact: requireNullablePayerContact(body.payer_contact),
233
+ payerDestinationUrl: requireNullableString(body.payer_destination_url, "sessions.retrieve.payerDestinationUrl"),
230
234
  providerCheckoutSessionId: requireNullableString(body.provider_checkout_session_id, "sessions.retrieve.providerCheckoutSessionId"),
231
235
  providerCheckoutSessionPsp: requireNullableString(body.provider_checkout_session_psp, "sessions.retrieve.providerCheckoutSessionPsp"),
232
236
  status: requireString(body.status, "sessions.retrieve.status"),
@@ -252,6 +256,7 @@ function toPayerOpenedResult(response) {
252
256
  integrationMode: requireString(body.integration_mode, "sessions.payerOpened.integrationMode"),
253
257
  metadata: requireJsonObject(body.metadata, "sessions.payerOpened.metadata"),
254
258
  payerContact: requireNullablePayerContact(body.payer_contact, "sessions.payerOpened"),
259
+ payerDestinationUrl: requireNullableString(body.payer_destination_url, "sessions.payerOpened.payerDestinationUrl"),
255
260
  providerCheckoutSessionId: requireNullableString(body.provider_checkout_session_id, "sessions.payerOpened.providerCheckoutSessionId"),
256
261
  providerCheckoutSessionPsp: requireNullableString(body.provider_checkout_session_psp, "sessions.payerOpened.providerCheckoutSessionPsp"),
257
262
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.35.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-pr-76.35.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.4-prx-88.38.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-prx-88.38.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.35.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.4-prx-88.38.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.4-pr-76.35.1",
10
+ "version": "0.0.4-prx-88.38.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",