@proxy-checkout/server-js 0.0.6-prx-94.51.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 +10 -2
- package/dist/cjs/sessions.js +11 -6
- package/dist/cjs/version.d.cts +2 -2
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/esm/sessions.js +11 -6
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
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` |
|
|
16
|
-
| `proxy.sessions.payerOpened` | `POST /proxy_sessions/:id/payer_opened` |
|
|
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
|
package/dist/cjs/sessions.js
CHANGED
|
@@ -89,11 +89,12 @@ class ProxySessionsResource {
|
|
|
89
89
|
const session = toProxySessionHandoff(response);
|
|
90
90
|
return {
|
|
91
91
|
...session,
|
|
92
|
-
handoffUrl:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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,
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-
|
|
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";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-
|
|
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";
|
package/dist/cjs/version.js
CHANGED
|
@@ -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-
|
|
5
|
+
exports.proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
|
|
6
6
|
exports.proxyCheckoutServerSdkUserAgent = `${exports.proxyCheckoutServerSdkName}/${exports.proxyCheckoutServerSdkVersion}`;
|
package/dist/esm/sessions.js
CHANGED
|
@@ -86,11 +86,12 @@ export class ProxySessionsResource {
|
|
|
86
86
|
const session = toProxySessionHandoff(response);
|
|
87
87
|
return {
|
|
88
88
|
...session,
|
|
89
|
-
handoffUrl:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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,
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.6-prx-
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.6-prx-
|
|
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";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export const proxyCheckoutServerSdkVersion = "0.0.6-prx-
|
|
2
|
+
export const proxyCheckoutServerSdkVersion = "0.0.6-prx-101.57.1";
|
|
3
3
|
export const proxyCheckoutServerSdkUserAgent = `${proxyCheckoutServerSdkName}/${proxyCheckoutServerSdkVersion}`;
|
package/package.json
CHANGED