@fantastic.dev/better-stripe 0.68.1 → 0.70.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/client/usage/subscriptionCheckout.d.ts.map +1 -1
- package/dist/client/usage/subscriptionCheckout.js +2 -0
- package/dist/client/usage/subscriptionCheckout.js.map +1 -1
- package/dist/react/workflows/Products.d.ts +2 -2
- package/dist/react/workflows/Products.d.ts.map +1 -1
- package/dist/react/workflows/Products.js +8 -4
- package/dist/react/workflows/Products.js.map +1 -1
- package/dist/react/workflows/UsageSummary.d.ts.map +1 -1
- package/dist/react/workflows/UsageSummary.js +4 -1
- package/dist/react/workflows/UsageSummary.js.map +1 -1
- package/docs/evidence/native-metering/product-flows-2026-10-19.json +553 -0
- package/docs/metered-usage.md +1 -1
- package/docs/metering-setup.md +36 -26
- package/docs/react-workflows.md +35 -0
- package/docs/usage-example.md +159 -244
- package/docs/usage-protocol-diagnostics.md +251 -0
- package/docs/usage-verification.md +31 -0
- package/package.json +1 -1
- package/src/client/usage/subscriptionCheckout.test.ts +13 -0
- package/src/client/usage/subscriptionCheckout.ts +2 -0
- package/src/react/workflows/Products.test.tsx +194 -2
- package/src/react/workflows/Products.tsx +53 -43
- package/src/react/workflows/Usage.test.tsx +15 -0
- package/src/react/workflows/UsageSummary.tsx +5 -2
|
@@ -371,3 +371,18 @@ it("labels a complete empty local period without inferring zero from partial his
|
|
|
371
371
|
rerender(<ui.UsageSummary scope={usageScope} {...data} />);
|
|
372
372
|
expect(screen.getByText("No usage in this period.")).toBeTruthy();
|
|
373
373
|
});
|
|
374
|
+
it("explains partial-minute native summaries as unsupported instead of promising refresh will resolve them", () => {
|
|
375
|
+
render(
|
|
376
|
+
<ui.UsageSummary
|
|
377
|
+
scope={usageScope}
|
|
378
|
+
summary={usageSnapshot().summary}
|
|
379
|
+
provider={{
|
|
380
|
+
status: "unsupported",
|
|
381
|
+
reason: "minute_alignment_required",
|
|
382
|
+
retryable: false,
|
|
383
|
+
}}
|
|
384
|
+
/>,
|
|
385
|
+
);
|
|
386
|
+
expect(screen.getByText(/partial-minute billing boundaries/)).toBeTruthy();
|
|
387
|
+
expect(screen.queryByText(/Refresh after provider ingestion/)).toBeNull();
|
|
388
|
+
});
|
|
@@ -179,8 +179,11 @@ export function UsageSummary(props: UsageSummaryProps) {
|
|
|
179
179
|
)}
|
|
180
180
|
{!provider || provider.status !== "available" ? (
|
|
181
181
|
<p role="status">
|
|
182
|
-
Native aggregation {provider?.status ?? "unavailable"}.
|
|
183
|
-
provider
|
|
182
|
+
Native aggregation {provider?.status ?? "unavailable"}.{" "}
|
|
183
|
+
{provider?.status === "unsupported" &&
|
|
184
|
+
provider.reason === "minute_alignment_required"
|
|
185
|
+
? "Exact summaries do not support partial-minute billing boundaries. Reconcile with the native invoice instead."
|
|
186
|
+
: "Refresh after provider ingestion."}
|
|
184
187
|
</p>
|
|
185
188
|
) : (
|
|
186
189
|
<>
|