@fantastic.dev/better-stripe 0.24.0 → 0.25.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/CHANGELOG.md +13 -0
- package/README.md +7 -1
- package/dist/client/billing/checkout.d.ts +3 -43
- package/dist/client/billing/checkout.d.ts.map +1 -1
- package/dist/client/billing/checkout.js +5 -260
- package/dist/client/billing/checkout.js.map +1 -1
- package/dist/client/billing/checkoutRequest.d.ts +129 -0
- package/dist/client/billing/checkoutRequest.d.ts.map +1 -0
- package/dist/client/billing/checkoutRequest.js +263 -0
- package/dist/client/billing/checkoutRequest.js.map +1 -0
- package/dist/client/billing/preparedCheckout.d.ts +22 -0
- package/dist/client/billing/preparedCheckout.d.ts.map +1 -0
- package/dist/client/billing/preparedCheckout.js +86 -0
- package/dist/client/billing/preparedCheckout.js.map +1 -0
- package/dist/client/checkoutRequests.d.ts +80 -0
- package/dist/client/checkoutRequests.d.ts.map +1 -0
- package/dist/client/checkoutRequests.js +28 -0
- package/dist/client/checkoutRequests.js.map +1 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +464 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutCollection.d.ts +21 -0
- package/dist/client/connect/payoutCollection.d.ts.map +1 -0
- package/dist/client/connect/payoutCollection.js +47 -0
- package/dist/client/connect/payoutCollection.js.map +1 -0
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +1805 -0
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -0
- package/dist/client/connect/payoutExecutionTestHelpers.js +194 -0
- package/dist/client/connect/payoutExecutionTestHelpers.js.map +1 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +232 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutWorker.d.ts +48 -0
- package/dist/client/connect/payoutWorker.d.ts.map +1 -0
- package/dist/client/connect/payoutWorker.js +78 -0
- package/dist/client/connect/payoutWorker.js.map +1 -0
- package/dist/client/index.d.ts +4 -14
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -13
- package/dist/client/index.js.map +1 -1
- package/dist/client/payoutPolicy.d.ts +67 -0
- package/dist/client/payoutPolicy.d.ts.map +1 -1
- package/dist/client/payoutPolicy.js +10 -0
- package/dist/client/payoutPolicy.js.map +1 -1
- package/dist/client/readContracts.d.ts +14 -1
- package/dist/client/readContracts.d.ts.map +1 -1
- package/dist/client/readContracts.js +14 -0
- package/dist/client/readContracts.js.map +1 -1
- package/dist/client/setup.test.d.ts +18 -0
- package/dist/client/setup.test.d.ts.map +1 -0
- package/dist/client/setup.test.js +33 -0
- package/dist/client/setup.test.js.map +1 -0
- package/dist/client/types/triggers.d.ts +1 -1
- package/dist/client/types/triggers.d.ts.map +1 -1
- package/dist/client/webhooks/helpers.d.ts.map +1 -1
- package/dist/client/webhooks/helpers.js +1 -0
- package/dist/client/webhooks/helpers.js.map +1 -1
- package/dist/client/webhooks/payoutReconciliation.d.ts +8 -0
- package/dist/client/webhooks/payoutReconciliation.d.ts.map +1 -0
- package/dist/client/webhooks/payoutReconciliation.js +36 -0
- package/dist/client/webhooks/payoutReconciliation.js.map +1 -0
- package/dist/client/webhooks/payoutReconciliationTestHelpers.d.ts +117 -0
- package/dist/client/webhooks/payoutReconciliationTestHelpers.d.ts.map +1 -0
- package/dist/client/webhooks/payoutReconciliationTestHelpers.js +105 -0
- package/dist/client/webhooks/payoutReconciliationTestHelpers.js.map +1 -0
- package/dist/client/webhooks/processors.d.ts.map +1 -1
- package/dist/client/webhooks/processors.js +1 -20
- package/dist/client/webhooks/processors.js.map +1 -1
- package/dist/component/_generated/component.d.ts +293 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/core/mutations.d.ts.map +1 -1
- package/dist/component/core/mutations.js +2 -0
- package/dist/component/core/mutations.js.map +1 -1
- package/dist/component/core/resetSafety.d.ts +4 -0
- package/dist/component/core/resetSafety.d.ts.map +1 -0
- package/dist/component/core/resetSafety.js +54 -0
- package/dist/component/core/resetSafety.js.map +1 -0
- package/dist/component/earnings/triggers.d.ts +418 -0
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/earnings/triggers.js +2 -0
- package/dist/component/earnings/triggers.js.map +1 -1
- package/dist/component/payoutPolicy/schema.d.ts +2 -0
- package/dist/component/payoutPolicy/schema.d.ts.map +1 -1
- package/dist/component/payoutPolicy/schema.js +3 -1
- package/dist/component/payoutPolicy/schema.js.map +1 -1
- package/dist/component/payoutRelease/mutations.js +1 -1
- package/dist/component/payoutRelease/schema.d.ts +1 -0
- package/dist/component/payoutRelease/schema.d.ts.map +1 -1
- package/dist/component/payoutRelease/schema.js +1 -0
- package/dist/component/payoutRelease/schema.js.map +1 -1
- package/dist/component/payoutSnapshots/localState.d.ts +89 -0
- package/dist/component/payoutSnapshots/localState.d.ts.map +1 -0
- package/dist/component/payoutSnapshots/localState.js +186 -0
- package/dist/component/payoutSnapshots/localState.js.map +1 -0
- package/dist/component/payoutSnapshots/mutations.d.ts +108 -0
- package/dist/component/payoutSnapshots/mutations.d.ts.map +1 -0
- package/dist/component/payoutSnapshots/mutations.js +263 -0
- package/dist/component/payoutSnapshots/mutations.js.map +1 -0
- package/dist/component/payoutSnapshots/revisions.d.ts +12 -0
- package/dist/component/payoutSnapshots/revisions.d.ts.map +1 -0
- package/dist/component/payoutSnapshots/revisions.js +173 -0
- package/dist/component/payoutSnapshots/revisions.js.map +1 -0
- package/dist/component/payoutSnapshots/schema.d.ts +285 -0
- package/dist/component/payoutSnapshots/schema.d.ts.map +1 -0
- package/dist/component/payoutSnapshots/schema.js +108 -0
- package/dist/component/payoutSnapshots/schema.js.map +1 -0
- package/dist/component/payoutSnapshots/scope.d.ts +7 -0
- package/dist/component/payoutSnapshots/scope.d.ts.map +1 -0
- package/dist/component/payoutSnapshots/scope.js +8 -0
- package/dist/component/payoutSnapshots/scope.js.map +1 -0
- package/dist/component/payoutWorker/helpers.d.ts +30 -0
- package/dist/component/payoutWorker/helpers.d.ts.map +1 -0
- package/dist/component/payoutWorker/helpers.js +21 -0
- package/dist/component/payoutWorker/helpers.js.map +1 -0
- package/dist/component/payoutWorker/mutations.d.ts +68 -0
- package/dist/component/payoutWorker/mutations.d.ts.map +1 -0
- package/dist/component/payoutWorker/mutations.js +161 -0
- package/dist/component/payoutWorker/mutations.js.map +1 -0
- package/dist/component/payoutWorker/queries.d.ts +123 -0
- package/dist/component/payoutWorker/queries.d.ts.map +1 -0
- package/dist/component/payoutWorker/queries.js +61 -0
- package/dist/component/payoutWorker/queries.js.map +1 -0
- package/dist/component/payoutWorker/schema.d.ts +91 -0
- package/dist/component/payoutWorker/schema.d.ts.map +1 -0
- package/dist/component/payoutWorker/schema.js +27 -0
- package/dist/component/payoutWorker/schema.js.map +1 -0
- package/dist/component/schema.d.ts +232 -0
- package/dist/component/schema.js +10 -0
- package/dist/component/schema.js.map +1 -1
- package/docs/read-contracts.md +69 -5
- package/docs/settlement.md +128 -1
- package/package.json +1 -1
- package/src/client/billing/checkout.ts +11 -359
- package/src/client/billing/checkoutRequest.ts +362 -0
- package/src/client/billing/prepared-checkout.test.ts +430 -0
- package/src/client/billing/preparedCheckout.ts +143 -0
- package/src/client/checkoutRequests.ts +40 -0
- package/src/client/connect/payoutCollection.test.ts +74 -0
- package/src/client/connect/payoutCollection.ts +82 -0
- package/src/client/connect/payoutExecution.test.ts +1 -211
- package/src/client/connect/payoutExecutionTestHelpers.ts +213 -0
- package/src/client/connect/payoutWorker.test.ts +145 -0
- package/src/client/connect/payoutWorker.ts +144 -0
- package/src/client/index.ts +13 -27
- package/src/client/payoutPolicy.ts +26 -1
- package/src/client/readContracts.ts +28 -0
- package/src/client/types/triggers.ts +1 -0
- package/src/client/webhooks/helpers.ts +1 -0
- package/src/client/webhooks/payout-canceled.integration.test.ts +14 -1
- package/src/client/webhooks/payout-reconciliation.integration.test.ts +168 -0
- package/src/client/webhooks/payoutReconciliation.ts +72 -0
- package/src/client/webhooks/payoutReconciliationTestHelpers.ts +135 -0
- package/src/client/webhooks/processors.test.ts +44 -29
- package/src/client/webhooks/processors.ts +1 -27
- package/src/component/_generated/api.ts +16 -0
- package/src/component/_generated/component.ts +361 -0
- package/src/component/core/mutations.ts +2 -0
- package/src/component/core/resetSafety.ts +67 -0
- package/src/component/earnings/triggers.ts +2 -0
- package/src/component/payout-reset-safety.test.ts +148 -0
- package/src/component/payout-revisions.test.ts +125 -0
- package/src/component/payout-snapshots.test.ts +395 -0
- package/src/component/payout-worker.test.ts +165 -0
- package/src/component/payoutPolicy/schema.ts +3 -1
- package/src/component/payoutRelease/mutations.ts +1 -1
- package/src/component/payoutRelease/schema.ts +1 -0
- package/src/component/payoutSnapshots/localState.ts +238 -0
- package/src/component/payoutSnapshots/mutations.ts +275 -0
- package/src/component/payoutSnapshots/revisions.ts +247 -0
- package/src/component/payoutSnapshots/schema.ts +125 -0
- package/src/component/payoutSnapshots/scope.ts +7 -0
- package/src/component/payoutWorker/helpers.ts +30 -0
- package/src/component/payoutWorker/mutations.ts +181 -0
- package/src/component/payoutWorker/queries.ts +64 -0
- package/src/component/payoutWorker/schema.ts +26 -0
- package/src/component/public.test.ts +2 -2
- package/src/component/schema.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -26,6 +26,19 @@
|
|
|
26
26
|
- Remove internal tracker references from public documentation and add a
|
|
27
27
|
regression check that prevents their reintroduction.
|
|
28
28
|
|
|
29
|
+
## [0.25.1](https://github.com/FantasticDevHQ/better-stripe/compare/v0.25.0...v0.25.1) (2026-10-15)
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- **webhooks:** reconcile payout generations before host callbacks ([#202](https://github.com/FantasticDevHQ/better-stripe/issues/202)) ([d8332c4](https://github.com/FantasticDevHQ/better-stripe/commit/d8332c4a3fd98b1cf10e289caa9c476e56b04c79))
|
|
34
|
+
|
|
35
|
+
## [0.25.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.24.0...v0.25.0) (2026-10-15)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- **checkout:** expose immutable prepared request execution ([#199](https://github.com/FantasticDevHQ/better-stripe/issues/199)) ([a73454b](https://github.com/FantasticDevHQ/better-stripe/commit/a73454b3027613c5920be79e152610448c9ac70c))
|
|
40
|
+
- **payouts:** collect ledger pages and schedule durable payout attempts ([#198](https://github.com/FantasticDevHQ/better-stripe/issues/198)) ([0ed1b2f](https://github.com/FantasticDevHQ/better-stripe/commit/0ed1b2f23ab34301d226fa65fe0c63e093f4f9e1))
|
|
41
|
+
|
|
29
42
|
## [0.24.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.23.2...v0.24.0) (2026-10-15)
|
|
30
43
|
|
|
31
44
|
### Features
|
package/README.md
CHANGED
|
@@ -48,14 +48,20 @@ provider outcome, and books its net payout fees once.
|
|
|
48
48
|
The [combined release API](docs/settlement.md#combined-recipient-release) verifies
|
|
49
49
|
complete source and payout history, reserves mature unpaid funds, and creates an
|
|
50
50
|
idempotent bank payout. Install a host job to invoke it and expire due policies.
|
|
51
|
+
The [automatic worker](docs/settlement.md#automatic-recipient-worker) provides
|
|
52
|
+
durable attempt IDs, retry leases, recovery discovery and the next attempt time.
|
|
53
|
+
The example installs its five-minute cron in `example/convex/crons.ts`.
|
|
51
54
|
[Historical imports and explicit funded activation](docs/settlement.md#historical-import-and-funded-activation)
|
|
52
55
|
verify old payouts, source ownership and holding age before enabling a custom
|
|
53
56
|
schedule. Larger histories and unallocated money still require reconciliation;
|
|
54
57
|
schedule controls alone do not enforce a minimum.
|
|
58
|
+
[Resumable local collections and reset safeguards](docs/settlement.md#resumable-local-collections)
|
|
59
|
+
provide bounded ledger inspection while provider-history continuation and scalable
|
|
60
|
+
claim execution are completed.
|
|
55
61
|
|
|
56
62
|
## Status
|
|
57
63
|
|
|
58
|
-
**Version**: `0.
|
|
64
|
+
**Version**: `0.25.1` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
|
|
59
65
|
|
|
60
66
|
Used in production by its authors. Webhook pipeline is covered by unit tests and a live E2E harness (`npm run e2e:webhooks`) that fires real Stripe-signed events and asserts the ledger.
|
|
61
67
|
|
|
@@ -1,48 +1,8 @@
|
|
|
1
|
+
import { renderCheckoutSession } from "./checkoutRequest.js";
|
|
1
2
|
import type Stripe from "stripe";
|
|
2
|
-
import type { SplitRecipient } from "../../component/lib/fees.js";
|
|
3
3
|
import type { Component, RunCtx } from "../helpers.js";
|
|
4
|
-
import type {
|
|
5
|
-
export declare function createCheckoutSession(stripe: Stripe, component: Component, ctx: RunCtx, opts: {
|
|
6
|
-
idempotencyKey?: string;
|
|
7
|
-
userId: string;
|
|
8
|
-
orgId?: string;
|
|
9
|
-
stripePriceId: string;
|
|
10
|
-
mode: "payment" | "subscription" | "setup";
|
|
11
|
-
uiMode?: "embedded" | "redirect" | "custom" | "form";
|
|
12
|
-
quantity?: number;
|
|
13
|
-
returnUrl: string;
|
|
14
|
-
trialDays?: number;
|
|
15
|
-
accountId?: string;
|
|
16
|
-
customerEmail?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The seller/recipient connected account funds are routed to (destination
|
|
19
|
-
* charge). Fees only apply when this is set.
|
|
20
|
-
*/
|
|
21
|
-
destinationAccountId?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Multiple recipients for one sale (store + affiliate[s]). With >1 recipient
|
|
24
|
-
* this routes via separate charges & transfers (no `application_fee`); the
|
|
25
|
-
* transfers are created by the webhook engine. A single-recipient split is
|
|
26
|
-
* treated as a destination charge. Takes precedence over `destinationAccountId`.
|
|
27
|
-
*/
|
|
28
|
-
split?: SplitRecipient[];
|
|
29
|
-
/** Resolved platform fee config (the caller resolves override → default). */
|
|
30
|
-
feeConfig?: PlatformFeeConfig;
|
|
31
|
-
/**
|
|
32
|
-
* Charge total in minor units (one-time payment mode). When known, the
|
|
33
|
-
* fixed `application_fee_amount` is computed up front; otherwise the fee is
|
|
34
|
-
* deferred to the webhook.
|
|
35
|
-
*/
|
|
36
|
-
amount?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Platform-default statement-descriptor suffix (BTS-32), used when the
|
|
39
|
-
* destination account record carries no per-store suffix. The caller
|
|
40
|
-
* (BetterStripe) passes its validated configured default.
|
|
41
|
-
*/
|
|
42
|
-
defaultStatementDescriptorSuffix?: string;
|
|
43
|
-
metadata?: Record<string, string>;
|
|
44
|
-
sessionOverrides?: Record<string, unknown>;
|
|
45
|
-
}): Promise<{
|
|
4
|
+
import type { StripeComponentCheckoutSession } from "../types.js";
|
|
5
|
+
export declare function createCheckoutSession(stripe: Stripe, component: Component, ctx: RunCtx, opts: Parameters<typeof renderCheckoutSession>[3]): Promise<{
|
|
46
6
|
stripeSessionId: string;
|
|
47
7
|
clientSecret: string | undefined;
|
|
48
8
|
url: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC;;;;GAUlD;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAA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2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { runMutationOrThrow, stripReservedMetadata } from "../helpers.js";
|
|
1
|
+
import { renderCheckoutSession } from "./checkoutRequest.js";
|
|
2
|
+
import { submitPreparedCheckout } from "./preparedCheckout.js";
|
|
3
|
+
import { runMutationOrThrow } from "../helpers.js";
|
|
5
4
|
import { componentRef } from "../webhooks/helpers.js";
|
|
6
|
-
/**
|
|
7
|
-
* Derive the persisted fee/routing fields (BTS-11) from the FINAL Checkout
|
|
8
|
-
* Session request, reading the nested `subscription_data`/`payment_intent_data`
|
|
9
|
-
* that will actually be sent to Stripe. Deriving from the final request (rather
|
|
10
|
-
* than a pre-override draft) keeps the stored row consistent when callers pass
|
|
11
|
-
* `sessionOverrides` that replace those nested params.
|
|
12
|
-
*/
|
|
13
|
-
function deriveFeeRow(params) {
|
|
14
|
-
const dest = (d) => typeof d === "string"
|
|
15
|
-
? d
|
|
16
|
-
: (d?.id ?? undefined);
|
|
17
|
-
if (params.mode === "subscription") {
|
|
18
|
-
const destination = dest(params.subscription_data?.transfer_data?.destination);
|
|
19
|
-
if (!destination)
|
|
20
|
-
return {};
|
|
21
|
-
const pct = params.subscription_data?.application_fee_percent;
|
|
22
|
-
return {
|
|
23
|
-
chargeType: "destination",
|
|
24
|
-
destinationAccountId: destination,
|
|
25
|
-
...(pct !== undefined ? { applicationFeePercent: pct } : {}),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (params.mode === "payment") {
|
|
29
|
-
const destination = dest(params.payment_intent_data?.transfer_data?.destination);
|
|
30
|
-
if (!destination)
|
|
31
|
-
return {};
|
|
32
|
-
const amt = params.payment_intent_data?.application_fee_amount;
|
|
33
|
-
return {
|
|
34
|
-
chargeType: "destination",
|
|
35
|
-
destinationAccountId: destination,
|
|
36
|
-
...(amt !== undefined ? { applicationFeeAmount: amt } : {}),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return {};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Destination and separate charges use platform prices. Catalog accountId is a
|
|
43
|
-
* store attribution tag, not Stripe ownership (createProduct uses the platform).
|
|
44
|
-
* For tagged products, verify the price in the platform Stripe context before
|
|
45
|
-
* rejecting it. Untagged/unknown catalog entries are validated by Checkout.
|
|
46
|
-
*/
|
|
47
|
-
async function assertPlatformPrice(stripe, component, ctx, stripePriceId) {
|
|
48
|
-
const price = (await ctx.runQuery(componentRef(component, "products/queries/getPriceByStripeId"), { stripePriceId }));
|
|
49
|
-
if (!price?.stripeProductId)
|
|
50
|
-
return;
|
|
51
|
-
const product = (await ctx.runQuery(componentRef(component, "products/queries/getProductByStripeId"), { stripeProductId: price.stripeProductId }));
|
|
52
|
-
if (product?.accountId) {
|
|
53
|
-
try {
|
|
54
|
-
await stripe.prices.retrieve(stripePriceId);
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
// Only absence on the platform means the ownership check failed.
|
|
58
|
-
// Auth/network/rate-limit failures must not be misreported as ownership.
|
|
59
|
-
if (!error ||
|
|
60
|
-
typeof error !== "object" ||
|
|
61
|
-
!("code" in error) ||
|
|
62
|
-
error.code !== "resource_missing")
|
|
63
|
-
throw error;
|
|
64
|
-
throwStripeError("INVALID_CONFIGURATION", `Price ${stripePriceId} is unavailable on the platform account; destination charges require a platform-owned price.`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// =============================================================================
|
|
69
|
-
// Checkout methods
|
|
70
|
-
// =============================================================================
|
|
71
5
|
export async function createCheckoutSession(stripe, component, ctx, opts) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
// would persist an unfunded `chargeType` the webhook engine can't act on.
|
|
75
|
-
if (opts.mode === "setup" &&
|
|
76
|
-
(opts.split?.length || opts.destinationAccountId || opts.feeConfig)) {
|
|
77
|
-
throwStripeError("INVALID_CONFIGURATION", "split/destinationAccountId/fee are not supported for setup-mode Checkout Sessions");
|
|
78
|
-
}
|
|
79
|
-
// Resolve the routing model. A `split` with >1 recipient uses separate charges
|
|
80
|
-
// & transfers (no application_fee; webhook engine creates the transfers); a
|
|
81
|
-
// single-recipient split is just a destination charge. `split` wins over
|
|
82
|
-
// `destinationAccountId`.
|
|
83
|
-
let isSeparate = false;
|
|
84
|
-
let destinationAccountId = opts.destinationAccountId;
|
|
85
|
-
if (opts.split && opts.split.length > 0) {
|
|
86
|
-
validateSplit(opts.split);
|
|
87
|
-
if (opts.split.length === 1) {
|
|
88
|
-
destinationAccountId = opts.split[0].destinationAccountId;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
isSeparate = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// Metadata markers the webhook split engine reads to create the transfers.
|
|
95
|
-
// For subscriptions these live on the subscription and are consumed on each
|
|
96
|
-
// invoice.paid; for one-time payments they live on the PaymentIntent.
|
|
97
|
-
const separateMeta = isSeparate
|
|
98
|
-
? {
|
|
99
|
-
bsChargeType: "separate",
|
|
100
|
-
bsSplit: JSON.stringify(opts.split),
|
|
101
|
-
...(opts.feeConfig
|
|
102
|
-
? { bsFeeConfig: JSON.stringify(opts.feeConfig) }
|
|
103
|
-
: {}),
|
|
104
|
-
}
|
|
105
|
-
: {};
|
|
106
|
-
// Strip the reserved `bs*` namespace from caller metadata so it can't forge
|
|
107
|
-
// webhook instructions (e.g. trigger split transfers without routing).
|
|
108
|
-
const metadata = {
|
|
109
|
-
...stripReservedMetadata(opts.metadata),
|
|
110
|
-
userId: opts.userId,
|
|
111
|
-
...(opts.orgId ? { orgId: opts.orgId } : {}),
|
|
112
|
-
};
|
|
113
|
-
// Per-store statement descriptor (BTS-32). Destination charges are platform
|
|
114
|
-
// charges (platform = merchant of record), so buyer recognition is
|
|
115
|
-
// suffix-based: the store's stored suffix, else the configured platform
|
|
116
|
-
// default. Resolved from the component account record at session creation.
|
|
117
|
-
let statementDescriptorSuffix;
|
|
118
|
-
if (destinationAccountId && !isSeparate && opts.mode !== "setup") {
|
|
119
|
-
const account = (await ctx.runQuery(componentRef(component, "core/queries/getAccountByStripeId"), { stripeAccountId: destinationAccountId }));
|
|
120
|
-
statementDescriptorSuffix =
|
|
121
|
-
account?.statementDescriptor ?? opts.defaultStatementDescriptorSuffix;
|
|
122
|
-
}
|
|
123
|
-
const sessionParams = {
|
|
124
|
-
mode: opts.mode,
|
|
125
|
-
line_items: [{ price: opts.stripePriceId, quantity: opts.quantity ?? 1 }],
|
|
126
|
-
metadata,
|
|
127
|
-
};
|
|
128
|
-
if (opts.mode === "subscription") {
|
|
129
|
-
const subscriptionData = {
|
|
130
|
-
metadata,
|
|
131
|
-
};
|
|
132
|
-
if (opts.trialDays) {
|
|
133
|
-
subscriptionData.trial_period_days = opts.trialDays;
|
|
134
|
-
}
|
|
135
|
-
if (isSeparate) {
|
|
136
|
-
// Separate charges & transfers: NO transfer_data / application_fee. The
|
|
137
|
-
// split is carried in metadata for the webhook engine to execute.
|
|
138
|
-
subscriptionData.metadata = { ...metadata, ...separateMeta };
|
|
139
|
-
}
|
|
140
|
-
else if (destinationAccountId) {
|
|
141
|
-
// Single-recipient destination charge: route funds to the seller and take
|
|
142
|
-
// the platform's cut. Percent-only fees map to `application_fee_percent`;
|
|
143
|
-
// percent+fixed/tiered fees can't be expressed that way, so flag the
|
|
144
|
-
// subscription for per-invoice fee computation (handled by WEBHOOK_FEE).
|
|
145
|
-
subscriptionData.transfer_data = { destination: destinationAccountId };
|
|
146
|
-
if (opts.feeConfig) {
|
|
147
|
-
if (isPercentOnlyFee(opts.feeConfig)) {
|
|
148
|
-
subscriptionData.application_fee_percent = opts.feeConfig.percent;
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
subscriptionData.metadata = {
|
|
152
|
-
...metadata,
|
|
153
|
-
bsFeeMode: "per_invoice",
|
|
154
|
-
bsFeeConfig: JSON.stringify(opts.feeConfig),
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
if (statementDescriptorSuffix) {
|
|
159
|
-
// Subscriptions can't carry a suffix directly; the invoice.created
|
|
160
|
-
// processor reads this marker and sets it on each invoice.
|
|
161
|
-
subscriptionData.metadata = {
|
|
162
|
-
...(subscriptionData.metadata ?? metadata),
|
|
163
|
-
bsStatementDescriptor: statementDescriptorSuffix,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
sessionParams.subscription_data = subscriptionData;
|
|
168
|
-
}
|
|
169
|
-
if (opts.mode === "payment") {
|
|
170
|
-
const paymentIntentData = { metadata };
|
|
171
|
-
if (isSeparate) {
|
|
172
|
-
paymentIntentData.metadata = { ...metadata, ...separateMeta };
|
|
173
|
-
}
|
|
174
|
-
else if (destinationAccountId) {
|
|
175
|
-
// Single-recipient destination charge for a one-time purchase. The platform
|
|
176
|
-
// fee is a fixed `application_fee_amount`: compute it when the amount is
|
|
177
|
-
// known; otherwise flag the PI with `bsFeeMode=per_charge` and the webhook
|
|
178
|
-
// collects it at payment_intent.succeeded via a partial reversal of the
|
|
179
|
-
// destination transfer, sized from the amount actually charged (BTS-60).
|
|
180
|
-
paymentIntentData.transfer_data = {
|
|
181
|
-
destination: destinationAccountId,
|
|
182
|
-
};
|
|
183
|
-
if (statementDescriptorSuffix) {
|
|
184
|
-
paymentIntentData.statement_descriptor_suffix =
|
|
185
|
-
statementDescriptorSuffix;
|
|
186
|
-
}
|
|
187
|
-
if (opts.feeConfig) {
|
|
188
|
-
if (opts.amount !== undefined) {
|
|
189
|
-
paymentIntentData.application_fee_amount = computeFee(opts.amount, opts.feeConfig).feeAmount;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
paymentIntentData.metadata = {
|
|
193
|
-
...metadata,
|
|
194
|
-
bsFeeMode: "per_charge",
|
|
195
|
-
bsFeeConfig: JSON.stringify(opts.feeConfig),
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
sessionParams.payment_intent_data = paymentIntentData;
|
|
201
|
-
}
|
|
202
|
-
if (uiMode === "embedded" || uiMode === "custom" || uiMode === "form") {
|
|
203
|
-
sessionParams.ui_mode =
|
|
204
|
-
uiMode === "custom"
|
|
205
|
-
? "elements"
|
|
206
|
-
: uiMode === "form"
|
|
207
|
-
? "form"
|
|
208
|
-
: "embedded_page";
|
|
209
|
-
sessionParams.return_url = opts.returnUrl;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
sessionParams.success_url = `${opts.returnUrl}?session_id={CHECKOUT_SESSION_ID}`;
|
|
213
|
-
sessionParams.cancel_url = opts.returnUrl;
|
|
214
|
-
}
|
|
215
|
-
if (opts.accountId) {
|
|
216
|
-
sessionParams.customer_account = opts.accountId;
|
|
217
|
-
}
|
|
218
|
-
else if (opts.customerEmail) {
|
|
219
|
-
sessionParams.customer_email = opts.customerEmail;
|
|
220
|
-
}
|
|
221
|
-
// Merge overrides, then derive the persisted fee/routing row from the FINAL
|
|
222
|
-
// request — sessionOverrides can replace subscription_data/payment_intent_data
|
|
223
|
-
// wholesale, so the row must reflect what was actually sent to Stripe.
|
|
224
|
-
const finalSessionParams = {
|
|
225
|
-
...sessionParams,
|
|
226
|
-
...opts.sessionOverrides,
|
|
227
|
-
};
|
|
228
|
-
// Separate-charge sales persist the split + chargeType directly; single-recipient
|
|
229
|
-
// destination charges derive the row from the final transfer_data/fee.
|
|
230
|
-
const feeRow = isSeparate
|
|
231
|
-
? { chargeType: "separate", splitRecipients: opts.split }
|
|
232
|
-
: deriveFeeRow(finalSessionParams);
|
|
233
|
-
// Both destination and separate charges run on the platform account, so the
|
|
234
|
-
// price must be platform-owned. Validate the FINAL request (post-overrides) so
|
|
235
|
-
// callers can't inject transfer_data or swap line_items to bypass the check.
|
|
236
|
-
const finalPriceId = finalSessionParams.line_items?.[0]?.price;
|
|
237
|
-
if ((isSeparate || feeRow.chargeType === "destination") &&
|
|
238
|
-
typeof finalPriceId === "string") {
|
|
239
|
-
await assertPlatformPrice(stripe, component, ctx, finalPriceId);
|
|
240
|
-
}
|
|
241
|
-
const requestOptions = idempotencyOptions(opts.idempotencyKey);
|
|
242
|
-
const session = requestOptions
|
|
243
|
-
? await stripe.checkout.sessions.create(finalSessionParams, requestOptions)
|
|
244
|
-
: await stripe.checkout.sessions.create(finalSessionParams);
|
|
245
|
-
await runMutationOrThrow(ctx, componentRef(component, "billing/mutations/upsertCheckoutSession"), {
|
|
246
|
-
stripeSessionId: session.id,
|
|
247
|
-
userId: opts.userId,
|
|
248
|
-
orgId: opts.orgId,
|
|
249
|
-
accountId: opts.accountId,
|
|
250
|
-
mode: finalSessionParams.mode,
|
|
251
|
-
status: (session.status ?? "open"),
|
|
252
|
-
clientSecret: session.client_secret ?? undefined,
|
|
253
|
-
url: session.url ?? undefined,
|
|
254
|
-
priceId: opts.stripePriceId,
|
|
255
|
-
...feeRow,
|
|
256
|
-
metadata,
|
|
257
|
-
});
|
|
258
|
-
return {
|
|
259
|
-
stripeSessionId: session.id,
|
|
260
|
-
clientSecret: session.client_secret ?? undefined,
|
|
261
|
-
url: session.url ?? undefined,
|
|
262
|
-
};
|
|
6
|
+
const prepared = await renderCheckoutSession(stripe, component, ctx, opts);
|
|
7
|
+
return submitPreparedCheckout(stripe, component, ctx, prepared, opts.idempotencyKey);
|
|
263
8
|
}
|
|
264
9
|
export async function getCheckoutSession(component, ctx, opts) {
|
|
265
10
|
return (await ctx.runQuery(componentRef(component, "billing/queries/getCheckoutSession"), opts));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/client/billing/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,kBAAkB,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AU,qBAAqB,CACzC,MAAc,EACd,IAAY,EACZ,IAGC;IAED,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE;QAC1E,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type Stripe from "stripe";
|
|
2
|
+
import type { SplitRecipient } from "../../component/lib/fees.js";
|
|
3
|
+
import type { Component, RunCtx } from "../helpers.js";
|
|
4
|
+
import type { PlatformFeeConfig } from "../types.js";
|
|
5
|
+
export declare function renderCheckoutSession(stripe: Stripe, component: Component, ctx: RunCtx, opts: {
|
|
6
|
+
idempotencyKey?: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
orgId?: string;
|
|
9
|
+
stripePriceId: string;
|
|
10
|
+
mode: "payment" | "subscription" | "setup";
|
|
11
|
+
uiMode?: "embedded" | "redirect" | "custom" | "form";
|
|
12
|
+
quantity?: number;
|
|
13
|
+
returnUrl: string;
|
|
14
|
+
trialDays?: number;
|
|
15
|
+
accountId?: string;
|
|
16
|
+
customerEmail?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The seller/recipient connected account funds are routed to (destination
|
|
19
|
+
* charge). Fees only apply when this is set.
|
|
20
|
+
*/
|
|
21
|
+
destinationAccountId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Multiple recipients for one sale (store + affiliate[s]). With >1 recipient
|
|
24
|
+
* this routes via separate charges & transfers (no `application_fee`); the
|
|
25
|
+
* transfers are created by the webhook engine. A single-recipient split is
|
|
26
|
+
* treated as a destination charge. Takes precedence over `destinationAccountId`.
|
|
27
|
+
*/
|
|
28
|
+
split?: SplitRecipient[];
|
|
29
|
+
/** Resolved platform fee config (the caller resolves override → default). */
|
|
30
|
+
feeConfig?: PlatformFeeConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Charge total in minor units (one-time payment mode). When known, the
|
|
33
|
+
* fixed `application_fee_amount` is computed up front; otherwise the fee is
|
|
34
|
+
* deferred to the webhook.
|
|
35
|
+
*/
|
|
36
|
+
amount?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Platform-default statement-descriptor suffix (BTS-32), used when the
|
|
39
|
+
* destination account record carries no per-store suffix. The caller
|
|
40
|
+
* (BetterStripe) passes its validated configured default.
|
|
41
|
+
*/
|
|
42
|
+
defaultStatementDescriptorSuffix?: string;
|
|
43
|
+
metadata?: Record<string, string>;
|
|
44
|
+
sessionOverrides?: Record<string, unknown>;
|
|
45
|
+
}, capturedDescriptor?: {
|
|
46
|
+
value?: string;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
version: 1;
|
|
49
|
+
request: Stripe.Checkout.SessionCreateParams;
|
|
50
|
+
options: {
|
|
51
|
+
idempotencyKey?: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
orgId?: string;
|
|
54
|
+
stripePriceId: string;
|
|
55
|
+
mode: "payment" | "subscription" | "setup";
|
|
56
|
+
uiMode?: "embedded" | "redirect" | "custom" | "form";
|
|
57
|
+
quantity?: number;
|
|
58
|
+
returnUrl: string;
|
|
59
|
+
trialDays?: number;
|
|
60
|
+
accountId?: string;
|
|
61
|
+
customerEmail?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The seller/recipient connected account funds are routed to (destination
|
|
64
|
+
* charge). Fees only apply when this is set.
|
|
65
|
+
*/
|
|
66
|
+
destinationAccountId?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Multiple recipients for one sale (store + affiliate[s]). With >1 recipient
|
|
69
|
+
* this routes via separate charges & transfers (no `application_fee`); the
|
|
70
|
+
* transfers are created by the webhook engine. A single-recipient split is
|
|
71
|
+
* treated as a destination charge. Takes precedence over `destinationAccountId`.
|
|
72
|
+
*/
|
|
73
|
+
split?: SplitRecipient[];
|
|
74
|
+
/** Resolved platform fee config (the caller resolves override → default). */
|
|
75
|
+
feeConfig?: PlatformFeeConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Charge total in minor units (one-time payment mode). When known, the
|
|
78
|
+
* fixed `application_fee_amount` is computed up front; otherwise the fee is
|
|
79
|
+
* deferred to the webhook.
|
|
80
|
+
*/
|
|
81
|
+
amount?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Platform-default statement-descriptor suffix (BTS-32), used when the
|
|
84
|
+
* destination account record carries no per-store suffix. The caller
|
|
85
|
+
* (BetterStripe) passes its validated configured default.
|
|
86
|
+
*/
|
|
87
|
+
defaultStatementDescriptorSuffix?: string;
|
|
88
|
+
metadata?: Record<string, string>;
|
|
89
|
+
sessionOverrides?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
descriptor: {
|
|
92
|
+
value: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
routingMetadata: {
|
|
95
|
+
subscription: Stripe.MetadataParam | undefined;
|
|
96
|
+
payment: Stripe.MetadataParam | undefined;
|
|
97
|
+
};
|
|
98
|
+
row: {
|
|
99
|
+
chargeType?: "destination";
|
|
100
|
+
destinationAccountId?: string;
|
|
101
|
+
applicationFeePercent?: number;
|
|
102
|
+
applicationFeeAmount?: number;
|
|
103
|
+
userId: string;
|
|
104
|
+
orgId: string | undefined;
|
|
105
|
+
accountId: string | undefined;
|
|
106
|
+
priceId: string;
|
|
107
|
+
metadata: {
|
|
108
|
+
userId: string;
|
|
109
|
+
orgId?: string | undefined;
|
|
110
|
+
};
|
|
111
|
+
} | {
|
|
112
|
+
chargeType: "separate";
|
|
113
|
+
splitRecipients: {
|
|
114
|
+
amount?: number | undefined;
|
|
115
|
+
destinationAccountId: string;
|
|
116
|
+
percent?: number | undefined;
|
|
117
|
+
role: "affiliate" | "other" | "store";
|
|
118
|
+
}[] | undefined;
|
|
119
|
+
userId: string;
|
|
120
|
+
orgId: string | undefined;
|
|
121
|
+
accountId: string | undefined;
|
|
122
|
+
priceId: string;
|
|
123
|
+
metadata: {
|
|
124
|
+
userId: string;
|
|
125
|
+
orgId?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
129
|
+
//# sourceMappingURL=checkoutRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkoutRequest.d.ts","sourceRoot":"","sources":["../../../src/client/billing/checkoutRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgGrD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IACJ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC;IAC3C,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG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