@proxy-checkout/server-js 0.0.6-prx-94.52.1 → 0.0.6-prx-101.57.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
@@ -12,8 +12,8 @@ This package should expose the merchant-authenticated backend routes that exist
12
12
  | `proxy.sessions.createHandoff` | `POST /proxy_sessions/handoff` | Create a Proxy session and atomically mark it ready for hosted payer handoff. |
13
13
  | `proxy.sessions.retrieve` | `GET /proxy_sessions/:id/merchant` | Retrieve current merchant-owned session state after a webhook or before creating PSP objects. |
14
14
  | `proxy.sessions.cart.set` | `PUT /proxy_sessions/:id/cart` | Replace the current cart snapshot before payment orchestration. |
15
- | `proxy.sessions.payerHandoff` | `POST /proxy_sessions/:id/payer_handoff` | Record merchant handoff issuance before the payer loads checkout. |
16
- | `proxy.sessions.payerOpened` | `POST /proxy_sessions/:id/payer_opened` | Record checkout open and read the current merchant session/cart state. |
15
+ | `proxy.sessions.payerHandoff` | `POST /proxy_sessions/:id/payer_handoff` | Low-level escape hatch. Most delegated checkout integrations should use `createHandoff`. |
16
+ | `proxy.sessions.payerOpened` | `POST /proxy_sessions/:id/payer_opened` | Low-level escape hatch. Stripe integrations should usually let `@proxy-checkout/stripe-server-js` call this through `openCheckout`. |
17
17
  | `proxy.subscriptions.retrieve` | `GET /subscriptions/:id` | Retrieve current Proxy-linked subscription lifecycle state. |
18
18
  | `proxy.webhookEndpoints.list` | `GET /webhook_endpoints` | List outbound merchant webhook endpoints. |
19
19
  | `proxy.webhookEndpoints.create` | `POST /webhook_endpoints` | Create an outbound endpoint and receive its one-time signing secret. |
@@ -62,6 +62,14 @@ const endpoint = await proxy.webhookEndpoints.create({
62
62
  console.log(endpoint.signingSecret);
63
63
  ```
64
64
 
65
+ For delegated checkout, prefer the high-level flow:
66
+
67
+ 1. Create buyer handoffs with `proxy.sessions.createHandoff(...)`.
68
+ 2. Let `@proxy-checkout/stripe-server-js` `openCheckout(...)` record payer-opened, create the merchant-owned Stripe object, inject required metadata, and record provider binding.
69
+ 3. Let `proxy.webhooks.handle(...)` verify signed Proxy webhooks, resolve current state, and acknowledge initial provisioning.
70
+
71
+ Use `payerHandoff`, `payerOpened`, raw event construction, or manual provisioning acknowledgements only for custom integrations that cannot use the default helpers.
72
+
65
73
  Verify and parse outbound webhooks with the exact raw request body:
66
74
 
67
75
  ```ts
@@ -89,11 +89,12 @@ class ProxySessionsResource {
89
89
  const session = toProxySessionHandoff(response);
90
90
  return {
91
91
  ...session,
92
- handoffUrl: buildHandoffUrl({
93
- payHost,
94
- proxySessionId: session.id,
95
- publishableKey,
96
- }),
92
+ handoffUrl: session.handoffUrl ||
93
+ buildHandoffUrl({
94
+ payHost,
95
+ proxySessionId: session.id,
96
+ publishableKey,
97
+ }),
97
98
  };
98
99
  }
99
100
  async retrieve(proxySessionId, options = {}) {
@@ -239,7 +240,11 @@ function toProxySessionHandoff(response) {
239
240
  const integrationMode = (0, response_validators_js_1.requireString)(body.integration_mode, "sessions.createHandoff.integrationMode");
240
241
  return {
241
242
  expiresAt: (0, response_validators_js_1.requireString)(body.expires_at, "sessions.createHandoff.expiresAt"),
242
- handoffUrl: "",
243
+ handoffUrl: typeof body.handoff_url === "string"
244
+ ? body.handoff_url
245
+ : typeof body.handoffUrl === "string"
246
+ ? body.handoffUrl
247
+ : "",
243
248
  id: (0, response_validators_js_1.requireString)(body.id, "sessions.createHandoff.id"),
244
249
  integrationMode,
245
250
  status,
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.52.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.52.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.57.1";
@@ -1,3 +1,3 @@
1
1
  export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.52.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.52.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.57.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-94.52.1";
5
+ exports.proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
6
6
  exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
@@ -86,11 +86,12 @@ export class ProxySessionsResource {
86
86
  const session = toProxySessionHandoff(response);
87
87
  return {
88
88
  ...session,
89
- handoffUrl: buildHandoffUrl({
90
- payHost,
91
- proxySessionId: session.id,
92
- publishableKey,
93
- }),
89
+ handoffUrl: session.handoffUrl ||
90
+ buildHandoffUrl({
91
+ payHost,
92
+ proxySessionId: session.id,
93
+ publishableKey,
94
+ }),
94
95
  };
95
96
  }
96
97
  async retrieve(proxySessionId, options = {}) {
@@ -234,7 +235,11 @@ function toProxySessionHandoff(response) {
234
235
  const integrationMode = requireString(body.integration_mode, "sessions.createHandoff.integrationMode");
235
236
  return {
236
237
  expiresAt: requireString(body.expires_at, "sessions.createHandoff.expiresAt"),
237
- handoffUrl: "",
238
+ handoffUrl: typeof body.handoff_url === "string"
239
+ ? body.handoff_url
240
+ : typeof body.handoffUrl === "string"
241
+ ? body.handoffUrl
242
+ : "",
238
243
  id: requireString(body.id, "sessions.createHandoff.id"),
239
244
  integrationMode,
240
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-94.52.1";
3
- export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-94.52.1";
2
+ export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
3
+ export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-101.57.1";
@@ -1,3 +1,3 @@
1
1
  export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
2
- export const proxyCheckoutServerSdkVersion = "0.0.6-prx-94.52.1";
2
+ export const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.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-94.52.1",
10
+ "version": "0.0.6-prx-101.57.1",
11
11
  "devDependencies": {
12
12
  "@types/node": "^24.12.4",
13
13
  "@vitest/coverage-v8": "4.1.7",