@fantastic.dev/better-stripe 0.76.0 → 0.77.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 CHANGED
@@ -26,6 +26,12 @@
26
26
  - Remove internal tracker references from public documentation and add a
27
27
  regression check that prevents their reintroduction.
28
28
 
29
+ ## [0.77.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.76.0...v0.77.0) (2026-10-24)
30
+
31
+ ### Features
32
+
33
+ - **example:** authorize captured Checkout receipts ([#386](https://github.com/FantasticDevHQ/better-stripe/issues/386)) ([2589dcc](https://github.com/FantasticDevHQ/better-stripe/commit/2589dcceff5408bd8dd426fd4395a5bb9ab9fd3a))
34
+
29
35
  ## [0.76.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.75.0...v0.76.0) (2026-10-24)
30
36
 
31
37
  ### Features
package/README.md CHANGED
@@ -5,7 +5,7 @@ billing, and Connect marketplaces. It provides checkout, subscriptions, webhook
5
5
  syncing, marketplace fees and splits, payouts, refunds, and disputes, with React
6
6
  hooks and headless UI components.
7
7
 
8
- **Version**: `0.76.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
8
+ **Version**: `0.77.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
9
9
 
10
10
  Connect platforms use the default GA API version. Non-Connect merchants using
11
11
  customer-only Accounts v2 need preview access and an explicit preview version.
@@ -70,12 +70,58 @@ the purchase. A signed webhook adapter may reuse this same qualifier after its
70
70
  real signature verification and original correlation. Calling the qualifier does
71
71
  not create a signed event or replace that adapter's transaction and replay rules.
72
72
 
73
+ ## Authorized Vite receipt read
74
+
75
+ The Vite reference exposes two functions under
76
+ `example/convex/billing/capturedReceipt/`:
77
+
78
+ - `queries.context({ stripeSessionId })` authenticates through the existing
79
+ `historyActor` mapping and returns only `{ actorId, accountId, sessionId }`.
80
+ The original cached Session must be payment-mode, belong to that actor and
81
+ reference a unique personal account owned by the same actor. Missing, foreign
82
+ or organization-scoped Sessions, and missing, foreign, ambiguous or
83
+ organization-scoped account mappings receive the same generic authorization
84
+ rejection. The cached Session reader does not establish Session uniqueness.
85
+ - `actions.read({ stripeSessionId })` calls that same query on the server for
86
+ each read. It does not accept an actor or account supplied by the browser.
87
+ After the example's test-mode key guard, it retrieves the original Session
88
+ with `payment_intent.latest_charge` expanded and calls the public
89
+ `qualifyCapturedCheckoutPayment` helper.
90
+
91
+ The action returns `status: "ready"` with the original Session, PaymentIntent,
92
+ charge and account IDs, livemode, integer minor-unit amount and currency. It
93
+ omits both metadata records, client secrets, URLs and raw provider errors. For an
94
+ authorized actor, incomplete or unavailable provider evidence returns
95
+ `{ status: "unavailable" }`. Authorization failures remain rejections; they do
96
+ not become successful empty reads or evidence that a payment is pending.
97
+
98
+ The default demo is anonymous. Choosing a demonstration buyer or account does
99
+ not authenticate it, and this integration does not install an authentication
100
+ provider. A host must supply verified Convex authentication and the existing
101
+ unique token-to-user mapping before an authorized receipt read is available.
102
+
103
+ For the mounted receipt workflow, use the authoritative context triple as the
104
+ public `useWorkflowAction` scope and keyed child identity. Loading, absent or
105
+ rejected context must remove the previous receipt. Actor or account changes
106
+ must invalidate it even if the Session ID and authenticated boolean stay the
107
+ same. A late response or retry belongs only to its original scope. Show a fixed,
108
+ sanitized unavailable view for query/action failures, never the raw error.
109
+
110
+ Only a `ready` result maps to the public `PaymentReceipt` presentation
111
+ `{ status: "succeeded", amount, currency }`. Do not pass `ready` directly as a
112
+ payment status, invent a zero amount or default currency, or infer capture from
113
+ a cached Session's `complete` status. Host components retain their styles and
114
+ routing; the SDK workflow and receipt remain the shared presentation primitives.
115
+
116
+ This reader performs no fulfillment or access write. It is separate from the
117
+ signed-adapter sketch below and does not turn a provider read into signed-original
118
+ purchase evidence.
119
+
73
120
  ## Reuse from a real signed adapter
74
121
 
75
- The current Vite example does **not** implement an authenticated captured-receipt
76
- adapter or a durable signed-original Checkout fulfillment consumer. The following
77
- is a host integration sketch, not an implemented example handler or an additional
78
- package API:
122
+ The Vite receipt reader does **not** implement a durable signed-original Checkout
123
+ fulfillment consumer. The following is a host integration sketch, not an
124
+ implemented example handler or an additional package API:
79
125
 
80
126
  ```ts
81
127
  import {
@@ -30,6 +30,12 @@ missing, foreign or organization mappings, and overrides any browser-supplied
30
30
  account selector. Existing React `Checkout` workflows remain responsible for
31
31
  checkout presentation; hosts such as Dojo retain their own styles and routing.
32
32
 
33
+ For an individual payment-mode Session, the separate
34
+ [authorized captured-receipt reference](captured-checkout-payment.md#authorized-vite-receipt-read)
35
+ rechecks the authenticated original Session/account before an expanded provider
36
+ read. Its context and receipt workflow do not authorize access from a demo
37
+ persona or treat a cached `complete` Session as payment confirmation.
38
+
33
39
  ## Selectors and results
34
40
 
35
41
  - `customerAccount` must be a V2 `acct_…` identifier. Legacy customer selectors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fantastic.dev/better-stripe",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "description": "Convex component for Stripe Accounts v2, subscriptions, metered billing and Connect marketplaces, with React workflows.",
5
5
  "keywords": [
6
6
  "stripe",