@proxy-checkout/server-js 0.0.8-prx-120.97.1 → 0.0.8-prx-124.117.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
@@ -44,7 +44,9 @@ const handoff = await proxy.sessions.createHandoff({
44
44
  cartSnapshot: {
45
45
  items: [{ product_id: "prod_123", quantity: 1 }],
46
46
  },
47
- idempotencyKey: "order_123",
47
+ // Stable merchant purchase-request id: reuse for retries and every payer
48
+ // invited to this order; use a new id for a genuinely new purchase.
49
+ idempotencyKey: "proxy-session:purchase_request_123",
48
50
  // Optional: omit in normal production flows to use the dashboard default.
49
51
  // Preview/staging/multi-origin environments may override the merchant payer page.
50
52
  payerDestinationUrl: "https://preview.example.com/checkout",
@@ -97,6 +99,10 @@ await proxy.webhooks.handle(request, {
97
99
 
98
100
  For pre-account purchases, create a durable pending entitlement before `sessions.createHandoff(...)`, use that pending entitlement id as `buyerReference`, pass the future recipient's contact as `beneficiaryContact`, and claim the entitlement after signup/login with your own high-entropy claim token. Store only the token hash on the pending entitlement; use `sessionStorage` or an emailed merchant-owned claim link to carry the plaintext token to the authenticated claim endpoint. Treat `proxy_session_id` as public correlation, not as a claim secret.
99
101
 
102
+ Keep purchase identity separate from beneficiary identity. Create a durable merchant purchase-request/order row before `createHandoff`, derive `idempotencyKey` from that row's stable non-PII id, and store the returned Proxy session/handoff on it. Reuse the row and one handoff across HTTP retries and every invited payer. `buyerReference` identifies the entitlement recipient; it is not, by itself, an order key. A repeated purchase by the same beneficiary needs a new purchase-request id even if its offer and amount are unchanged. Do not derive the key from email, payer identity, Stripe Customer id, amount alone, or a per-retry random value.
103
+
104
+ One shared handoff supports simultaneous viewers. Opening never grants checkout ownership or a viewer lease. All authorized viewers can render the same cart/current state; identical provider preparation joins the same order-scoped acquisition, and a completed session remains readable while further provider creation is refused.
105
+
100
106
  Verify and parse outbound webhooks with the exact raw request body:
101
107
 
102
108
  ```ts
@@ -1,4 +1,5 @@
1
1
  import { ProxyEventsResource } from "./events.js";
2
+ import { ProxyProviderAcquisitionsResource } from "./provider-acquisitions.js";
2
3
  import { ProxySessionsResource } from "./sessions.js";
3
4
  import { ProxySubscriptionsResource } from "./subscriptions.js";
4
5
  import type { ProxyCheckoutServerClientOptions } from "./types.js";
@@ -7,6 +8,7 @@ import { ProxyWebhookEndpointsResource } from "./webhooks.js";
7
8
  export declare class ProxyCheckoutServerClient {
8
9
  readonly apiHost: string;
9
10
  readonly sessions: ProxySessionsResource;
11
+ readonly providerAcquisitions: ProxyProviderAcquisitionsResource;
10
12
  readonly subscriptions: ProxySubscriptionsResource;
11
13
  /** Current-state lifecycle resolver for signed webhook events. */
12
14
  readonly events: ProxyEventsResource;
@@ -1,4 +1,5 @@
1
1
  import { ProxyEventsResource } from "./events.js";
2
+ import { ProxyProviderAcquisitionsResource } from "./provider-acquisitions.js";
2
3
  import { ProxySessionsResource } from "./sessions.js";
3
4
  import { ProxySubscriptionsResource } from "./subscriptions.js";
4
5
  import type { ProxyCheckoutServerClientOptions } from "./types.js";
@@ -7,6 +8,7 @@ import { ProxyWebhookEndpointsResource } from "./webhooks.js";
7
8
  export declare class ProxyCheckoutServerClient {
8
9
  readonly apiHost: string;
9
10
  readonly sessions: ProxySessionsResource;
11
+ readonly providerAcquisitions: ProxyProviderAcquisitionsResource;
10
12
  readonly subscriptions: ProxySubscriptionsResource;
11
13
  /** Current-state lifecycle resolver for signed webhook events. */
12
14
  readonly events: ProxyEventsResource;
@@ -4,6 +4,7 @@ exports.ProxyCheckoutServerClient = void 0;
4
4
  exports.createProxyCheckoutServerClient = createProxyCheckoutServerClient;
5
5
  const events_js_1 = require("./events.js");
6
6
  const http_client_js_1 = require("./http-client.js");
7
+ const provider_acquisitions_js_1 = require("./provider-acquisitions.js");
7
8
  const sessions_js_1 = require("./sessions.js");
8
9
  const subscriptions_js_1 = require("./subscriptions.js");
9
10
  const webhook_handler_js_1 = require("./webhook-handler.js");
@@ -11,6 +12,7 @@ const webhooks_js_1 = require("./webhooks.js");
11
12
  class ProxyCheckoutServerClient {
12
13
  apiHost;
13
14
  sessions;
15
+ providerAcquisitions;
14
16
  subscriptions;
15
17
  /** Current-state lifecycle resolver for signed webhook events. */
16
18
  events;
@@ -29,6 +31,7 @@ class ProxyCheckoutServerClient {
29
31
  payHost: options.payHost,
30
32
  publishableKey: options.publishableKey,
31
33
  });
34
+ this.providerAcquisitions = new provider_acquisitions_js_1.ProxyProviderAcquisitionsResource(httpClient);
32
35
  this.subscriptions = new subscriptions_js_1.ProxySubscriptionsResource(httpClient, this.sessions);
33
36
  this.events = new events_js_1.ProxyEventsResource(this.sessions, this.subscriptions);
34
37
  this.webhooks = new webhook_handler_js_1.ProxyWebhooksResource(this.events, this.sessions);
@@ -4,7 +4,7 @@ export interface ProxyCheckoutApiErrorDetails {
4
4
  readonly responseBody: unknown;
5
5
  readonly statusCode: number;
6
6
  }
7
- export type ProxyCheckoutValidationCode = "buyer_reference_mismatch" | "cart_invalid" | "invalid_date" | "provider_binding_mismatch" | "subscription_session_mismatch" | "webhook_sessions_resource_missing";
7
+ export type ProxyCheckoutValidationCode = "buyer_reference_mismatch" | "cart_invalid" | "invalid_date" | "invalid_session_presentation" | "provider_binding_missing" | "provider_binding_mismatch" | "subscription_session_mismatch" | "unsupported_provider_option" | "webhook_sessions_resource_missing";
8
8
  /**
9
9
  * Raised when the SDK receives Proxy data it cannot safely normalize, for
10
10
  * example an invalid date string, a cart snapshot that fails the merchant
@@ -4,7 +4,7 @@ export interface ProxyCheckoutApiErrorDetails {
4
4
  readonly responseBody: unknown;
5
5
  readonly statusCode: number;
6
6
  }
7
- export type ProxyCheckoutValidationCode = "buyer_reference_mismatch" | "cart_invalid" | "invalid_date" | "provider_binding_mismatch" | "subscription_session_mismatch" | "webhook_sessions_resource_missing";
7
+ export type ProxyCheckoutValidationCode = "buyer_reference_mismatch" | "cart_invalid" | "invalid_date" | "invalid_session_presentation" | "provider_binding_missing" | "provider_binding_mismatch" | "subscription_session_mismatch" | "unsupported_provider_option" | "webhook_sessions_resource_missing";
8
8
  /**
9
9
  * Raised when the SDK receives Proxy data it cannot safely normalize, for
10
10
  * example an invalid date string, a cart snapshot that fails the merchant
@@ -4,7 +4,8 @@ export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./c
4
4
  export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, type ResolvedIgnored, type ResolvedInitialProvision, type ResolvedPaymentAttempt, type ResolvedPaymentRisk, type ResolvedProxyEvent, type ResolvedProxyEventKind, type ResolvedSubscriptionCancelled, type ResolvedSubscriptionCancelScheduled, type ResolvedSubscriptionRenewed, type ResolvedTerminalSession, type ResolveProxyEventOptions, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
- export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
7
+ export { type AttachProviderAcquisitionObjectInput, type ProviderAcquisition, type ProviderAcquisitionCheckoutUiMode, type ProviderAcquisitionCommercialMode, type ProviderAcquisitionIntegrationPath, type ProviderAcquisitionObjectType, type ProviderAcquisitionPricingMode, type ProviderAcquisitionReservation, ProxyProviderAcquisitionsResource, proxyCheckoutProviderAcquisitionEndpoints, type ReserveProviderAcquisitionInput, type SupersedeProviderAcquisitionInput, } from "./provider-acquisitions.js";
8
+ export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, type ProxySessionAcquisitionSummary, type ProxySessionActionableNextStep, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionPresentationState, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, type ProxySessionViewStatus, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
8
9
  export { type MerchantProxySubscription, ProxySubscriptionsResource, type ProxySubscriptionWithSession, type ProxySubscriptionWithUntypedSession, proxyCheckoutSubscriptionEndpoints, } from "./subscriptions.js";
9
10
  export type { JsonObject, JsonPrimitive, JsonValue, ProxyCheckoutFetch, ProxyCheckoutServerClientOptions, ProxyCheckoutServerRequestOptions, } from "./types.js";
10
11
  export { proxyCheckoutServerSdkName, proxyCheckoutServerSdkUserAgent, proxyCheckoutServerSdkVersion, } from "./version.js";
@@ -4,7 +4,8 @@ export { assertCartBuyerReference, assertSubscriptionMatchesSession, } from "./c
4
4
  export { isProxySessionNotFoundError, PROXY_SESSION_NOT_FOUND_ERROR_CODE, ProxyCheckoutApiError, type ProxyCheckoutApiErrorDetails, type ProxyCheckoutValidationCode, ProxyCheckoutValidationError, } from "./errors.js";
5
5
  export { ProxyEventsResource, type ResolvedIgnored, type ResolvedInitialProvision, type ResolvedPaymentAttempt, type ResolvedPaymentRisk, type ResolvedProxyEvent, type ResolvedProxyEventKind, type ResolvedSubscriptionCancelled, type ResolvedSubscriptionCancelScheduled, type ResolvedSubscriptionRenewed, type ResolvedTerminalSession, type ResolveProxyEventOptions, } from "./events.js";
6
6
  export { AT_RISK_SUBSCRIPTION_STATUSES, ENDED_SUBSCRIPTION_STATUSES, isSessionProvisionable, isSessionTerminal, isSubscriptionEnded, isSubscriptionPaymentAtRisk, PROVISIONABLE_SESSION_STATUSES, parseOptionalProxyDate, requireProxyDate, subscriptionAccessEndsAt, subscriptionWillRenew, TERMINAL_SESSION_STATUSES, } from "./lifecycle.js";
7
- export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
7
+ export { type AttachProviderAcquisitionObjectInput, type ProviderAcquisition, type ProviderAcquisitionCheckoutUiMode, type ProviderAcquisitionCommercialMode, type ProviderAcquisitionIntegrationPath, type ProviderAcquisitionObjectType, type ProviderAcquisitionPricingMode, type ProviderAcquisitionReservation, ProxyProviderAcquisitionsResource, proxyCheckoutProviderAcquisitionEndpoints, type ReserveProviderAcquisitionInput, type SupersedeProviderAcquisitionInput, } from "./provider-acquisitions.js";
8
+ export { type CreateProxySessionHandoffInput, type CreateProxySessionInput, type CreateProxySessionOptions, type MarkProxySessionProvisionedInput, type MarkProxySessionProvisioningFailedInput, type MerchantProxySession, type PayerHandoffResult, type PayerOpenedResult, type ProxySession, type ProxySessionAcquisitionSummary, type ProxySessionActionableNextStep, ProxySessionCartResource, type ProxySessionCartResult, type ProxySessionHandoff, type ProxySessionPresentationState, type ProxySessionProviderBinding, type ProxySessionProvisioningAcknowledgement, ProxySessionsResource, type ProxySessionViewStatus, proxyCheckoutServerEndpoints, type RecordProviderBindingInput, type SetProxySessionCartInput, type TypedMerchantProxySession, } from "./sessions.js";
8
9
  export { type MerchantProxySubscription, ProxySubscriptionsResource, type ProxySubscriptionWithSession, type ProxySubscriptionWithUntypedSession, proxyCheckoutSubscriptionEndpoints, } from "./subscriptions.js";
9
10
  export type { JsonObject, JsonPrimitive, JsonValue, ProxyCheckoutFetch, ProxyCheckoutServerClientOptions, ProxyCheckoutServerRequestOptions, } from "./types.js";
10
11
  export { proxyCheckoutServerSdkName, proxyCheckoutServerSdkUserAgent, proxyCheckoutServerSdkVersion, } from "./version.js";
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyProxyWebhookSignature = exports.proxyCheckoutWebhookEndpointEndpoints = exports.ProxyWebhookSignatureVerificationError = exports.ProxyWebhookEndpointsResource = exports.PROXY_SIGNATURE_HEADER = exports.constructProxyWebhookEvent = exports.ProxyWebhooksResource = exports.PROXY_WEBHOOK_RETRY_AFTER_SECONDS = exports.PROXY_WEBHOOK_EVENT_TYPES = exports.isProxySubscriptionEvent = exports.isProxyShopifyEvent = exports.isProxySessionEvent = exports.isProxyPaymentAttemptEvent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkName = exports.proxyCheckoutSubscriptionEndpoints = exports.ProxySubscriptionsResource = exports.proxyCheckoutServerEndpoints = exports.ProxySessionsResource = exports.ProxySessionCartResource = exports.TERMINAL_SESSION_STATUSES = exports.subscriptionWillRenew = exports.subscriptionAccessEndsAt = exports.requireProxyDate = exports.parseOptionalProxyDate = exports.PROVISIONABLE_SESSION_STATUSES = exports.isSubscriptionPaymentAtRisk = exports.isSubscriptionEnded = exports.isSessionTerminal = exports.isSessionProvisionable = exports.ENDED_SUBSCRIPTION_STATUSES = exports.AT_RISK_SUBSCRIPTION_STATUSES = exports.ProxyEventsResource = exports.ProxyCheckoutValidationError = exports.ProxyCheckoutApiError = exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE = exports.isProxySessionNotFoundError = exports.assertSubscriptionMatchesSession = exports.assertCartBuyerReference = exports.ProxyCheckoutServerClient = exports.createProxyCheckoutServerClient = exports.parseProxyCart = void 0;
3
+ exports.verifyProxyWebhookSignature = exports.proxyCheckoutWebhookEndpointEndpoints = exports.ProxyWebhookSignatureVerificationError = exports.ProxyWebhookEndpointsResource = exports.PROXY_SIGNATURE_HEADER = exports.constructProxyWebhookEvent = exports.ProxyWebhooksResource = exports.PROXY_WEBHOOK_RETRY_AFTER_SECONDS = exports.PROXY_WEBHOOK_EVENT_TYPES = exports.isProxySubscriptionEvent = exports.isProxyShopifyEvent = exports.isProxySessionEvent = exports.isProxyPaymentAttemptEvent = exports.proxyCheckoutServerSdkVersion = exports.proxyCheckoutServerSdkUserAgent = exports.proxyCheckoutServerSdkName = exports.proxyCheckoutSubscriptionEndpoints = exports.ProxySubscriptionsResource = exports.proxyCheckoutServerEndpoints = exports.ProxySessionsResource = exports.ProxySessionCartResource = exports.proxyCheckoutProviderAcquisitionEndpoints = exports.ProxyProviderAcquisitionsResource = exports.TERMINAL_SESSION_STATUSES = exports.subscriptionWillRenew = exports.subscriptionAccessEndsAt = exports.requireProxyDate = exports.parseOptionalProxyDate = exports.PROVISIONABLE_SESSION_STATUSES = exports.isSubscriptionPaymentAtRisk = exports.isSubscriptionEnded = exports.isSessionTerminal = exports.isSessionProvisionable = exports.ENDED_SUBSCRIPTION_STATUSES = exports.AT_RISK_SUBSCRIPTION_STATUSES = exports.ProxyEventsResource = exports.ProxyCheckoutValidationError = exports.ProxyCheckoutApiError = exports.PROXY_SESSION_NOT_FOUND_ERROR_CODE = exports.isProxySessionNotFoundError = exports.assertSubscriptionMatchesSession = exports.assertCartBuyerReference = exports.ProxyCheckoutServerClient = exports.createProxyCheckoutServerClient = exports.parseProxyCart = void 0;
4
4
  var cart_js_1 = require("./cart.js");
5
5
  Object.defineProperty(exports, "parseProxyCart", { enumerable: true, get: function () { return cart_js_1.parseProxyCart; } });
6
6
  var client_js_1 = require("./client.js");
@@ -29,6 +29,9 @@ Object.defineProperty(exports, "requireProxyDate", { enumerable: true, get: func
29
29
  Object.defineProperty(exports, "subscriptionAccessEndsAt", { enumerable: true, get: function () { return lifecycle_js_1.subscriptionAccessEndsAt; } });
30
30
  Object.defineProperty(exports, "subscriptionWillRenew", { enumerable: true, get: function () { return lifecycle_js_1.subscriptionWillRenew; } });
31
31
  Object.defineProperty(exports, "TERMINAL_SESSION_STATUSES", { enumerable: true, get: function () { return lifecycle_js_1.TERMINAL_SESSION_STATUSES; } });
32
+ var provider_acquisitions_js_1 = require("./provider-acquisitions.js");
33
+ Object.defineProperty(exports, "ProxyProviderAcquisitionsResource", { enumerable: true, get: function () { return provider_acquisitions_js_1.ProxyProviderAcquisitionsResource; } });
34
+ Object.defineProperty(exports, "proxyCheckoutProviderAcquisitionEndpoints", { enumerable: true, get: function () { return provider_acquisitions_js_1.proxyCheckoutProviderAcquisitionEndpoints; } });
32
35
  var sessions_js_1 = require("./sessions.js");
33
36
  Object.defineProperty(exports, "ProxySessionCartResource", { enumerable: true, get: function () { return sessions_js_1.ProxySessionCartResource; } });
34
37
  Object.defineProperty(exports, "ProxySessionsResource", { enumerable: true, get: function () { return sessions_js_1.ProxySessionsResource; } });
@@ -0,0 +1,98 @@
1
+ import type { ProxyCheckoutHttpClient } from "./http-client.js";
2
+ import type { ProxyCheckoutServerRequestOptions } from "./types.js";
3
+ export type ProviderAcquisitionCommercialMode = "one_time" | "subscription";
4
+ export type ProviderAcquisitionIntegrationPath = "checkout_session" | "direct_subscription" | "payment_intent";
5
+ export type ProviderAcquisitionCheckoutUiMode = "custom" | "embedded" | "hosted";
6
+ export type ProviderAcquisitionPricingMode = "fixed" | "provider_finalized";
7
+ export type ProviderAcquisitionObjectType = "checkout_session" | "payment_intent" | "setup_intent" | "subscription";
8
+ export interface ProviderAcquisition {
9
+ readonly attemptNumber: number;
10
+ readonly checkoutUiMode: ProviderAcquisitionCheckoutUiMode | "unknown" | null;
11
+ readonly commercialMode: ProviderAcquisitionCommercialMode;
12
+ readonly completionRecordedAt: string | null;
13
+ readonly createdAt: string;
14
+ readonly directFeeBasisSource: string | null;
15
+ readonly directMerchandiseCurrency: string | null;
16
+ readonly directMerchandiseSubtotalMinor: number | null;
17
+ readonly id: string;
18
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
19
+ readonly merchantPspConfigId: string;
20
+ readonly pricingMode: ProviderAcquisitionPricingMode;
21
+ readonly providerCreatedAt: string | null;
22
+ /** Stripe Customer ID retained only as a merchant-authenticated diagnostic. */
23
+ readonly providerCustomerId: string | null;
24
+ readonly providerRetryNotAfter: string;
25
+ readonly providerRootObjectId: string | null;
26
+ readonly providerRootObjectType: ProviderAcquisitionObjectType | null;
27
+ readonly providerSetupIntentId: string | null;
28
+ readonly proxySessionId: string;
29
+ readonly psp: "stripe";
30
+ readonly status: string;
31
+ readonly statusReason: string | null;
32
+ readonly supersedesAttemptId: string | null;
33
+ readonly updatedAt: string;
34
+ readonly version: number;
35
+ }
36
+ export interface ProviderAcquisitionReservation {
37
+ readonly acquisitionAttempt: ProviderAcquisition;
38
+ readonly stripe: {
39
+ readonly idempotencyKeys: {
40
+ readonly root: string;
41
+ readonly setupIntent?: string;
42
+ };
43
+ readonly metadata: {
44
+ readonly proxyAcquisitionAttemptId: string;
45
+ readonly proxyContractVersion: "2";
46
+ readonly proxySessionId: string;
47
+ };
48
+ };
49
+ }
50
+ export interface ReserveProviderAcquisitionInput extends ProxyCheckoutServerRequestOptions {
51
+ readonly checkoutUiMode?: ProviderAcquisitionCheckoutUiMode;
52
+ readonly commercialMode: ProviderAcquisitionCommercialMode;
53
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
54
+ /** Optional server-only direct PaymentIntent percentage basis; omit to use verified provider gross. */
55
+ readonly merchandiseSubtotalMinor?: number;
56
+ readonly pricingMode: ProviderAcquisitionPricingMode;
57
+ readonly providerOptionsFingerprint: string;
58
+ }
59
+ export interface AttachProviderAcquisitionObjectInput extends ProxyCheckoutServerRequestOptions {
60
+ readonly expectedVersion: number;
61
+ readonly objectId: string;
62
+ readonly objectType: ProviderAcquisitionObjectType;
63
+ readonly role: "root" | "setup_intent";
64
+ }
65
+ export interface SupersedeProviderAcquisitionInput extends ProxyCheckoutServerRequestOptions {
66
+ readonly expectedVersion: number;
67
+ readonly reason: string;
68
+ readonly replacement: {
69
+ readonly checkoutUiMode?: ProviderAcquisitionCheckoutUiMode;
70
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
71
+ readonly providerOptionsFingerprint: string;
72
+ };
73
+ }
74
+ export declare const proxyCheckoutProviderAcquisitionEndpoints: readonly [{
75
+ readonly method: "POST";
76
+ readonly operation: "providerAcquisitions.reserveProviderAcquisition";
77
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts";
78
+ }, {
79
+ readonly method: "POST";
80
+ readonly operation: "providerAcquisitions.attachProviderAcquisitionObject";
81
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/provider_objects";
82
+ }, {
83
+ readonly method: "POST";
84
+ readonly operation: "providerAcquisitions.supersedeProviderAcquisition";
85
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/supersede";
86
+ }, {
87
+ readonly method: "GET";
88
+ readonly operation: "providerAcquisitions.listProviderAcquisitions";
89
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts";
90
+ }];
91
+ export declare class ProxyProviderAcquisitionsResource {
92
+ private readonly httpClient;
93
+ constructor(httpClient: ProxyCheckoutHttpClient);
94
+ reserveProviderAcquisition(proxySessionId: string, input: ReserveProviderAcquisitionInput): Promise<ProviderAcquisitionReservation>;
95
+ attachProviderAcquisitionObject(proxySessionId: string, acquisitionAttemptId: string, input: AttachProviderAcquisitionObjectInput): Promise<ProviderAcquisition>;
96
+ supersedeProviderAcquisition(proxySessionId: string, acquisitionAttemptId: string, input: SupersedeProviderAcquisitionInput): Promise<ProviderAcquisitionReservation>;
97
+ listProviderAcquisitions(proxySessionId: string, options?: ProxyCheckoutServerRequestOptions): Promise<ProviderAcquisition[]>;
98
+ }
@@ -0,0 +1,98 @@
1
+ import type { ProxyCheckoutHttpClient } from "./http-client.js";
2
+ import type { ProxyCheckoutServerRequestOptions } from "./types.js";
3
+ export type ProviderAcquisitionCommercialMode = "one_time" | "subscription";
4
+ export type ProviderAcquisitionIntegrationPath = "checkout_session" | "direct_subscription" | "payment_intent";
5
+ export type ProviderAcquisitionCheckoutUiMode = "custom" | "embedded" | "hosted";
6
+ export type ProviderAcquisitionPricingMode = "fixed" | "provider_finalized";
7
+ export type ProviderAcquisitionObjectType = "checkout_session" | "payment_intent" | "setup_intent" | "subscription";
8
+ export interface ProviderAcquisition {
9
+ readonly attemptNumber: number;
10
+ readonly checkoutUiMode: ProviderAcquisitionCheckoutUiMode | "unknown" | null;
11
+ readonly commercialMode: ProviderAcquisitionCommercialMode;
12
+ readonly completionRecordedAt: string | null;
13
+ readonly createdAt: string;
14
+ readonly directFeeBasisSource: string | null;
15
+ readonly directMerchandiseCurrency: string | null;
16
+ readonly directMerchandiseSubtotalMinor: number | null;
17
+ readonly id: string;
18
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
19
+ readonly merchantPspConfigId: string;
20
+ readonly pricingMode: ProviderAcquisitionPricingMode;
21
+ readonly providerCreatedAt: string | null;
22
+ /** Stripe Customer ID retained only as a merchant-authenticated diagnostic. */
23
+ readonly providerCustomerId: string | null;
24
+ readonly providerRetryNotAfter: string;
25
+ readonly providerRootObjectId: string | null;
26
+ readonly providerRootObjectType: ProviderAcquisitionObjectType | null;
27
+ readonly providerSetupIntentId: string | null;
28
+ readonly proxySessionId: string;
29
+ readonly psp: "stripe";
30
+ readonly status: string;
31
+ readonly statusReason: string | null;
32
+ readonly supersedesAttemptId: string | null;
33
+ readonly updatedAt: string;
34
+ readonly version: number;
35
+ }
36
+ export interface ProviderAcquisitionReservation {
37
+ readonly acquisitionAttempt: ProviderAcquisition;
38
+ readonly stripe: {
39
+ readonly idempotencyKeys: {
40
+ readonly root: string;
41
+ readonly setupIntent?: string;
42
+ };
43
+ readonly metadata: {
44
+ readonly proxyAcquisitionAttemptId: string;
45
+ readonly proxyContractVersion: "2";
46
+ readonly proxySessionId: string;
47
+ };
48
+ };
49
+ }
50
+ export interface ReserveProviderAcquisitionInput extends ProxyCheckoutServerRequestOptions {
51
+ readonly checkoutUiMode?: ProviderAcquisitionCheckoutUiMode;
52
+ readonly commercialMode: ProviderAcquisitionCommercialMode;
53
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
54
+ /** Optional server-only direct PaymentIntent percentage basis; omit to use verified provider gross. */
55
+ readonly merchandiseSubtotalMinor?: number;
56
+ readonly pricingMode: ProviderAcquisitionPricingMode;
57
+ readonly providerOptionsFingerprint: string;
58
+ }
59
+ export interface AttachProviderAcquisitionObjectInput extends ProxyCheckoutServerRequestOptions {
60
+ readonly expectedVersion: number;
61
+ readonly objectId: string;
62
+ readonly objectType: ProviderAcquisitionObjectType;
63
+ readonly role: "root" | "setup_intent";
64
+ }
65
+ export interface SupersedeProviderAcquisitionInput extends ProxyCheckoutServerRequestOptions {
66
+ readonly expectedVersion: number;
67
+ readonly reason: string;
68
+ readonly replacement: {
69
+ readonly checkoutUiMode?: ProviderAcquisitionCheckoutUiMode;
70
+ readonly integrationPath: ProviderAcquisitionIntegrationPath;
71
+ readonly providerOptionsFingerprint: string;
72
+ };
73
+ }
74
+ export declare const proxyCheckoutProviderAcquisitionEndpoints: readonly [{
75
+ readonly method: "POST";
76
+ readonly operation: "providerAcquisitions.reserveProviderAcquisition";
77
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts";
78
+ }, {
79
+ readonly method: "POST";
80
+ readonly operation: "providerAcquisitions.attachProviderAcquisitionObject";
81
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/provider_objects";
82
+ }, {
83
+ readonly method: "POST";
84
+ readonly operation: "providerAcquisitions.supersedeProviderAcquisition";
85
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/supersede";
86
+ }, {
87
+ readonly method: "GET";
88
+ readonly operation: "providerAcquisitions.listProviderAcquisitions";
89
+ readonly path: "/proxy_sessions/:proxy_session_id/acquisition_attempts";
90
+ }];
91
+ export declare class ProxyProviderAcquisitionsResource {
92
+ private readonly httpClient;
93
+ constructor(httpClient: ProxyCheckoutHttpClient);
94
+ reserveProviderAcquisition(proxySessionId: string, input: ReserveProviderAcquisitionInput): Promise<ProviderAcquisitionReservation>;
95
+ attachProviderAcquisitionObject(proxySessionId: string, acquisitionAttemptId: string, input: AttachProviderAcquisitionObjectInput): Promise<ProviderAcquisition>;
96
+ supersedeProviderAcquisition(proxySessionId: string, acquisitionAttemptId: string, input: SupersedeProviderAcquisitionInput): Promise<ProviderAcquisitionReservation>;
97
+ listProviderAcquisitions(proxySessionId: string, options?: ProxyCheckoutServerRequestOptions): Promise<ProviderAcquisition[]>;
98
+ }
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProxyProviderAcquisitionsResource = exports.proxyCheckoutProviderAcquisitionEndpoints = void 0;
4
+ const response_validators_js_1 = require("./response-validators.js");
5
+ exports.proxyCheckoutProviderAcquisitionEndpoints = [
6
+ {
7
+ method: "POST",
8
+ operation: "providerAcquisitions.reserveProviderAcquisition",
9
+ path: "/proxy_sessions/:proxy_session_id/acquisition_attempts",
10
+ },
11
+ {
12
+ method: "POST",
13
+ operation: "providerAcquisitions.attachProviderAcquisitionObject",
14
+ path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/provider_objects",
15
+ },
16
+ {
17
+ method: "POST",
18
+ operation: "providerAcquisitions.supersedeProviderAcquisition",
19
+ path: "/proxy_sessions/:proxy_session_id/acquisition_attempts/:acquisition_attempt_id/supersede",
20
+ },
21
+ {
22
+ method: "GET",
23
+ operation: "providerAcquisitions.listProviderAcquisitions",
24
+ path: "/proxy_sessions/:proxy_session_id/acquisition_attempts",
25
+ },
26
+ ];
27
+ class ProxyProviderAcquisitionsResource {
28
+ httpClient;
29
+ constructor(httpClient) {
30
+ this.httpClient = httpClient;
31
+ }
32
+ async reserveProviderAcquisition(proxySessionId, input) {
33
+ const response = await this.httpClient.request("POST", `/proxy_sessions/${encodeURIComponent(proxySessionId)}/acquisition_attempts`, {
34
+ ...(input.checkoutUiMode === undefined ? {} : { checkout_ui_mode: input.checkoutUiMode }),
35
+ commercial_mode: input.commercialMode,
36
+ integration_path: input.integrationPath,
37
+ ...(input.merchandiseSubtotalMinor === undefined
38
+ ? {}
39
+ : { merchandise_subtotal_minor: input.merchandiseSubtotalMinor }),
40
+ pricing_mode: input.pricingMode,
41
+ provider_options_fingerprint: input.providerOptionsFingerprint,
42
+ }, { requestId: input.requestId });
43
+ return parseReservation(response, "providerAcquisitions.reserveProviderAcquisition");
44
+ }
45
+ async attachProviderAcquisitionObject(proxySessionId, acquisitionAttemptId, input) {
46
+ const response = await this.httpClient.request("POST", `/proxy_sessions/${encodeURIComponent(proxySessionId)}/acquisition_attempts/${encodeURIComponent(acquisitionAttemptId)}/provider_objects`, {
47
+ expected_version: input.expectedVersion,
48
+ object_id: input.objectId,
49
+ object_type: input.objectType,
50
+ role: input.role,
51
+ }, { requestId: input.requestId });
52
+ return parseAcquisition(response, "providerAcquisitions.attachProviderAcquisitionObject");
53
+ }
54
+ async supersedeProviderAcquisition(proxySessionId, acquisitionAttemptId, input) {
55
+ const response = await this.httpClient.request("POST", `/proxy_sessions/${encodeURIComponent(proxySessionId)}/acquisition_attempts/${encodeURIComponent(acquisitionAttemptId)}/supersede`, {
56
+ expected_version: input.expectedVersion,
57
+ reason: input.reason,
58
+ replacement: {
59
+ ...(input.replacement.checkoutUiMode === undefined
60
+ ? {}
61
+ : { checkout_ui_mode: input.replacement.checkoutUiMode }),
62
+ integration_path: input.replacement.integrationPath,
63
+ provider_options_fingerprint: input.replacement.providerOptionsFingerprint,
64
+ },
65
+ }, { requestId: input.requestId });
66
+ return parseReservation(response, "providerAcquisitions.supersedeProviderAcquisition");
67
+ }
68
+ async listProviderAcquisitions(proxySessionId, options = {}) {
69
+ const response = await this.httpClient.request("GET", `/proxy_sessions/${encodeURIComponent(proxySessionId)}/acquisition_attempts`, undefined, options);
70
+ const body = (0, response_validators_js_1.requireJsonObject)(response, "providerAcquisitions.listProviderAcquisitions");
71
+ if (!Array.isArray(body.data)) {
72
+ throw new Error("Proxy API response field providerAcquisitions.listProviderAcquisitions.data must be an array.");
73
+ }
74
+ return body.data.map((value, index) => parseAcquisition(value, `providerAcquisitions.listProviderAcquisitions.data[${index}]`));
75
+ }
76
+ }
77
+ exports.ProxyProviderAcquisitionsResource = ProxyProviderAcquisitionsResource;
78
+ function parseReservation(value, operation) {
79
+ const body = (0, response_validators_js_1.requireJsonObject)(value, operation);
80
+ const stripe = (0, response_validators_js_1.requireJsonObject)(body.stripe, `${operation}.stripe`);
81
+ const idempotencyKeys = (0, response_validators_js_1.requireJsonObject)(stripe.idempotency_keys, `${operation}.stripe.idempotencyKeys`);
82
+ const metadata = (0, response_validators_js_1.requireJsonObject)(stripe.metadata, `${operation}.stripe.metadata`);
83
+ const contractVersion = (0, response_validators_js_1.requireString)(metadata.proxy_contract_version, `${operation}.stripe.metadata.proxyContractVersion`);
84
+ if (contractVersion !== "2") {
85
+ throw new Error(`Proxy API response field ${operation}.stripe.metadata.proxyContractVersion is unsupported.`);
86
+ }
87
+ const setupIntent = idempotencyKeys.setup_intent;
88
+ return {
89
+ acquisitionAttempt: parseAcquisition(body.acquisition_attempt, `${operation}.acquisitionAttempt`),
90
+ stripe: {
91
+ idempotencyKeys: {
92
+ root: (0, response_validators_js_1.requireString)(idempotencyKeys.root, `${operation}.stripe.idempotencyKeys.root`),
93
+ ...(setupIntent === undefined
94
+ ? {}
95
+ : {
96
+ setupIntent: (0, response_validators_js_1.requireString)(setupIntent, `${operation}.stripe.idempotencyKeys.setupIntent`),
97
+ }),
98
+ },
99
+ metadata: {
100
+ proxyAcquisitionAttemptId: (0, response_validators_js_1.requireString)(metadata.proxy_acquisition_attempt_id, `${operation}.stripe.metadata.proxyAcquisitionAttemptId`),
101
+ proxyContractVersion: contractVersion,
102
+ proxySessionId: (0, response_validators_js_1.requireString)(metadata.proxy_session_id, `${operation}.stripe.metadata.proxySessionId`),
103
+ },
104
+ },
105
+ };
106
+ }
107
+ function parseAcquisition(value, operation) {
108
+ const body = (0, response_validators_js_1.requireJsonObject)(value, operation);
109
+ return {
110
+ attemptNumber: (0, response_validators_js_1.requireInteger)(body.attempt_number, `${operation}.attemptNumber`),
111
+ checkoutUiMode: (0, response_validators_js_1.requireNullableString)(body.checkout_ui_mode, `${operation}.checkoutUiMode`),
112
+ commercialMode: (0, response_validators_js_1.requireString)(body.commercial_mode, `${operation}.commercialMode`),
113
+ completionRecordedAt: (0, response_validators_js_1.requireNullableString)(body.completion_recorded_at, `${operation}.completionRecordedAt`),
114
+ createdAt: (0, response_validators_js_1.requireString)(body.created_at, `${operation}.createdAt`),
115
+ directFeeBasisSource: (0, response_validators_js_1.requireNullableString)(body.direct_fee_basis_source, `${operation}.directFeeBasisSource`),
116
+ directMerchandiseCurrency: (0, response_validators_js_1.requireNullableString)(body.direct_merchandise_currency, `${operation}.directMerchandiseCurrency`),
117
+ directMerchandiseSubtotalMinor: (0, response_validators_js_1.requireNullableInteger)(body.direct_merchandise_subtotal_minor, `${operation}.directMerchandiseSubtotalMinor`),
118
+ id: (0, response_validators_js_1.requireString)(body.id, `${operation}.id`),
119
+ integrationPath: (0, response_validators_js_1.requireString)(body.integration_path, `${operation}.integrationPath`),
120
+ merchantPspConfigId: (0, response_validators_js_1.requireString)(body.merchant_psp_config_id, `${operation}.merchantPspConfigId`),
121
+ pricingMode: (0, response_validators_js_1.requireString)(body.pricing_mode, `${operation}.pricingMode`),
122
+ providerCreatedAt: (0, response_validators_js_1.requireNullableString)(body.provider_created_at, `${operation}.providerCreatedAt`),
123
+ providerCustomerId: (0, response_validators_js_1.requireNullableString)(body.provider_customer_id, `${operation}.providerCustomerId`),
124
+ providerRetryNotAfter: (0, response_validators_js_1.requireString)(body.provider_retry_not_after, `${operation}.providerRetryNotAfter`),
125
+ providerRootObjectId: (0, response_validators_js_1.requireNullableString)(body.provider_root_object_id, `${operation}.providerRootObjectId`),
126
+ providerRootObjectType: (0, response_validators_js_1.requireNullableString)(body.provider_root_object_type, `${operation}.providerRootObjectType`),
127
+ providerSetupIntentId: (0, response_validators_js_1.requireNullableString)(body.provider_setup_intent_id, `${operation}.providerSetupIntentId`),
128
+ proxySessionId: (0, response_validators_js_1.requireString)(body.proxy_session_id, `${operation}.proxySessionId`),
129
+ psp: (0, response_validators_js_1.requireString)(body.psp, `${operation}.psp`),
130
+ status: (0, response_validators_js_1.requireString)(body.status, `${operation}.status`),
131
+ statusReason: (0, response_validators_js_1.requireNullableString)(body.status_reason, `${operation}.statusReason`),
132
+ supersedesAttemptId: (0, response_validators_js_1.requireNullableString)(body.supersedes_attempt_id, `${operation}.supersedesAttemptId`),
133
+ updatedAt: (0, response_validators_js_1.requireString)(body.updated_at, `${operation}.updatedAt`),
134
+ version: (0, response_validators_js_1.requireInteger)(body.version, `${operation}.version`),
135
+ };
136
+ }
@@ -37,6 +37,7 @@ export interface ProxySessionHandoff extends ProxySession {
37
37
  readonly status: "payer_handoff_pending" | "payer_opened";
38
38
  }
39
39
  export interface MerchantProxySession {
40
+ readonly actionableNextStep: ProxySessionActionableNextStep;
40
41
  readonly amountMinor: number;
41
42
  readonly beneficiaryContact: {
42
43
  readonly email: string | null;
@@ -45,8 +46,10 @@ export interface MerchantProxySession {
45
46
  readonly buyerReference: string;
46
47
  readonly cartSnapshot: JsonObject;
47
48
  readonly cartVersion: number;
49
+ readonly completedAcquisitionAttemptId: string | null;
48
50
  readonly createdAt: string;
49
51
  readonly currency: string;
52
+ readonly currentAcquisitionAttempt: ProxySessionAcquisitionSummary | null;
50
53
  readonly expiresAt: string;
51
54
  readonly id: string;
52
55
  readonly idempotencyKey: string | null;
@@ -57,14 +60,27 @@ export interface MerchantProxySession {
57
60
  readonly phone: string | null;
58
61
  } | null;
59
62
  readonly payerDestinationUrl: string | null;
63
+ readonly presentationState: ProxySessionPresentationState;
60
64
  readonly providerCheckoutSessionId: string | null;
61
65
  readonly providerCheckoutSessionPsp: string | null;
62
66
  readonly status: string;
63
67
  readonly updatedAt: string;
64
68
  }
69
+ export interface ProxySessionAcquisitionSummary {
70
+ readonly attemptNumber: number;
71
+ readonly checkoutUiMode: string | null;
72
+ readonly id: string;
73
+ readonly integrationPath: string;
74
+ readonly status: string;
75
+ readonly statusReason: string | null;
76
+ }
77
+ export type ProxySessionActionableNextStep = "already_paid" | "continue_payment" | "merchant_action_required" | "prepare_provider" | "unavailable";
65
78
  export interface PayerOpenedResult extends MerchantProxySession {
66
- readonly status: "payer_opened";
79
+ readonly presentationState: ProxySessionPresentationState;
80
+ readonly status: ProxySessionViewStatus;
67
81
  }
82
+ export type ProxySessionPresentationState = "action_required" | "already_paid" | "checkout_available" | "unavailable";
83
+ export type ProxySessionViewStatus = "cancelled" | "created" | "expired" | "failed" | "merchant_action_required" | "paid" | "payer_handoff_pending" | "payer_opened" | "payment_pending" | "provisionable" | "provisioned" | "provisioning_failed";
68
84
  /** A merchant session with its cart snapshot validated against a merchant schema. */
69
85
  export interface TypedMerchantProxySession<TCart> extends MerchantProxySession {
70
86
  readonly cart: TCart;
@@ -85,6 +101,8 @@ export interface ProxySessionCartResult {
85
101
  readonly currency: string;
86
102
  }
87
103
  export interface RecordProviderBindingInput extends ProxyCheckoutServerRequestOptions {
104
+ /** Checkout commercial mode used only to safely infer the deprecated binding into an acquisition. */
105
+ readonly commercialMode?: "one_time" | "subscription";
88
106
  readonly providerCheckoutSessionId: string;
89
107
  readonly psp: string;
90
108
  }
@@ -37,6 +37,7 @@ export interface ProxySessionHandoff extends ProxySession {
37
37
  readonly status: "payer_handoff_pending" | "payer_opened";
38
38
  }
39
39
  export interface MerchantProxySession {
40
+ readonly actionableNextStep: ProxySessionActionableNextStep;
40
41
  readonly amountMinor: number;
41
42
  readonly beneficiaryContact: {
42
43
  readonly email: string | null;
@@ -45,8 +46,10 @@ export interface MerchantProxySession {
45
46
  readonly buyerReference: string;
46
47
  readonly cartSnapshot: JsonObject;
47
48
  readonly cartVersion: number;
49
+ readonly completedAcquisitionAttemptId: string | null;
48
50
  readonly createdAt: string;
49
51
  readonly currency: string;
52
+ readonly currentAcquisitionAttempt: ProxySessionAcquisitionSummary | null;
50
53
  readonly expiresAt: string;
51
54
  readonly id: string;
52
55
  readonly idempotencyKey: string | null;
@@ -57,14 +60,27 @@ export interface MerchantProxySession {
57
60
  readonly phone: string | null;
58
61
  } | null;
59
62
  readonly payerDestinationUrl: string | null;
63
+ readonly presentationState: ProxySessionPresentationState;
60
64
  readonly providerCheckoutSessionId: string | null;
61
65
  readonly providerCheckoutSessionPsp: string | null;
62
66
  readonly status: string;
63
67
  readonly updatedAt: string;
64
68
  }
69
+ export interface ProxySessionAcquisitionSummary {
70
+ readonly attemptNumber: number;
71
+ readonly checkoutUiMode: string | null;
72
+ readonly id: string;
73
+ readonly integrationPath: string;
74
+ readonly status: string;
75
+ readonly statusReason: string | null;
76
+ }
77
+ export type ProxySessionActionableNextStep = "already_paid" | "continue_payment" | "merchant_action_required" | "prepare_provider" | "unavailable";
65
78
  export interface PayerOpenedResult extends MerchantProxySession {
66
- readonly status: "payer_opened";
79
+ readonly presentationState: ProxySessionPresentationState;
80
+ readonly status: ProxySessionViewStatus;
67
81
  }
82
+ export type ProxySessionPresentationState = "action_required" | "already_paid" | "checkout_available" | "unavailable";
83
+ export type ProxySessionViewStatus = "cancelled" | "created" | "expired" | "failed" | "merchant_action_required" | "paid" | "payer_handoff_pending" | "payer_opened" | "payment_pending" | "provisionable" | "provisioned" | "provisioning_failed";
68
84
  /** A merchant session with its cart snapshot validated against a merchant schema. */
69
85
  export interface TypedMerchantProxySession<TCart> extends MerchantProxySession {
70
86
  readonly cart: TCart;
@@ -85,6 +101,8 @@ export interface ProxySessionCartResult {
85
101
  readonly currency: string;
86
102
  }
87
103
  export interface RecordProviderBindingInput extends ProxyCheckoutServerRequestOptions {
104
+ /** Checkout commercial mode used only to safely infer the deprecated binding into an acquisition. */
105
+ readonly commercialMode?: "one_time" | "subscription";
88
106
  readonly providerCheckoutSessionId: string;
89
107
  readonly psp: string;
90
108
  }