@proxy-checkout/stripe-server-js 0.1.0-prx-146.162.1 → 0.1.0
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 +15 -113
- package/dist/cjs/errors.d.cts +1 -68
- package/dist/cjs/errors.d.ts +1 -68
- package/dist/cjs/errors.js +1 -86
- package/dist/cjs/index.d.cts +4 -10
- package/dist/cjs/index.d.ts +4 -10
- package/dist/cjs/index.js +1 -24
- package/dist/cjs/metadata.d.cts +2 -26
- package/dist/cjs/metadata.d.ts +2 -26
- package/dist/cjs/metadata.js +3 -73
- package/dist/cjs/open-checkout.d.cts +0 -21
- package/dist/cjs/open-checkout.d.ts +0 -21
- package/dist/cjs/open-checkout.js +38 -310
- package/dist/cjs/sync-checkout-cart.d.cts +3 -3
- package/dist/cjs/sync-checkout-cart.d.ts +3 -3
- package/dist/cjs/sync-checkout-cart.js +22 -92
- package/dist/cjs/types.d.cts +0 -199
- package/dist/cjs/types.d.ts +0 -199
- package/dist/cjs/version.d.cts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/errors.d.ts +1 -68
- package/dist/esm/errors.js +0 -80
- package/dist/esm/index.d.ts +4 -10
- package/dist/esm/index.js +2 -7
- package/dist/esm/metadata.d.ts +2 -26
- package/dist/esm/metadata.js +2 -69
- package/dist/esm/open-checkout.d.ts +0 -21
- package/dist/esm/open-checkout.js +40 -312
- package/dist/esm/sync-checkout-cart.d.ts +3 -3
- package/dist/esm/sync-checkout-cart.js +23 -93
- package/dist/esm/types.d.ts +0 -199
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/acquisition.d.cts +0 -189
- package/dist/cjs/acquisition.d.ts +0 -189
- package/dist/cjs/acquisition.js +0 -789
- package/dist/cjs/compatibility.d.cts +0 -66
- package/dist/cjs/compatibility.d.ts +0 -66
- package/dist/cjs/compatibility.js +0 -174
- package/dist/cjs/open-payment-intent.d.cts +0 -35
- package/dist/cjs/open-payment-intent.d.ts +0 -35
- package/dist/cjs/open-payment-intent.js +0 -157
- package/dist/cjs/open-setup-intent.d.cts +0 -49
- package/dist/cjs/open-setup-intent.d.ts +0 -49
- package/dist/cjs/open-setup-intent.js +0 -157
- package/dist/cjs/open-subscription.d.cts +0 -75
- package/dist/cjs/open-subscription.d.ts +0 -75
- package/dist/cjs/open-subscription.js +0 -307
- package/dist/cjs/subscription-params.d.cts +0 -33
- package/dist/cjs/subscription-params.d.ts +0 -33
- package/dist/cjs/subscription-params.js +0 -237
- package/dist/esm/acquisition.d.ts +0 -189
- package/dist/esm/acquisition.js +0 -763
- package/dist/esm/compatibility.d.ts +0 -66
- package/dist/esm/compatibility.js +0 -168
- package/dist/esm/open-payment-intent.d.ts +0 -35
- package/dist/esm/open-payment-intent.js +0 -154
- package/dist/esm/open-setup-intent.d.ts +0 -49
- package/dist/esm/open-setup-intent.js +0 -153
- package/dist/esm/open-subscription.d.ts +0 -75
- package/dist/esm/open-subscription.js +0 -304
- package/dist/esm/subscription-params.d.ts +0 -33
- package/dist/esm/subscription-params.js +0 -232
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type StripeCompatibilityPath } from "./errors.js";
|
|
2
|
-
export interface StripeCompatibilityDescriptor {
|
|
3
|
-
/** Stripe request API version configured on the merchant-owned server client. */
|
|
4
|
-
readonly apiVersion?: string;
|
|
5
|
-
/** Installed @stripe/stripe-js version used by the payer presentation. */
|
|
6
|
-
readonly browserSdkVersion?: string;
|
|
7
|
-
/** Installed @stripe/react-stripe-js version used by the payer presentation. */
|
|
8
|
-
readonly reactSdkVersion?: string;
|
|
9
|
-
/** Installed stripe-node version, when the merchant can report it. */
|
|
10
|
-
readonly serverSdkVersion?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface StripeCompatibilityLane {
|
|
13
|
-
readonly apiVersion: string;
|
|
14
|
-
readonly browserSdkVersion: string;
|
|
15
|
-
readonly path: StripeCompatibilityPath;
|
|
16
|
-
readonly reactSdkVersion: string;
|
|
17
|
-
readonly serverSdkVersion: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const stripeCompatibilityLanes: {
|
|
20
|
-
readonly custom: {
|
|
21
|
-
readonly apiVersion: "2025-03-31.basil";
|
|
22
|
-
readonly browserSdkVersion: "7.0.0";
|
|
23
|
-
readonly path: "one_time.checkout.custom";
|
|
24
|
-
readonly reactSdkVersion: "3.6.0";
|
|
25
|
-
readonly serverSdkVersion: "18.0.0";
|
|
26
|
-
};
|
|
27
|
-
readonly embedded: {
|
|
28
|
-
readonly apiVersion: "2023-10-16";
|
|
29
|
-
readonly browserSdkVersion: "2.1.8";
|
|
30
|
-
readonly path: "one_time.checkout.embedded";
|
|
31
|
-
readonly reactSdkVersion: "2.3.2";
|
|
32
|
-
readonly serverSdkVersion: "14.0.0";
|
|
33
|
-
};
|
|
34
|
-
readonly fiveable: {
|
|
35
|
-
readonly apiVersion: "2022-11-15";
|
|
36
|
-
readonly browserSdkVersion: "2.4.0";
|
|
37
|
-
readonly reactSdkVersion: "2.9.0";
|
|
38
|
-
readonly serverSdkVersion: "12.18.0";
|
|
39
|
-
};
|
|
40
|
-
readonly hostedNoCost: {
|
|
41
|
-
readonly apiVersion: "2023-08-16";
|
|
42
|
-
readonly browserSdkVersion: "2.4.0";
|
|
43
|
-
readonly reactSdkVersion: "2.9.0";
|
|
44
|
-
readonly serverSdkVersion: "12.18.0";
|
|
45
|
-
};
|
|
46
|
-
readonly planDateCurrent: {
|
|
47
|
-
readonly apiVersion: "2026-06-24.dahlia";
|
|
48
|
-
readonly browserSdkVersion: "9.10.0";
|
|
49
|
-
readonly reactSdkVersion: "6.7.0";
|
|
50
|
-
readonly serverSdkVersion: "22.3.1";
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Direct PaymentIntent, direct fixed-price Subscription, and positive hosted
|
|
55
|
-
* Checkout use only structural operations present in the Fiveable lane. A
|
|
56
|
-
* reported version is validated, but omission stays compatible for
|
|
57
|
-
* dependency-injected Stripe clients.
|
|
58
|
-
*/
|
|
59
|
-
export declare function assertStripePathCompatibility(path: StripeCompatibilityPath, descriptor: StripeCompatibilityDescriptor | undefined): void;
|
|
60
|
-
/**
|
|
61
|
-
* Stripe added no-cost Checkout orders in API 2023-08-16. We require the
|
|
62
|
-
* merchant to declare that version before creation because an old endpoint can
|
|
63
|
-
* otherwise silently produce a different or rejected provider flow.
|
|
64
|
-
*/
|
|
65
|
-
export declare function assertHostedNoCostCompatibility(descriptor: StripeCompatibilityDescriptor | undefined): void;
|
|
66
|
-
export declare function compareStripeApiVersions(left: string, right: string): number;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type StripeCompatibilityPath } from "./errors.js";
|
|
2
|
-
export interface StripeCompatibilityDescriptor {
|
|
3
|
-
/** Stripe request API version configured on the merchant-owned server client. */
|
|
4
|
-
readonly apiVersion?: string;
|
|
5
|
-
/** Installed @stripe/stripe-js version used by the payer presentation. */
|
|
6
|
-
readonly browserSdkVersion?: string;
|
|
7
|
-
/** Installed @stripe/react-stripe-js version used by the payer presentation. */
|
|
8
|
-
readonly reactSdkVersion?: string;
|
|
9
|
-
/** Installed stripe-node version, when the merchant can report it. */
|
|
10
|
-
readonly serverSdkVersion?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface StripeCompatibilityLane {
|
|
13
|
-
readonly apiVersion: string;
|
|
14
|
-
readonly browserSdkVersion: string;
|
|
15
|
-
readonly path: StripeCompatibilityPath;
|
|
16
|
-
readonly reactSdkVersion: string;
|
|
17
|
-
readonly serverSdkVersion: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const stripeCompatibilityLanes: {
|
|
20
|
-
readonly custom: {
|
|
21
|
-
readonly apiVersion: "2025-03-31.basil";
|
|
22
|
-
readonly browserSdkVersion: "7.0.0";
|
|
23
|
-
readonly path: "one_time.checkout.custom";
|
|
24
|
-
readonly reactSdkVersion: "3.6.0";
|
|
25
|
-
readonly serverSdkVersion: "18.0.0";
|
|
26
|
-
};
|
|
27
|
-
readonly embedded: {
|
|
28
|
-
readonly apiVersion: "2023-10-16";
|
|
29
|
-
readonly browserSdkVersion: "2.1.8";
|
|
30
|
-
readonly path: "one_time.checkout.embedded";
|
|
31
|
-
readonly reactSdkVersion: "2.3.2";
|
|
32
|
-
readonly serverSdkVersion: "14.0.0";
|
|
33
|
-
};
|
|
34
|
-
readonly fiveable: {
|
|
35
|
-
readonly apiVersion: "2022-11-15";
|
|
36
|
-
readonly browserSdkVersion: "2.4.0";
|
|
37
|
-
readonly reactSdkVersion: "2.9.0";
|
|
38
|
-
readonly serverSdkVersion: "12.18.0";
|
|
39
|
-
};
|
|
40
|
-
readonly hostedNoCost: {
|
|
41
|
-
readonly apiVersion: "2023-08-16";
|
|
42
|
-
readonly browserSdkVersion: "2.4.0";
|
|
43
|
-
readonly reactSdkVersion: "2.9.0";
|
|
44
|
-
readonly serverSdkVersion: "12.18.0";
|
|
45
|
-
};
|
|
46
|
-
readonly planDateCurrent: {
|
|
47
|
-
readonly apiVersion: "2026-06-24.dahlia";
|
|
48
|
-
readonly browserSdkVersion: "9.10.0";
|
|
49
|
-
readonly reactSdkVersion: "6.7.0";
|
|
50
|
-
readonly serverSdkVersion: "22.3.1";
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Direct PaymentIntent, direct fixed-price Subscription, and positive hosted
|
|
55
|
-
* Checkout use only structural operations present in the Fiveable lane. A
|
|
56
|
-
* reported version is validated, but omission stays compatible for
|
|
57
|
-
* dependency-injected Stripe clients.
|
|
58
|
-
*/
|
|
59
|
-
export declare function assertStripePathCompatibility(path: StripeCompatibilityPath, descriptor: StripeCompatibilityDescriptor | undefined): void;
|
|
60
|
-
/**
|
|
61
|
-
* Stripe added no-cost Checkout orders in API 2023-08-16. We require the
|
|
62
|
-
* merchant to declare that version before creation because an old endpoint can
|
|
63
|
-
* otherwise silently produce a different or rejected provider flow.
|
|
64
|
-
*/
|
|
65
|
-
export declare function assertHostedNoCostCompatibility(descriptor: StripeCompatibilityDescriptor | undefined): void;
|
|
66
|
-
export declare function compareStripeApiVersions(left: string, right: string): number;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stripeCompatibilityLanes = void 0;
|
|
4
|
-
exports.assertStripePathCompatibility = assertStripePathCompatibility;
|
|
5
|
-
exports.assertHostedNoCostCompatibility = assertHostedNoCostCompatibility;
|
|
6
|
-
exports.compareStripeApiVersions = compareStripeApiVersions;
|
|
7
|
-
const errors_js_1 = require("./errors.js");
|
|
8
|
-
exports.stripeCompatibilityLanes = {
|
|
9
|
-
custom: {
|
|
10
|
-
apiVersion: "2025-03-31.basil",
|
|
11
|
-
browserSdkVersion: "7.0.0",
|
|
12
|
-
path: "one_time.checkout.custom",
|
|
13
|
-
reactSdkVersion: "3.6.0",
|
|
14
|
-
serverSdkVersion: "18.0.0",
|
|
15
|
-
},
|
|
16
|
-
embedded: {
|
|
17
|
-
apiVersion: "2023-10-16",
|
|
18
|
-
browserSdkVersion: "2.1.8",
|
|
19
|
-
path: "one_time.checkout.embedded",
|
|
20
|
-
reactSdkVersion: "2.3.2",
|
|
21
|
-
serverSdkVersion: "14.0.0",
|
|
22
|
-
},
|
|
23
|
-
fiveable: {
|
|
24
|
-
apiVersion: "2022-11-15",
|
|
25
|
-
browserSdkVersion: "2.4.0",
|
|
26
|
-
reactSdkVersion: "2.9.0",
|
|
27
|
-
serverSdkVersion: "12.18.0",
|
|
28
|
-
},
|
|
29
|
-
hostedNoCost: {
|
|
30
|
-
apiVersion: "2023-08-16",
|
|
31
|
-
browserSdkVersion: "2.4.0",
|
|
32
|
-
reactSdkVersion: "2.9.0",
|
|
33
|
-
serverSdkVersion: "12.18.0",
|
|
34
|
-
},
|
|
35
|
-
planDateCurrent: {
|
|
36
|
-
apiVersion: "2026-06-24.dahlia",
|
|
37
|
-
browserSdkVersion: "9.10.0",
|
|
38
|
-
reactSdkVersion: "6.7.0",
|
|
39
|
-
serverSdkVersion: "22.3.1",
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
const docsUrl = "https://docs.proxycheckout.com/reference/stripe-compatibility/";
|
|
43
|
-
/**
|
|
44
|
-
* Direct PaymentIntent, direct fixed-price Subscription, and positive hosted
|
|
45
|
-
* Checkout use only structural operations present in the Fiveable lane. A
|
|
46
|
-
* reported version is validated, but omission stays compatible for
|
|
47
|
-
* dependency-injected Stripe clients.
|
|
48
|
-
*/
|
|
49
|
-
function assertStripePathCompatibility(path, descriptor) {
|
|
50
|
-
if (path === "one_time.checkout.embedded" || path === "one_time.checkout.custom") {
|
|
51
|
-
assertCheckoutPresentationCompatibility(path, descriptor);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const apiVersion = descriptor?.apiVersion;
|
|
55
|
-
const serverSdkVersion = descriptor?.serverSdkVersion;
|
|
56
|
-
if (apiVersion &&
|
|
57
|
-
compareStripeApiVersions(apiVersion, exports.stripeCompatibilityLanes.fiveable.apiVersion) < 0) {
|
|
58
|
-
throw compatibilityError(path, descriptor, exports.stripeCompatibilityLanes.fiveable.apiVersion);
|
|
59
|
-
}
|
|
60
|
-
if (serverSdkVersion &&
|
|
61
|
-
compareSemver(serverSdkVersion, exports.stripeCompatibilityLanes.fiveable.serverSdkVersion) < 0) {
|
|
62
|
-
throw compatibilityError(path, descriptor, exports.stripeCompatibilityLanes.fiveable.apiVersion);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Stripe added no-cost Checkout orders in API 2023-08-16. We require the
|
|
67
|
-
* merchant to declare that version before creation because an old endpoint can
|
|
68
|
-
* otherwise silently produce a different or rejected provider flow.
|
|
69
|
-
*/
|
|
70
|
-
function assertHostedNoCostCompatibility(descriptor) {
|
|
71
|
-
const minimum = exports.stripeCompatibilityLanes.hostedNoCost.apiVersion;
|
|
72
|
-
if (!descriptor?.apiVersion || compareStripeApiVersions(descriptor.apiVersion, minimum) < 0) {
|
|
73
|
-
throw new errors_js_1.StripeCompatibilityError({
|
|
74
|
-
...(descriptor?.apiVersion ? { detectedApiVersion: descriptor.apiVersion } : {}),
|
|
75
|
-
docsUrl,
|
|
76
|
-
message: `No-cost Stripe Checkout requires request API ${minimum} or newer. Fiveable's 2022-11-15 lane supports positive hosted Checkout but not no-cost orders; set an explicit newer Stripe API version or keep the order positive.`,
|
|
77
|
-
minimumApiVersion: minimum,
|
|
78
|
-
minimumServerSdkVersion: exports.stripeCompatibilityLanes.hostedNoCost.serverSdkVersion,
|
|
79
|
-
path: "one_time.checkout.hosted",
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function compareStripeApiVersions(left, right) {
|
|
84
|
-
const leftDate = apiDate(left);
|
|
85
|
-
const rightDate = apiDate(right);
|
|
86
|
-
if (leftDate !== rightDate)
|
|
87
|
-
return leftDate.localeCompare(rightDate);
|
|
88
|
-
return left.localeCompare(right);
|
|
89
|
-
}
|
|
90
|
-
function apiDate(value) {
|
|
91
|
-
const match = /^(\d{4}-\d{2}-\d{2})(?:\.[a-z]+)?$/.exec(value);
|
|
92
|
-
if (!match?.[1]) {
|
|
93
|
-
throw new TypeError(`Invalid Stripe API version ${value}.`);
|
|
94
|
-
}
|
|
95
|
-
return match[1];
|
|
96
|
-
}
|
|
97
|
-
function compareSemver(left, right) {
|
|
98
|
-
const leftParts = semverParts(left);
|
|
99
|
-
const rightParts = semverParts(right);
|
|
100
|
-
for (let index = 0; index < 3; index += 1) {
|
|
101
|
-
const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
|
|
102
|
-
if (difference !== 0)
|
|
103
|
-
return difference;
|
|
104
|
-
}
|
|
105
|
-
return 0;
|
|
106
|
-
}
|
|
107
|
-
function semverParts(value) {
|
|
108
|
-
const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(value);
|
|
109
|
-
if (!match)
|
|
110
|
-
throw new TypeError(`Invalid Stripe SDK version ${value}.`);
|
|
111
|
-
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
112
|
-
}
|
|
113
|
-
function compatibilityError(path, descriptor, minimumApiVersion) {
|
|
114
|
-
return new errors_js_1.StripeCompatibilityError({
|
|
115
|
-
...(descriptor?.apiVersion ? { detectedApiVersion: descriptor.apiVersion } : {}),
|
|
116
|
-
...(descriptor?.serverSdkVersion
|
|
117
|
-
? { detectedServerSdkVersion: descriptor.serverSdkVersion }
|
|
118
|
-
: {}),
|
|
119
|
-
docsUrl,
|
|
120
|
-
message: `Stripe path ${path} requires stripe-node ${exports.stripeCompatibilityLanes.fiveable.serverSdkVersion}+ and request API ${minimumApiVersion}+.`,
|
|
121
|
-
minimumApiVersion,
|
|
122
|
-
minimumServerSdkVersion: exports.stripeCompatibilityLanes.fiveable.serverSdkVersion,
|
|
123
|
-
path,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function assertCheckoutPresentationCompatibility(path, descriptor) {
|
|
127
|
-
const lane = path === "one_time.checkout.embedded"
|
|
128
|
-
? exports.stripeCompatibilityLanes.embedded
|
|
129
|
-
: exports.stripeCompatibilityLanes.custom;
|
|
130
|
-
const supported = descriptor?.apiVersion !== undefined &&
|
|
131
|
-
compareStripeApiVersions(descriptor.apiVersion, lane.apiVersion) >= 0 &&
|
|
132
|
-
descriptor.serverSdkVersion !== undefined &&
|
|
133
|
-
compareSemver(descriptor.serverSdkVersion, lane.serverSdkVersion) >= 0 &&
|
|
134
|
-
descriptor.browserSdkVersion !== undefined &&
|
|
135
|
-
compareSemver(descriptor.browserSdkVersion, lane.browserSdkVersion) >= 0 &&
|
|
136
|
-
descriptor.reactSdkVersion !== undefined &&
|
|
137
|
-
compareSemver(descriptor.reactSdkVersion, lane.reactSdkVersion) >= 0;
|
|
138
|
-
if (supported)
|
|
139
|
-
return;
|
|
140
|
-
const requiredUpgrades = [
|
|
141
|
-
!descriptor?.serverSdkVersion ||
|
|
142
|
-
compareSemver(descriptor.serverSdkVersion, lane.serverSdkVersion) < 0
|
|
143
|
-
? `stripe-node ${lane.serverSdkVersion}+`
|
|
144
|
-
: null,
|
|
145
|
-
!descriptor?.apiVersion || compareStripeApiVersions(descriptor.apiVersion, lane.apiVersion) < 0
|
|
146
|
-
? `request API ${lane.apiVersion}+`
|
|
147
|
-
: null,
|
|
148
|
-
!descriptor?.browserSdkVersion ||
|
|
149
|
-
compareSemver(descriptor.browserSdkVersion, lane.browserSdkVersion) < 0
|
|
150
|
-
? `Stripe.js ${lane.browserSdkVersion}+`
|
|
151
|
-
: null,
|
|
152
|
-
!descriptor?.reactSdkVersion ||
|
|
153
|
-
compareSemver(descriptor.reactSdkVersion, lane.reactSdkVersion) < 0
|
|
154
|
-
? `React Stripe.js ${lane.reactSdkVersion}+`
|
|
155
|
-
: null,
|
|
156
|
-
].filter((upgrade) => upgrade !== null);
|
|
157
|
-
throw new errors_js_1.StripeCompatibilityError({
|
|
158
|
-
...(descriptor?.apiVersion ? { detectedApiVersion: descriptor.apiVersion } : {}),
|
|
159
|
-
...(descriptor?.browserSdkVersion
|
|
160
|
-
? { detectedBrowserSdkVersion: descriptor.browserSdkVersion }
|
|
161
|
-
: {}),
|
|
162
|
-
...(descriptor?.reactSdkVersion ? { detectedReactSdkVersion: descriptor.reactSdkVersion } : {}),
|
|
163
|
-
...(descriptor?.serverSdkVersion
|
|
164
|
-
? { detectedServerSdkVersion: descriptor.serverSdkVersion }
|
|
165
|
-
: {}),
|
|
166
|
-
docsUrl,
|
|
167
|
-
message: `Stripe path ${path} is not compatible with the supplied versions. Fiveable's pinned lane supports direct PaymentIntent and hosted Checkout only. Upgrade required: ${requiredUpgrades.join(", ")}. Versions already at or above the floor do not need to change.`,
|
|
168
|
-
minimumApiVersion: lane.apiVersion,
|
|
169
|
-
minimumBrowserSdkVersion: lane.browserSdkVersion,
|
|
170
|
-
minimumReactSdkVersion: lane.reactSdkVersion,
|
|
171
|
-
minimumServerSdkVersion: lane.serverSdkVersion,
|
|
172
|
-
path,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { PayerOpenedResult, ProxyCartValidator, ProxyCheckoutServerClient } from "@proxy-checkout/server-js";
|
|
2
|
-
import { type SharedAcquisitionTerminalResult } from "./acquisition.js";
|
|
3
|
-
import { type StripeCompatibilityDescriptor } from "./compatibility.js";
|
|
4
|
-
import type { StripePaymentIntentClientLike, StripePaymentIntentCreateParams, StripePaymentIntentLike, StripeRequestOptionsWithoutIdempotencyLike } from "./types.js";
|
|
5
|
-
export type SafePaymentIntentStatus = "canceled" | "processing" | "requires_action" | "requires_capture" | "requires_confirmation" | "requires_payment_method" | "succeeded";
|
|
6
|
-
export interface OpenPaymentIntentOptions<TStripe extends StripePaymentIntentClientLike, TCart, _TPaymentIntent extends StripePaymentIntentLike> {
|
|
7
|
-
/** Merchant-server-only builder. Proxy injects amount, currency, and reserved metadata. */
|
|
8
|
-
readonly buildPaymentIntentParams: (input: {
|
|
9
|
-
cart: TCart;
|
|
10
|
-
proxySession: PayerOpenedResult;
|
|
11
|
-
stripe: TStripe;
|
|
12
|
-
}) => Promise<StripePaymentIntentCreateParams> | StripePaymentIntentCreateParams;
|
|
13
|
-
readonly cartSchema?: ProxyCartValidator<TCart>;
|
|
14
|
-
readonly compatibility?: StripeCompatibilityDescriptor;
|
|
15
|
-
/** Optional immutable server-only fee basis; never forward browser input here. */
|
|
16
|
-
readonly merchandiseSubtotalMinor?: number;
|
|
17
|
-
readonly proxy: ProxyCheckoutServerClient;
|
|
18
|
-
readonly proxySessionId: string;
|
|
19
|
-
readonly requestId?: string;
|
|
20
|
-
readonly stripe: TStripe;
|
|
21
|
-
readonly stripeRequestOptions?: StripeRequestOptionsWithoutIdempotencyLike;
|
|
22
|
-
}
|
|
23
|
-
export interface ReadyPaymentIntentResult<TCart, TPaymentIntent extends StripePaymentIntentLike> {
|
|
24
|
-
readonly acquisitionAttemptId: string;
|
|
25
|
-
readonly cart: TCart;
|
|
26
|
-
readonly clientSecret: string;
|
|
27
|
-
readonly outcome: "ready";
|
|
28
|
-
readonly paymentIntent: TPaymentIntent;
|
|
29
|
-
readonly paymentIntentId: string;
|
|
30
|
-
readonly proxySession: PayerOpenedResult;
|
|
31
|
-
readonly proxySessionId: string;
|
|
32
|
-
readonly status: SafePaymentIntentStatus;
|
|
33
|
-
}
|
|
34
|
-
export type OpenPaymentIntentResponse<TCart, TPaymentIntent extends StripePaymentIntentLike> = ReadyPaymentIntentResult<TCart, TPaymentIntent> | SharedAcquisitionTerminalResult<TCart>;
|
|
35
|
-
export declare function openPaymentIntent<TStripe extends StripePaymentIntentClientLike, TCart = unknown, TPaymentIntent extends StripePaymentIntentLike = StripePaymentIntentLike>(options: OpenPaymentIntentOptions<TStripe, TCart, TPaymentIntent>): Promise<OpenPaymentIntentResponse<TCart, TPaymentIntent>>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { PayerOpenedResult, ProxyCartValidator, ProxyCheckoutServerClient } from "@proxy-checkout/server-js";
|
|
2
|
-
import { type SharedAcquisitionTerminalResult } from "./acquisition.js";
|
|
3
|
-
import { type StripeCompatibilityDescriptor } from "./compatibility.js";
|
|
4
|
-
import type { StripePaymentIntentClientLike, StripePaymentIntentCreateParams, StripePaymentIntentLike, StripeRequestOptionsWithoutIdempotencyLike } from "./types.js";
|
|
5
|
-
export type SafePaymentIntentStatus = "canceled" | "processing" | "requires_action" | "requires_capture" | "requires_confirmation" | "requires_payment_method" | "succeeded";
|
|
6
|
-
export interface OpenPaymentIntentOptions<TStripe extends StripePaymentIntentClientLike, TCart, _TPaymentIntent extends StripePaymentIntentLike> {
|
|
7
|
-
/** Merchant-server-only builder. Proxy injects amount, currency, and reserved metadata. */
|
|
8
|
-
readonly buildPaymentIntentParams: (input: {
|
|
9
|
-
cart: TCart;
|
|
10
|
-
proxySession: PayerOpenedResult;
|
|
11
|
-
stripe: TStripe;
|
|
12
|
-
}) => Promise<StripePaymentIntentCreateParams> | StripePaymentIntentCreateParams;
|
|
13
|
-
readonly cartSchema?: ProxyCartValidator<TCart>;
|
|
14
|
-
readonly compatibility?: StripeCompatibilityDescriptor;
|
|
15
|
-
/** Optional immutable server-only fee basis; never forward browser input here. */
|
|
16
|
-
readonly merchandiseSubtotalMinor?: number;
|
|
17
|
-
readonly proxy: ProxyCheckoutServerClient;
|
|
18
|
-
readonly proxySessionId: string;
|
|
19
|
-
readonly requestId?: string;
|
|
20
|
-
readonly stripe: TStripe;
|
|
21
|
-
readonly stripeRequestOptions?: StripeRequestOptionsWithoutIdempotencyLike;
|
|
22
|
-
}
|
|
23
|
-
export interface ReadyPaymentIntentResult<TCart, TPaymentIntent extends StripePaymentIntentLike> {
|
|
24
|
-
readonly acquisitionAttemptId: string;
|
|
25
|
-
readonly cart: TCart;
|
|
26
|
-
readonly clientSecret: string;
|
|
27
|
-
readonly outcome: "ready";
|
|
28
|
-
readonly paymentIntent: TPaymentIntent;
|
|
29
|
-
readonly paymentIntentId: string;
|
|
30
|
-
readonly proxySession: PayerOpenedResult;
|
|
31
|
-
readonly proxySessionId: string;
|
|
32
|
-
readonly status: SafePaymentIntentStatus;
|
|
33
|
-
}
|
|
34
|
-
export type OpenPaymentIntentResponse<TCart, TPaymentIntent extends StripePaymentIntentLike> = ReadyPaymentIntentResult<TCart, TPaymentIntent> | SharedAcquisitionTerminalResult<TCart>;
|
|
35
|
-
export declare function openPaymentIntent<TStripe extends StripePaymentIntentClientLike, TCart = unknown, TPaymentIntent extends StripePaymentIntentLike = StripePaymentIntentLike>(options: OpenPaymentIntentOptions<TStripe, TCart, TPaymentIntent>): Promise<OpenPaymentIntentResponse<TCart, TPaymentIntent>>;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openPaymentIntent = openPaymentIntent;
|
|
4
|
-
const server_js_1 = require("@proxy-checkout/server-js");
|
|
5
|
-
const acquisition_js_1 = require("./acquisition.js");
|
|
6
|
-
const compatibility_js_1 = require("./compatibility.js");
|
|
7
|
-
const errors_js_1 = require("./errors.js");
|
|
8
|
-
const metadata_js_1 = require("./metadata.js");
|
|
9
|
-
async function openPaymentIntent(options) {
|
|
10
|
-
(0, compatibility_js_1.assertStripePathCompatibility)("one_time.direct_payment_intent", options.compatibility);
|
|
11
|
-
validateMerchandiseSubtotal(options.merchandiseSubtotalMinor);
|
|
12
|
-
(0, acquisition_js_1.assertNoConnectRequestOptions)(options.stripeRequestOptions);
|
|
13
|
-
const proxySession = await options.proxy.sessions.payerOpened(options.proxySessionId, {
|
|
14
|
-
requestId: options.requestId,
|
|
15
|
-
});
|
|
16
|
-
const cart = options.cartSchema
|
|
17
|
-
? options.proxy.sessions.parseCart(proxySession, options.cartSchema)
|
|
18
|
-
: proxySession.cartSnapshot;
|
|
19
|
-
if (proxySession.presentationState !== "checkout_available") {
|
|
20
|
-
return (0, acquisition_js_1.terminalAcquisitionResult)(proxySession, cart);
|
|
21
|
-
}
|
|
22
|
-
if (proxySession.amountMinor <= 0) {
|
|
23
|
-
throw new server_js_1.ProxyCheckoutValidationError("Direct PaymentIntent requires a positive fixed Proxy amount; use version-gated hosted Checkout for a no-cost order.", { code: "unsupported_provider_option", field: "amount_minor" });
|
|
24
|
-
}
|
|
25
|
-
const merchantParams = await options.buildPaymentIntentParams({
|
|
26
|
-
cart,
|
|
27
|
-
proxySession,
|
|
28
|
-
stripe: options.stripe,
|
|
29
|
-
});
|
|
30
|
-
const params = normalizePaymentIntentParams(merchantParams, proxySession);
|
|
31
|
-
const providerOptionsFingerprint = (0, acquisition_js_1.fingerprintStripeProviderOptions)("payment_intent", (0, acquisition_js_1.paymentIntentOptionsForFingerprint)(params));
|
|
32
|
-
const acquisitionResult = await (0, acquisition_js_1.acquireStripeRoot)({
|
|
33
|
-
commercialMode: "one_time",
|
|
34
|
-
create: async (reservation) => (await options.stripe.paymentIntents.create((0, metadata_js_1.injectRequiredPaymentIntentMetadata)(params, {
|
|
35
|
-
acquisitionAttemptId: reservation.acquisitionAttempt.id,
|
|
36
|
-
proxySessionId: proxySession.id,
|
|
37
|
-
}), {
|
|
38
|
-
...options.stripeRequestOptions,
|
|
39
|
-
idempotencyKey: reservation.stripe.idempotencyKeys.root,
|
|
40
|
-
})),
|
|
41
|
-
...(options.merchandiseSubtotalMinor === undefined
|
|
42
|
-
? {}
|
|
43
|
-
: { directMerchandiseSubtotalMinor: options.merchandiseSubtotalMinor }),
|
|
44
|
-
integrationPath: "payment_intent",
|
|
45
|
-
objectType: "payment_intent",
|
|
46
|
-
pricingMode: "fixed",
|
|
47
|
-
providerOptionsFingerprint,
|
|
48
|
-
proxy: options.proxy,
|
|
49
|
-
proxySession,
|
|
50
|
-
requestId: options.requestId,
|
|
51
|
-
retrieve: async (id) => (await options.stripe.paymentIntents.retrieve(id, undefined, options.stripeRequestOptions)),
|
|
52
|
-
toConfirmation: (paymentIntent) => paymentIntentConfirmation(paymentIntent, proxySession.cartVersion),
|
|
53
|
-
validateObject: (paymentIntent, acquisition) => {
|
|
54
|
-
(0, metadata_js_1.assertProviderObjectBelongsToAcquisition)(paymentIntent, {
|
|
55
|
-
acquisitionAttemptId: acquisition.id,
|
|
56
|
-
integrationPath: "payment_intent",
|
|
57
|
-
proxySessionId: proxySession.id,
|
|
58
|
-
});
|
|
59
|
-
assertPaymentIntentCart(paymentIntent, proxySession);
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
if (acquisitionResult.outcome === "terminal") {
|
|
63
|
-
return (0, acquisition_js_1.terminalAcquisitionResult)(acquisitionResult.proxySession, cart);
|
|
64
|
-
}
|
|
65
|
-
const acquired = acquisitionResult;
|
|
66
|
-
const clientSecret = acquired.object.client_secret;
|
|
67
|
-
if (typeof clientSecret !== "string" || clientSecret.length === 0) {
|
|
68
|
-
throw new errors_js_1.StripeResponseShapeError("Stripe PaymentIntent response did not contain a client_secret.", "client_secret");
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
acquisitionAttemptId: acquired.acquisition.id,
|
|
72
|
-
cart,
|
|
73
|
-
clientSecret,
|
|
74
|
-
outcome: "ready",
|
|
75
|
-
paymentIntent: acquired.object,
|
|
76
|
-
paymentIntentId: acquired.object.id,
|
|
77
|
-
proxySession,
|
|
78
|
-
proxySessionId: proxySession.id,
|
|
79
|
-
status: safePaymentIntentStatus(acquired.object.status),
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function normalizePaymentIntentParams(params, session) {
|
|
83
|
-
for (const field of [
|
|
84
|
-
"application_fee_amount",
|
|
85
|
-
"application_fee_percent",
|
|
86
|
-
"on_behalf_of",
|
|
87
|
-
"transfer_data",
|
|
88
|
-
"transfer_group",
|
|
89
|
-
]) {
|
|
90
|
-
if (params[field] !== undefined) {
|
|
91
|
-
throw new errors_js_1.UnsupportedStripeOptionError(`Direct PaymentIntent for Proxy session ${session.id} does not support Stripe ${field}.`, field);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (params.capture_method !== undefined && params.capture_method !== "automatic") {
|
|
95
|
-
throw new errors_js_1.UnsupportedStripeOptionError("Direct PaymentIntent requires automatic capture; manual capture cannot provision.", "capture_method");
|
|
96
|
-
}
|
|
97
|
-
if (params.amount !== undefined && params.amount !== session.amountMinor) {
|
|
98
|
-
throw new server_js_1.ProxyCheckoutValidationError(`Stripe PaymentIntent amount must equal Proxy cart version amount ${session.amountMinor}.`, { code: "cart_version_conflict", field: "amount" });
|
|
99
|
-
}
|
|
100
|
-
if (params.currency !== undefined && params.currency.toLowerCase() !== session.currency) {
|
|
101
|
-
throw new server_js_1.ProxyCheckoutValidationError(`Stripe PaymentIntent currency must equal Proxy currency ${session.currency}.`, { code: "cart_version_conflict", field: "currency" });
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
...params,
|
|
105
|
-
amount: session.amountMinor,
|
|
106
|
-
capture_method: "automatic",
|
|
107
|
-
currency: session.currency,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function assertPaymentIntentCart(paymentIntent, session) {
|
|
111
|
-
if (paymentIntent.amount !== session.amountMinor || paymentIntent.currency !== session.currency) {
|
|
112
|
-
throw new server_js_1.ProxyCheckoutValidationError(`Stripe PaymentIntent ${paymentIntent.id} does not represent the current Proxy cart amount and currency.`, { code: "cart_version_conflict", field: "provider_amount" });
|
|
113
|
-
}
|
|
114
|
-
if (paymentIntent.capture_method !== undefined &&
|
|
115
|
-
paymentIntent.capture_method !== "automatic" &&
|
|
116
|
-
paymentIntent.capture_method !== "automatic_async") {
|
|
117
|
-
throw new errors_js_1.UnsupportedStripeOptionError("Stripe PaymentIntent response uses unsupported manual capture.", "capture_method");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function paymentIntentConfirmation(paymentIntent, cartVersion) {
|
|
121
|
-
if (!Number.isSafeInteger(paymentIntent.amount) ||
|
|
122
|
-
(paymentIntent.amount ?? -1) < 0 ||
|
|
123
|
-
typeof paymentIntent.currency !== "string") {
|
|
124
|
-
throw new errors_js_1.StripeResponseShapeError("Stripe PaymentIntent response is missing its amount or currency.", "amount");
|
|
125
|
-
}
|
|
126
|
-
const amount = paymentIntent.amount;
|
|
127
|
-
return {
|
|
128
|
-
amountMinor: amount,
|
|
129
|
-
cartVersion,
|
|
130
|
-
currency: paymentIntent.currency,
|
|
131
|
-
evidenceSha256: (0, acquisition_js_1.hashProviderCartEvidence)("payment_intent", {
|
|
132
|
-
amount,
|
|
133
|
-
cart_version: cartVersion,
|
|
134
|
-
currency: paymentIntent.currency,
|
|
135
|
-
id: paymentIntent.id,
|
|
136
|
-
}),
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
function safePaymentIntentStatus(value) {
|
|
140
|
-
switch (value) {
|
|
141
|
-
case "canceled":
|
|
142
|
-
case "processing":
|
|
143
|
-
case "requires_action":
|
|
144
|
-
case "requires_capture":
|
|
145
|
-
case "requires_confirmation":
|
|
146
|
-
case "requires_payment_method":
|
|
147
|
-
case "succeeded":
|
|
148
|
-
return value;
|
|
149
|
-
default:
|
|
150
|
-
throw new errors_js_1.StripeResponseShapeError("Stripe PaymentIntent response contained an unsupported status.", "status");
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function validateMerchandiseSubtotal(value) {
|
|
154
|
-
if (value !== undefined && (!Number.isSafeInteger(value) || value < 0 || value > 2_147_483_647)) {
|
|
155
|
-
throw new server_js_1.ProxyCheckoutValidationError("merchandiseSubtotalMinor must be a nonnegative safe minor-unit integer.", { code: "merchandise_subtotal_invalid", field: "merchandiseSubtotalMinor" });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { PayerOpenedResult, ProxyCartValidator } from "@proxy-checkout/server-js";
|
|
2
|
-
import { type SharedAcquisitionTerminal, type StripeAcquisitionProxyClient } from "./acquisition.js";
|
|
3
|
-
import { type StripeCompatibilityDescriptor } from "./compatibility.js";
|
|
4
|
-
import type { StripeRequestOptionsWithoutIdempotencyLike, StripeSetupIntentClientLike, StripeSetupIntentCreateParams, StripeSetupIntentLike, StripeSubscriptionCreateParams } from "./types.js";
|
|
5
|
-
export interface OpenSetupIntentBuilderInput<TStripe extends StripeSetupIntentClientLike, TCart> {
|
|
6
|
-
readonly cart: TCart;
|
|
7
|
-
readonly proxySession: PayerOpenedResult;
|
|
8
|
-
readonly stripe: TStripe;
|
|
9
|
-
}
|
|
10
|
-
export interface OpenSetupIntentOptions<TStripe extends StripeSetupIntentClientLike, TCart = unknown> {
|
|
11
|
-
/** Builds merchant-owned SetupIntent params; Proxy metadata and Customer are SDK-owned. */
|
|
12
|
-
readonly buildSetupIntentParams?: (input: OpenSetupIntentBuilderInput<TStripe, TCart>) => Promise<StripeSetupIntentCreateParams> | StripeSetupIntentCreateParams;
|
|
13
|
-
/**
|
|
14
|
-
* Builds the eventual fixed Subscription params as part of the immutable
|
|
15
|
-
* order-scoped reservation. No Subscription is created by this helper.
|
|
16
|
-
*/
|
|
17
|
-
readonly buildSubscriptionParams: (input: OpenSetupIntentBuilderInput<TStripe, TCart>) => Promise<StripeSubscriptionCreateParams> | StripeSubscriptionCreateParams;
|
|
18
|
-
readonly cartSchema?: ProxyCartValidator<TCart>;
|
|
19
|
-
readonly compatibility?: StripeCompatibilityDescriptor;
|
|
20
|
-
/** Customer for the purchase/shared billing account, never a viewer-selected private account. */
|
|
21
|
-
readonly customerId: string;
|
|
22
|
-
readonly getCartBuyerReference?: (cart: TCart) => string | null | undefined;
|
|
23
|
-
/** Selects the supported expanded initial-Invoice shape for the merchant's pinned Stripe API. */
|
|
24
|
-
readonly initialInvoiceActionShape: "confirmation_secret" | "legacy_payment_intent";
|
|
25
|
-
readonly proxy: StripeAcquisitionProxyClient;
|
|
26
|
-
readonly proxySessionId: string;
|
|
27
|
-
readonly requestId?: string;
|
|
28
|
-
readonly stripe: TStripe;
|
|
29
|
-
readonly stripeRequestOptions?: StripeRequestOptionsWithoutIdempotencyLike;
|
|
30
|
-
}
|
|
31
|
-
export interface OpenSetupIntentReadyResult<TCart, TSetupIntent extends StripeSetupIntentLike> {
|
|
32
|
-
readonly acquisitionAttemptId: string;
|
|
33
|
-
readonly cart: TCart;
|
|
34
|
-
readonly clientSecret: string;
|
|
35
|
-
readonly outcome: "ready";
|
|
36
|
-
readonly proxySession: PayerOpenedResult;
|
|
37
|
-
readonly proxySessionId: string;
|
|
38
|
-
readonly setupIntent: TSetupIntent;
|
|
39
|
-
readonly setupIntentId: string;
|
|
40
|
-
readonly status: string;
|
|
41
|
-
}
|
|
42
|
-
export type OpenSetupIntentResponse<TCart, TSetupIntent extends StripeSetupIntentLike> = OpenSetupIntentReadyResult<TCart, TSetupIntent> | SharedAcquisitionTerminal<TCart>;
|
|
43
|
-
export declare function openSetupIntent<TStripe extends StripeSetupIntentClientLike, TCart = unknown, TSetupIntent extends StripeSetupIntentLike = StripeSetupIntentLike>(options: OpenSetupIntentOptions<TStripe, TCart>): Promise<OpenSetupIntentResponse<TCart, TSetupIntent>>;
|
|
44
|
-
export declare function directSetupProviderOptionsFingerprint(input: {
|
|
45
|
-
customerId: string;
|
|
46
|
-
initialInvoiceActionShape: "confirmation_secret" | "legacy_payment_intent";
|
|
47
|
-
setupIntentParams: StripeSetupIntentCreateParams;
|
|
48
|
-
subscriptionParams: StripeSubscriptionCreateParams;
|
|
49
|
-
}): string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { PayerOpenedResult, ProxyCartValidator } from "@proxy-checkout/server-js";
|
|
2
|
-
import { type SharedAcquisitionTerminal, type StripeAcquisitionProxyClient } from "./acquisition.js";
|
|
3
|
-
import { type StripeCompatibilityDescriptor } from "./compatibility.js";
|
|
4
|
-
import type { StripeRequestOptionsWithoutIdempotencyLike, StripeSetupIntentClientLike, StripeSetupIntentCreateParams, StripeSetupIntentLike, StripeSubscriptionCreateParams } from "./types.js";
|
|
5
|
-
export interface OpenSetupIntentBuilderInput<TStripe extends StripeSetupIntentClientLike, TCart> {
|
|
6
|
-
readonly cart: TCart;
|
|
7
|
-
readonly proxySession: PayerOpenedResult;
|
|
8
|
-
readonly stripe: TStripe;
|
|
9
|
-
}
|
|
10
|
-
export interface OpenSetupIntentOptions<TStripe extends StripeSetupIntentClientLike, TCart = unknown> {
|
|
11
|
-
/** Builds merchant-owned SetupIntent params; Proxy metadata and Customer are SDK-owned. */
|
|
12
|
-
readonly buildSetupIntentParams?: (input: OpenSetupIntentBuilderInput<TStripe, TCart>) => Promise<StripeSetupIntentCreateParams> | StripeSetupIntentCreateParams;
|
|
13
|
-
/**
|
|
14
|
-
* Builds the eventual fixed Subscription params as part of the immutable
|
|
15
|
-
* order-scoped reservation. No Subscription is created by this helper.
|
|
16
|
-
*/
|
|
17
|
-
readonly buildSubscriptionParams: (input: OpenSetupIntentBuilderInput<TStripe, TCart>) => Promise<StripeSubscriptionCreateParams> | StripeSubscriptionCreateParams;
|
|
18
|
-
readonly cartSchema?: ProxyCartValidator<TCart>;
|
|
19
|
-
readonly compatibility?: StripeCompatibilityDescriptor;
|
|
20
|
-
/** Customer for the purchase/shared billing account, never a viewer-selected private account. */
|
|
21
|
-
readonly customerId: string;
|
|
22
|
-
readonly getCartBuyerReference?: (cart: TCart) => string | null | undefined;
|
|
23
|
-
/** Selects the supported expanded initial-Invoice shape for the merchant's pinned Stripe API. */
|
|
24
|
-
readonly initialInvoiceActionShape: "confirmation_secret" | "legacy_payment_intent";
|
|
25
|
-
readonly proxy: StripeAcquisitionProxyClient;
|
|
26
|
-
readonly proxySessionId: string;
|
|
27
|
-
readonly requestId?: string;
|
|
28
|
-
readonly stripe: TStripe;
|
|
29
|
-
readonly stripeRequestOptions?: StripeRequestOptionsWithoutIdempotencyLike;
|
|
30
|
-
}
|
|
31
|
-
export interface OpenSetupIntentReadyResult<TCart, TSetupIntent extends StripeSetupIntentLike> {
|
|
32
|
-
readonly acquisitionAttemptId: string;
|
|
33
|
-
readonly cart: TCart;
|
|
34
|
-
readonly clientSecret: string;
|
|
35
|
-
readonly outcome: "ready";
|
|
36
|
-
readonly proxySession: PayerOpenedResult;
|
|
37
|
-
readonly proxySessionId: string;
|
|
38
|
-
readonly setupIntent: TSetupIntent;
|
|
39
|
-
readonly setupIntentId: string;
|
|
40
|
-
readonly status: string;
|
|
41
|
-
}
|
|
42
|
-
export type OpenSetupIntentResponse<TCart, TSetupIntent extends StripeSetupIntentLike> = OpenSetupIntentReadyResult<TCart, TSetupIntent> | SharedAcquisitionTerminal<TCart>;
|
|
43
|
-
export declare function openSetupIntent<TStripe extends StripeSetupIntentClientLike, TCart = unknown, TSetupIntent extends StripeSetupIntentLike = StripeSetupIntentLike>(options: OpenSetupIntentOptions<TStripe, TCart>): Promise<OpenSetupIntentResponse<TCart, TSetupIntent>>;
|
|
44
|
-
export declare function directSetupProviderOptionsFingerprint(input: {
|
|
45
|
-
customerId: string;
|
|
46
|
-
initialInvoiceActionShape: "confirmation_secret" | "legacy_payment_intent";
|
|
47
|
-
setupIntentParams: StripeSetupIntentCreateParams;
|
|
48
|
-
subscriptionParams: StripeSubscriptionCreateParams;
|
|
49
|
-
}): string;
|