@fantastic.dev/better-stripe 0.33.0 → 0.35.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 +42 -0
- package/README.md +30 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +522 -2
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +261 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +522 -2
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +261 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/refundCommandEvidence.d.ts +14 -0
- package/dist/client/connect/refundCommandEvidence.d.ts.map +1 -0
- package/dist/client/connect/refundCommandEvidence.js +20 -0
- package/dist/client/connect/refundCommandEvidence.js.map +1 -0
- package/dist/client/connect/refundCommandNormalization.d.ts +11 -0
- package/dist/client/connect/refundCommandNormalization.d.ts.map +1 -0
- package/dist/client/connect/refundCommandNormalization.js +12 -0
- package/dist/client/connect/refundCommandNormalization.js.map +1 -0
- package/dist/client/core/accountClosures.d.ts +15 -0
- package/dist/client/core/accountClosures.d.ts.map +1 -0
- package/dist/client/core/accountClosures.js +10 -0
- package/dist/client/core/accountClosures.js.map +1 -0
- package/dist/client/core/accounts.d.ts.map +1 -1
- package/dist/client/core/accounts.js +15 -23
- package/dist/client/core/accounts.js.map +1 -1
- package/dist/client/core/personalAccountMapping.d.ts +8 -0
- package/dist/client/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/client/core/personalAccountMapping.js +11 -0
- package/dist/client/core/personalAccountMapping.js.map +1 -0
- package/dist/client/financialObservations.d.ts +42 -0
- package/dist/client/financialObservations.d.ts.map +1 -0
- package/dist/client/financialObservations.js +58 -0
- package/dist/client/financialObservations.js.map +1 -0
- package/dist/client/financialOwnership.d.ts +52 -0
- package/dist/client/financialOwnership.d.ts.map +1 -0
- package/dist/client/financialOwnership.js +72 -0
- package/dist/client/financialOwnership.js.map +1 -0
- package/dist/client/index.d.ts +57 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +15 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/observationPagination.d.ts +10 -0
- package/dist/client/observationPagination.d.ts.map +1 -0
- package/dist/client/observationPagination.js +12 -0
- package/dist/client/observationPagination.js.map +1 -0
- package/dist/client/publicTypes.d.ts +10 -0
- package/dist/client/publicTypes.d.ts.map +1 -0
- package/dist/client/publicTypes.js +2 -0
- package/dist/client/publicTypes.js.map +1 -0
- package/dist/client/readContracts.d.ts +29 -0
- package/dist/client/readContracts.d.ts.map +1 -1
- package/dist/client/readContracts.js +10 -0
- package/dist/client/readContracts.js.map +1 -1
- package/dist/client/transferObservations.d.ts +59 -0
- package/dist/client/transferObservations.d.ts.map +1 -0
- package/dist/client/transferObservations.js +82 -0
- package/dist/client/transferObservations.js.map +1 -0
- package/dist/component/_generated/component.d.ts +594 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/accountClosure/helpers.d.ts +18 -0
- package/dist/component/accountClosure/helpers.d.ts.map +1 -0
- package/dist/component/accountClosure/helpers.js +18 -0
- package/dist/component/accountClosure/helpers.js.map +1 -0
- package/dist/component/accountClosure/mutations.d.ts +20 -0
- package/dist/component/accountClosure/mutations.d.ts.map +1 -0
- package/dist/component/accountClosure/mutations.js +55 -0
- package/dist/component/accountClosure/mutations.js.map +1 -0
- package/dist/component/accountClosure/queries.d.ts +34 -0
- package/dist/component/accountClosure/queries.d.ts.map +1 -0
- package/dist/component/accountClosure/queries.js +36 -0
- package/dist/component/accountClosure/queries.js.map +1 -0
- package/dist/component/accountClosure/schema.d.ts +46 -0
- package/dist/component/accountClosure/schema.d.ts.map +1 -0
- package/dist/component/accountClosure/schema.js +20 -0
- package/dist/component/accountClosure/schema.js.map +1 -0
- package/dist/component/affiliateRecovery/mutations.d.ts.map +1 -1
- package/dist/component/affiliateRecovery/mutations.js +4 -1
- package/dist/component/affiliateRecovery/mutations.js.map +1 -1
- package/dist/component/connect/mutations.d.ts.map +1 -1
- package/dist/component/connect/mutations.js +18 -2
- package/dist/component/connect/mutations.js.map +1 -1
- package/dist/component/connect/queries.d.ts +8 -0
- package/dist/component/connect/queries.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.js +7 -1
- package/dist/component/connect/reversalClaims.js.map +1 -1
- package/dist/component/connect/reversalReceipts.d.ts.map +1 -1
- package/dist/component/connect/reversalReceipts.js +2 -0
- package/dist/component/connect/reversalReceipts.js.map +1 -1
- package/dist/component/connect/schema.d.ts +11 -1
- package/dist/component/connect/schema.d.ts.map +1 -1
- package/dist/component/connect/schema.js +9 -1
- package/dist/component/connect/schema.js.map +1 -1
- package/dist/component/connect/validators.d.ts +9 -1
- package/dist/component/connect/validators.d.ts.map +1 -1
- package/dist/component/connect/validators.js +2 -0
- package/dist/component/connect/validators.js.map +1 -1
- package/dist/component/core/mutations.d.ts.map +1 -1
- package/dist/component/core/mutations.js +5 -0
- package/dist/component/core/mutations.js.map +1 -1
- package/dist/component/core/personalAccountMapping.d.ts +95 -0
- package/dist/component/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/component/core/personalAccountMapping.js +54 -0
- package/dist/component/core/personalAccountMapping.js.map +1 -0
- package/dist/component/core/queries.d.ts +27 -0
- package/dist/component/core/queries.d.ts.map +1 -1
- package/dist/component/core/queries.js +7 -0
- package/dist/component/core/queries.js.map +1 -1
- package/dist/component/earnings/triggers.d.ts +468 -2
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/earnings/triggers.js +7 -1
- package/dist/component/earnings/triggers.js.map +1 -1
- package/dist/component/financialObservations/continuation.d.ts +7 -0
- package/dist/component/financialObservations/continuation.d.ts.map +1 -0
- package/dist/component/financialObservations/continuation.js +131 -0
- package/dist/component/financialObservations/continuation.js.map +1 -0
- package/dist/component/financialObservations/generations.d.ts +6 -0
- package/dist/component/financialObservations/generations.d.ts.map +1 -0
- package/dist/component/financialObservations/generations.js +46 -0
- package/dist/component/financialObservations/generations.js.map +1 -0
- package/dist/component/financialObservations/mutations.d.ts +62 -0
- package/dist/component/financialObservations/mutations.d.ts.map +1 -0
- package/dist/component/financialObservations/mutations.js +69 -0
- package/dist/component/financialObservations/mutations.js.map +1 -0
- package/dist/component/financialObservations/queries.d.ts +307 -0
- package/dist/component/financialObservations/queries.d.ts.map +1 -0
- package/dist/component/financialObservations/queries.js +219 -0
- package/dist/component/financialObservations/queries.js.map +1 -0
- package/dist/component/financialObservations/schema.d.ts +182 -0
- package/dist/component/financialObservations/schema.d.ts.map +1 -0
- package/dist/component/financialObservations/schema.js +53 -0
- package/dist/component/financialObservations/schema.js.map +1 -0
- package/dist/component/financialObservations/settlement.d.ts +7 -0
- package/dist/component/financialObservations/settlement.d.ts.map +1 -0
- package/dist/component/financialObservations/settlement.js +118 -0
- package/dist/component/financialObservations/settlement.js.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts +46 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.js +70 -0
- package/dist/component/financialObservations/settlementHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferBatches.d.ts +12 -0
- package/dist/component/financialObservations/transferBatches.d.ts.map +1 -0
- package/dist/component/financialObservations/transferBatches.js +76 -0
- package/dist/component/financialObservations/transferBatches.js.map +1 -0
- package/dist/component/financialObservations/transferContinuation.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuation.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuation.js +35 -0
- package/dist/component/financialObservations/transferContinuation.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts +8 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.js +69 -0
- package/dist/component/financialObservations/transferContinuationState.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.js +174 -0
- package/dist/component/financialObservations/transferContinuationSteps.js.map +1 -0
- package/dist/component/financialObservations/transferHelpers.d.ts +18 -0
- package/dist/component/financialObservations/transferHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/transferHelpers.js +37 -0
- package/dist/component/financialObservations/transferHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts +56 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.js +21 -0
- package/dist/component/financialObservations/transferReferenceSchema.js.map +1 -0
- package/dist/component/financialObservations/transferSchema.d.ts +237 -0
- package/dist/component/financialObservations/transferSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferSchema.js +65 -0
- package/dist/component/financialObservations/transferSchema.js.map +1 -0
- package/dist/component/financialObservations/transfers.d.ts +7 -0
- package/dist/component/financialObservations/transfers.d.ts.map +1 -0
- package/dist/component/financialObservations/transfers.js +79 -0
- package/dist/component/financialObservations/transfers.js.map +1 -0
- package/dist/component/financialOwnership/helpers.d.ts +37 -0
- package/dist/component/financialOwnership/helpers.d.ts.map +1 -0
- package/dist/component/financialOwnership/helpers.js +76 -0
- package/dist/component/financialOwnership/helpers.js.map +1 -0
- package/dist/component/financialOwnership/mutations.d.ts +28 -0
- package/dist/component/financialOwnership/mutations.d.ts.map +1 -0
- package/dist/component/financialOwnership/mutations.js +74 -0
- package/dist/component/financialOwnership/mutations.js.map +1 -0
- package/dist/component/financialOwnership/queries.d.ts +57 -0
- package/dist/component/financialOwnership/queries.d.ts.map +1 -0
- package/dist/component/financialOwnership/queries.js +50 -0
- package/dist/component/financialOwnership/queries.js.map +1 -0
- package/dist/component/financialOwnership/schema.d.ts +140 -0
- package/dist/component/financialOwnership/schema.d.ts.map +1 -0
- package/dist/component/financialOwnership/schema.js +35 -0
- package/dist/component/financialOwnership/schema.js.map +1 -0
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/commandBinding.d.ts +17 -0
- package/dist/component/refundHistory/commandBinding.d.ts.map +1 -0
- package/dist/component/refundHistory/commandBinding.js +41 -0
- package/dist/component/refundHistory/commandBinding.js.map +1 -0
- package/dist/component/refundHistory/commandEvidence.d.ts +50 -0
- package/dist/component/refundHistory/commandEvidence.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidence.js +54 -0
- package/dist/component/refundHistory/commandEvidence.js.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts +89 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js +8 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js.map +1 -0
- package/dist/component/refundHistory/commandFields.d.ts +8 -0
- package/dist/component/refundHistory/commandFields.d.ts.map +1 -0
- package/dist/component/refundHistory/commandFields.js +9 -0
- package/dist/component/refundHistory/commandFields.js.map +1 -0
- package/dist/component/refundHistory/mutations.d.ts +8 -0
- package/dist/component/refundHistory/mutations.d.ts.map +1 -0
- package/dist/component/refundHistory/mutations.js +25 -0
- package/dist/component/refundHistory/mutations.js.map +1 -0
- package/dist/component/refundHistory/queries.d.ts +51 -0
- package/dist/component/refundHistory/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/queries.js +14 -0
- package/dist/component/refundHistory/queries.js.map +1 -1
- package/dist/component/schema.d.ts +261 -1
- package/dist/component/schema.js +14 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/settlement/mutations.d.ts.map +1 -1
- package/dist/component/settlement/mutations.js +5 -1
- package/dist/component/settlement/mutations.js.map +1 -1
- package/dist/shared/refundCommandScope.d.ts +10 -0
- package/dist/shared/refundCommandScope.d.ts.map +1 -0
- package/dist/shared/refundCommandScope.js +9 -0
- package/dist/shared/refundCommandScope.js.map +1 -0
- package/docs/financial-observations.md +159 -0
- package/docs/financial-ownership.md +54 -0
- package/docs/personal-account-mapping.md +54 -0
- package/docs/refund-command-evidence.md +49 -0
- package/package.json +6 -2
- package/src/client/connect/refundCommandEvidence.ts +41 -0
- package/src/client/connect/refundCommandNormalization.ts +28 -0
- package/src/client/core/account-close-orchestration.test.ts +131 -0
- package/src/client/core/account-closure.test.ts +317 -0
- package/src/client/core/accountClosures.ts +37 -0
- package/src/client/core/accounts.test.ts +0 -111
- package/src/client/core/accounts.ts +24 -29
- package/src/client/core/personal-account-mapping.test.ts +71 -0
- package/src/client/core/personalAccountMapping.ts +23 -0
- package/src/client/financialObservations.test.ts +109 -0
- package/src/client/financialObservations.ts +106 -0
- package/src/client/financialOwnership.test.ts +80 -0
- package/src/client/financialOwnership.ts +116 -0
- package/src/client/index.ts +38 -35
- package/src/client/observationPagination.ts +11 -0
- package/src/client/publicTypes.ts +72 -0
- package/src/client/readContracts.ts +21 -0
- package/src/client/refund-command-evidence.test.ts +68 -0
- package/src/client/refund-command-normalization.test.ts +61 -0
- package/src/client/transferContinuation.test.ts +94 -0
- package/src/client/transferObservations.test.ts +98 -0
- package/src/client/transferObservations.ts +180 -0
- package/src/component/_generated/api.ts +52 -0
- package/src/component/_generated/component.ts +716 -0
- package/src/component/accountClosure/helpers.ts +21 -0
- package/src/component/accountClosure/mutations.ts +56 -0
- package/src/component/accountClosure/queries.ts +43 -0
- package/src/component/accountClosure/schema.ts +20 -0
- package/src/component/affiliateRecovery/mutations.ts +10 -1
- package/src/component/connect/mutations.ts +29 -2
- package/src/component/connect/reversalClaims.ts +19 -1
- package/src/component/connect/reversalReceipts.ts +2 -0
- package/src/component/connect/schema.ts +9 -1
- package/src/component/connect/validators.ts +2 -0
- package/src/component/core/mutations.ts +3 -0
- package/src/component/core/personal-account-mapping.test.ts +173 -0
- package/src/component/core/personalAccountMapping.ts +81 -0
- package/src/component/core/queries.ts +11 -0
- package/src/component/core/reset.test.ts +8 -1
- package/src/component/earnings/earnings-totals.test.ts +14 -10
- package/src/component/earnings/triggers.ts +9 -1
- package/src/component/financialObservations/continuation.test.ts +445 -0
- package/src/component/financialObservations/continuation.ts +159 -0
- package/src/component/financialObservations/generations.ts +53 -0
- package/src/component/financialObservations/mutations.ts +75 -0
- package/src/component/financialObservations/observation-boundaries.test.ts +466 -0
- package/src/component/financialObservations/queries.ts +246 -0
- package/src/component/financialObservations/schema.ts +68 -0
- package/src/component/financialObservations/settlement-observations.test.ts +86 -0
- package/src/component/financialObservations/settlement.ts +142 -0
- package/src/component/financialObservations/settlementHelpers.ts +92 -0
- package/src/component/financialObservations/transfer-batches.test.ts +61 -0
- package/src/component/financialObservations/transfer-boundaries.test.ts +116 -0
- package/src/component/financialObservations/transfer-continuation-guards.test.ts +428 -0
- package/src/component/financialObservations/transfer-continuation.test.ts +154 -0
- package/src/component/financialObservations/transfer-observations.test.ts +212 -0
- package/src/component/financialObservations/transfer-overflow.test.ts +181 -0
- package/src/component/financialObservations/transfer-writers.test.ts +162 -0
- package/src/component/financialObservations/transferBatches.ts +96 -0
- package/src/component/financialObservations/transferContinuation.ts +53 -0
- package/src/component/financialObservations/transferContinuationState.ts +85 -0
- package/src/component/financialObservations/transferContinuationSteps.ts +232 -0
- package/src/component/financialObservations/transferHelpers.ts +38 -0
- package/src/component/financialObservations/transferReferenceSchema.ts +20 -0
- package/src/component/financialObservations/transferSchema.ts +74 -0
- package/src/component/financialObservations/transfers.ts +99 -0
- package/src/component/financialOwnership/financial-ownership.test.ts +102 -0
- package/src/component/financialOwnership/helpers.ts +98 -0
- package/src/component/financialOwnership/mutations.ts +83 -0
- package/src/component/financialOwnership/ownership-boundaries.test.ts +308 -0
- package/src/component/financialOwnership/queries.ts +65 -0
- package/src/component/financialOwnership/schema.ts +35 -0
- package/src/component/refundHistory/command-evidence.test.ts +288 -0
- package/src/component/refundHistory/command-normalization-resource.test.ts +77 -0
- package/src/component/refundHistory/command-normalization.test.ts +229 -0
- package/src/component/refundHistory/command-provenance.test.ts +59 -0
- package/src/component/refundHistory/commandBinding.ts +54 -0
- package/src/component/refundHistory/commandEvidence.ts +71 -0
- package/src/component/refundHistory/commandEvidenceValidator.ts +18 -0
- package/src/component/refundHistory/commandFields.ts +9 -0
- package/src/component/refundHistory/mutations.ts +33 -0
- package/src/component/refundHistory/queries.ts +15 -0
- package/src/component/schema.ts +24 -0
- package/src/component/settlement/mutations.ts +5 -1
- package/src/shared/refundCommandScope.ts +19 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Financial bucket ownership provenance
|
|
2
|
+
|
|
3
|
+
`betterStripe.financialOwnership` records immutable host ownership of a financial bucket. It supports physical Stripe account keys and opaque logical keys, including affiliate earnings that have no provider account yet. This is provenance, not a second money ledger. Registration does not rewrite source keys, amounts, balances, transfers or payout history.
|
|
4
|
+
|
|
5
|
+
All registration, lookup and discovery responses report `coverage: "unknown"`. Exhausting discovery means only that the registered ownership rows for that exact scope were enumerated. It does not establish complete financial history, absence of outstanding work, current provider usability or permission to close an account. No API accepts a `complete` flag. Source observations, legacy backfill, financial attempt admission and host business-policy guards require separate accepted integrations.
|
|
6
|
+
|
|
7
|
+
## Trusted host boundary
|
|
8
|
+
|
|
9
|
+
Call this API only from an authorized server adapter. Authenticate the current host actor and derive its allowed owner scope before supplying `userId` and optional `orgId`. Neither a bucket key, cursor nor a claimed user identifier is authorization. Component lookup intentionally returns provenance for a trusted host; do not expose it as an unrestricted browser query.
|
|
10
|
+
|
|
11
|
+
For a new physical registration, the component verifies exact current reciprocal mapping through the unique personal resolver or bounded organization-scope proof. A historical registration requires one exact closed-account owner record. Duplicate mappings, duplicate closure records, foreign ownership, unresolved closure, ownerless history and malformed provider keys refuse registration. Pending capability/KYC is unrelated to ownership and is not interpreted as readiness.
|
|
12
|
+
|
|
13
|
+
Logical ownership is a host-domain fact. Before registering it, the host must verify the actual immutable source record and its owner, then supply its stable integration and record identity. Arbitrary key spelling such as `user:123` or `acct_example` never implies ownership. A proof reference records the host's verified source; it alone does not establish coverage. Unverified legacy keys remain unknown. An absent host migration/integration cannot be replaced with a guessed alias list or account timestamp.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// Server only, after current-actor authorization and actual source-owner verification.
|
|
17
|
+
await betterStripe.financialOwnership.register(ctx, {
|
|
18
|
+
bucketKey: source.financialBucketKey,
|
|
19
|
+
kind: "logical",
|
|
20
|
+
userId: source.verifiedOwnerUserId,
|
|
21
|
+
source: {
|
|
22
|
+
integration: "host-affiliate-registration-v1",
|
|
23
|
+
recordId: source.id,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Server-derived personal account selector; physical proof is component-owned.
|
|
28
|
+
await betterStripe.financialOwnership.register(ctx, {
|
|
29
|
+
bucketKey: verifiedAccountId,
|
|
30
|
+
kind: "stripe_account",
|
|
31
|
+
userId: authenticatedOwnerId,
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Immutable receipts and bounded discovery
|
|
36
|
+
|
|
37
|
+
Exact-key lookup returns `status: "unknown"` for an unregistered bucket or `status: "registered"` with its immutable registration. Matching registration retries reuse the same receipt. Changing its owner, kind or logical source identity rejects atomically. A previously verified physical receipt survives closure and active mapping removal; replay returns original ownership provenance, not a fresh current-account or readiness assertion.
|
|
38
|
+
|
|
39
|
+
Owner scope is the exact `userId` and optional `orgId` tuple. Organization-owned registrations never appear in a personal discovery query, even when they retain the same user identifier. Hosts must authorize both selectors and retain historical organization context rather than inheriting it into personal ownership.
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const page = await betterStripe.financialOwnership.discover(ctx, {
|
|
43
|
+
userId: authenticatedOwnerId,
|
|
44
|
+
paginationOpts: { numItems: 25, cursor: previousCursor },
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Pages use the component-compatible indexed paginator, at most 100 requested rows with fixed 200-row/1 MB read bounds. Preserve `continueCursor`, `isDone`, optional split metadata and native pagination identity. A full last page can require an empty continuation before `isDone` becomes true. Keep cursors scoped to the authorized owner query; a cursor is not an immutable snapshot.
|
|
49
|
+
|
|
50
|
+
The returned generation advances only when a new bucket is registered in that owner scope. Matching replay does not advance it. It is a registration provenance generation, not a financial revision. Registration itself has no financial writer observers. The separate [settlement source observations](./financial-observations.md) integration observes bounded raw allocation destinations only and has its own diagnostic generations; it does not establish complete financial coverage. Newly written or unmapped records outside that producer are still unobserved. No completeness claim is available at all.
|
|
51
|
+
|
|
52
|
+
## Verification boundary
|
|
53
|
+
|
|
54
|
+
Real-schema tests exercise current and closed ownership, explicit logical provenance, ambiguity/refusal, replay/conflict, organization isolation, pagination beyond 100 rows and unchanged financial records. Public SDK tests dispatch through the actual component without a Stripe secret. Native verification must use an isolated component runtime. These tests establish registration/discovery behavior only; they perform no provider closure, bank payout, settlement or live financial acceptance.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Unambiguous personal account mappings
|
|
2
|
+
|
|
3
|
+
`stripe.getPersonalAccountMapping(ctx, { userId })` reads component identity
|
|
4
|
+
mappings without contacting Stripe. It returns the exported
|
|
5
|
+
`PersonalAccountMapping` discriminated union:
|
|
6
|
+
|
|
7
|
+
- `status: "unique"` includes the original account document.
|
|
8
|
+
- `status: "unavailable"` includes `missing`, `ambiguous`, `organization`,
|
|
9
|
+
`invalid_account`, `closure_unresolved` or `closed` as its reason.
|
|
10
|
+
|
|
11
|
+
The required user selector is exact, nonempty, at most 256 characters and free of
|
|
12
|
+
ASCII control characters. Extra SDK options are rejected before component reads.
|
|
13
|
+
A successful result requires exactly one user-index match, no organization field
|
|
14
|
+
(including an empty organization ID), a canonical `acct_` identifier of at most
|
|
15
|
+
128 characters and exactly one reciprocal Stripe-account-index match pointing
|
|
16
|
+
to the same document. Each index read takes at most two rows. A candidate's
|
|
17
|
+
closure index also takes at most two rows: duplicate closure provenance, pending
|
|
18
|
+
closure or terminal closure makes that candidate unavailable. At most six rows
|
|
19
|
+
are read; there is no whole-table scan, provider read or financial write.
|
|
20
|
+
|
|
21
|
+
Two records for one user are ambiguous even when the older record was inserted
|
|
22
|
+
first, or one record belongs to an organization. The reader neither selects the
|
|
23
|
+
newest account nor migrates ownership or funds. It preserves the existing
|
|
24
|
+
`getAccountByUserId`, `getAccountByStripeId` and organization getters for consumers
|
|
25
|
+
that depend on their legacy behavior. Do not use those first-match getters as
|
|
26
|
+
proof of unique personal ownership.
|
|
27
|
+
|
|
28
|
+
Authenticate and authorize the enabled host actor before deriving `userId` on
|
|
29
|
+
the server. User IDs supplied by the browser or a Vite demo persona do not prove
|
|
30
|
+
authentication. For a refund, derive the original merchant from verified payment
|
|
31
|
+
routing first, then compare that original identifier to the unique mapping for
|
|
32
|
+
the authorized owner. A community ownership transfer cannot remap an old
|
|
33
|
+
merchant's payment to its new owner. Unknown or ambiguous mappings must remain
|
|
34
|
+
unavailable.
|
|
35
|
+
|
|
36
|
+
The matching Vite server binding is
|
|
37
|
+
[`requireOriginalPersonalAccount`](../example/convex/billing/personalAccountMapping.ts).
|
|
38
|
+
It takes an already-authenticated server identity and the server-verified original
|
|
39
|
+
account identifier, rejects a different owner, organization or replacement
|
|
40
|
+
account, and forwards component errors. It is a reference adapter, not a session
|
|
41
|
+
authentication implementation. A production host supplies its real session,
|
|
42
|
+
tenant authorization and immutable payment provenance.
|
|
43
|
+
|
|
44
|
+
Component mutations can reuse `resolvePersonalAccountMapping` from
|
|
45
|
+
`src/component/core/personalAccountMapping.ts` in their transaction; mutation
|
|
46
|
+
contexts satisfy its query-context database interface. This avoids duplicating
|
|
47
|
+
the reciprocal and closure checks when admitting an ownership binding.
|
|
48
|
+
|
|
49
|
+
A unique component mapping is identity evidence at the time of the read. It does
|
|
50
|
+
not prove provider freshness, merchant capabilities, settlement eligibility,
|
|
51
|
+
available balance or permission to create a refund. Original invoice allocation,
|
|
52
|
+
buyer, currency, charge, refund history and creation-time revalidation remain
|
|
53
|
+
separate requirements. Closed-account history uses the dedicated historical
|
|
54
|
+
provenance APIs; this reader never revives a closed account.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Refund-command evidence
|
|
2
|
+
|
|
3
|
+
The package provides a bounded component reader for an opaque host refund-command key. It observes synchronized refund records; it does not contact Stripe, prove provider absence, authorize a retry or certify completed money. Public artifact verification and host adoption are separate from source acceptance.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const evidence = await stripe.getRefundCommandEvidence(ctx, {
|
|
7
|
+
commandKey: originalCommand.providerIdempotencyKey,
|
|
8
|
+
stripeAccountId: originalCommand.originalMerchantAccount,
|
|
9
|
+
stripePaymentIntentId: originalCommand.stripePaymentIntentId,
|
|
10
|
+
stripeChargeId: originalCommand.stripeChargeId,
|
|
11
|
+
currency: originalCommand.currency,
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Authenticate and authorize the host caller before this call. Derive every selector from the original immutable command and verified payment routing. Current community owners or replacement accounts must not remap old payments. The server-only [Vite reference](../example/convex/connect/refundCommandEvidence.ts) verifies a reciprocal unique personal mapping against the original account; demo personas are not authentication. The host still qualifies the original command fingerprint, buyer, invoice allocation, amount/reason, permission and lifecycle.
|
|
16
|
+
|
|
17
|
+
## Result and bounds
|
|
18
|
+
|
|
19
|
+
The result is either `observed` with the refund document or `unavailable` with a reason: `missing`, `normalization_incomplete`, `ambiguous`, `correlation_conflict`, `scope_mismatch` or `invalid_receipt`.
|
|
20
|
+
|
|
21
|
+
The reader first checks one indexed legacy normalization row, then reads at most two rows for the exact global command key and at most two for the candidate provider refund ID. Command-key duplicate detection precedes account/PI/charge/currency qualification; a foreign duplicate cannot be filtered into apparent uniqueness. Duplicated provider refund IDs under different command keys also remain ambiguous. A unique observed row must match the original scope and retain positive safe integer original units and a canonical refund ID. Pending, failed and succeeded states remain distinct. Currency shape validation does not establish supported currency or input precision; the host uses the public currency helpers and original-charge contract.
|
|
22
|
+
|
|
23
|
+
`missing` is unknown synchronized evidence, never permission to create another refund. `observed` is also not financial completion or an assertion that every provider receipt has arrived. Reobserve when relevant data changes; the exact index discovers later inserts and metadata enrichment independently of a previously exhausted history cursor. Existing `paginateRefunds` retains its history semantics, including pinned cursors; a ten-page budget is per invocation, not a lifetime absence proof.
|
|
24
|
+
|
|
25
|
+
## Immutable correlation convention
|
|
26
|
+
|
|
27
|
+
Before the first provider execution, the host may put its existing stable opaque identity into `metadata.betterStripeRefundCommand` and its immutable fingerprint into a separate metadata field. For example, Dojo's already prepared identity `dojo-refund:<commandId>:v1` and original fingerprint can be reused without generating a replacement command or idempotency key. The package does not inject metadata or change `createRefund` parameters. Do not add this convention to an already prepared or executed provider payload if that would change parameters of a same-key replay; hold or reconcile such an older request under its actual original contract.
|
|
28
|
+
|
|
29
|
+
Command keys are 16–200 canonical ASCII letters, digits, colons, underscores or hyphens. They are correlation selectors, not credentials or authorization. Keep private data out of provider metadata. The host independently verifies the fingerprint and original terms; the reader does not equate matching metadata with permission.
|
|
30
|
+
|
|
31
|
+
Every current refund upsert normalizes existing metadata before applying incoming metadata. The first known key remains indexed. An omitted metadata field on a partial upsert adds no contradictory fact and preserves the binding. Explicitly present missing, invalid or different correlation metadata after a known binding latches a conflict, even if a later event restores the former raw metadata. Original raw provider fields are retained; correlation is a projection on the existing refund row, not another financial ledger.
|
|
32
|
+
|
|
33
|
+
`refundCommandObservedAt` is the time the normalizer first observed that binding. Neither it nor the row's insertion time proves original provider creation time. A legacy row's key is first-known component metadata, not a claim about what the original Stripe request contained. Unknown original request provenance remains the host's held reconciliation case.
|
|
34
|
+
|
|
35
|
+
## Legacy rollout hold
|
|
36
|
+
|
|
37
|
+
Any row without normalization version 1 keeps the reader unavailable globally. Otherwise an unindexed old metadata key plus an indexed newer duplicate could appear falsely unique. The indexed coverage hold is bounded and deliberately conservative, even for an unrelated legacy row.
|
|
38
|
+
|
|
39
|
+
Trusted host maintenance can drain the pending version index through `normalizeRefundCommandBindings(ctx, { limit })`, with an explicit integer limit from 1 to 100. Each transaction reads at most that many pending rows, patches only the reviewed correlation projection/version fields, then checks at most one remaining pending row. The result `{ normalized, hasMore }` reports this batch and current pending coverage. Processed rows leave the pending index, so repeat while `hasMore` is true without a full-history scan, cursor rewind or lifetime cap. Concurrent calls use Convex transactional conflict handling; a repeated call after drainage is an idempotent empty batch.
|
|
40
|
+
|
|
41
|
+
This global maintenance operation requires a trusted platform operator or internal deployment task. Never expose it to community sellers, demo personas or an unauthenticated browser. The [Vite maintenance reference](../example/convex/connect/refundCommandNormalization.ts) is deliberately an unregistered server helper. Host authentication and platform authorization must happen before calling it. Raw metadata, original account/PI/charge/currency/amount/status and financial fields remain unchanged; the same first-known-binding/conflict normalizer used by ingestion is reused. Rows without correlation become normalized unbound records; invalid reserved metadata latches a conflict. An old valid key plus an existing newer match becomes ambiguous after normalization, not falsely unique.
|
|
42
|
+
|
|
43
|
+
`hasMore: false` observes only the current trusted-writer component backlog at the transaction snapshot. It does not prove provider history is complete, prevent later legacy ingestion or authorize any refund request. A later pending row reactivates the reader’s global hold until another bounded drain. Current upserts can reobserve individual legacy rows with the same normalizer. Until all pending rows are normalized, this reader cannot report an observed unique match. Normalization coverage means only the current records written through the trusted component contract have been normalized. It does not establish complete historical Stripe ingestion, discover refunds never delivered to the component or authorize a provider retry.
|
|
44
|
+
|
|
45
|
+
## Native resource limits
|
|
46
|
+
|
|
47
|
+
The per-call limit bounds rows, not bytes. Large raw metadata can make a batch exceed native transaction read/write budgets even within the 100-row limit. Adding projection fields to an individual legacy document near the native document ceiling can also fail. This primitive does not promise capacity for every schema-legal legacy backlog.
|
|
48
|
+
|
|
49
|
+
A native failure rejects the mutation atomically: no partial normalization is committed and no completion result is returned. The unnormalized rows remain pending, so the exact reader stays held. A smaller limit can reduce batch bytes, but cannot solve an individual document ceiling. Keep that case held for investigation; do not skip/delete rows or rewrite raw metadata to manufacture completion. An empty native-dispatch check is not large-backlog capacity evidence.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fantastic.dev/better-stripe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "A Convex component for Stripe V2 Accounts API integration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stripe",
|
|
@@ -67,7 +67,11 @@
|
|
|
67
67
|
"docs/read-contracts.md",
|
|
68
68
|
"docs/invoice-payment-pages.md",
|
|
69
69
|
"docs/checkout-session-pages.md",
|
|
70
|
-
"docs/refund-context.md"
|
|
70
|
+
"docs/refund-context.md",
|
|
71
|
+
"docs/refund-command-evidence.md",
|
|
72
|
+
"docs/personal-account-mapping.md",
|
|
73
|
+
"docs/financial-ownership.md",
|
|
74
|
+
"docs/financial-observations.md"
|
|
71
75
|
],
|
|
72
76
|
"scripts": {
|
|
73
77
|
"build": "tsc --project ./tsconfig.build.json",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Infer } from "convex/values";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { assertRefundCommandScope } from "../../shared/refundCommandScope.js";
|
|
4
|
+
import type { refundCommandEvidenceValidator } from "../../component/refundHistory/commandEvidenceValidator.js";
|
|
5
|
+
import type { Component, RunCtx } from "../helpers.js";
|
|
6
|
+
import { componentRef } from "../webhooks/helpers.js";
|
|
7
|
+
|
|
8
|
+
export type RefundCommandEvidence = Infer<
|
|
9
|
+
typeof refundCommandEvidenceValidator
|
|
10
|
+
>;
|
|
11
|
+
export type RefundCommandEvidenceOptions = {
|
|
12
|
+
commandKey: string;
|
|
13
|
+
stripeAccountId: string;
|
|
14
|
+
stripePaymentIntentId: string;
|
|
15
|
+
stripeChargeId: string;
|
|
16
|
+
currency: string;
|
|
17
|
+
};
|
|
18
|
+
const optionsSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
commandKey: z.string(),
|
|
21
|
+
stripeAccountId: z.string(),
|
|
22
|
+
stripePaymentIntentId: z.string(),
|
|
23
|
+
stripeChargeId: z.string(),
|
|
24
|
+
currency: z.string(),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
|
|
28
|
+
/** Host authorization and original command qualification are required before this observation. */
|
|
29
|
+
export async function getRefundCommandEvidence(
|
|
30
|
+
component: Component,
|
|
31
|
+
ctx: RunCtx,
|
|
32
|
+
input: RefundCommandEvidenceOptions,
|
|
33
|
+
): Promise<RefundCommandEvidence> {
|
|
34
|
+
const { stripeAccountId, ...options } = optionsSchema.parse(input);
|
|
35
|
+
const scope = { ...options, accountId: stripeAccountId };
|
|
36
|
+
assertRefundCommandScope(scope);
|
|
37
|
+
return ctx.runQuery(
|
|
38
|
+
componentRef(component, "refundHistory/queries/getRefundCommandEvidence"),
|
|
39
|
+
scope,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runMutationOrThrow, type RunCtx, type Component } from "../helpers.js";
|
|
3
|
+
import { componentRef } from "../webhooks/helpers.js";
|
|
4
|
+
export type RefundCommandNormalizationOptions = { limit: number };
|
|
5
|
+
export type RefundCommandNormalizationResult = {
|
|
6
|
+
normalized: number;
|
|
7
|
+
hasMore: boolean;
|
|
8
|
+
};
|
|
9
|
+
const optionsSchema = z
|
|
10
|
+
.object({ limit: z.number().int().min(1).max(100) })
|
|
11
|
+
.strict();
|
|
12
|
+
|
|
13
|
+
/** Trusted-host projection maintenance; a drained component backlog is not complete provider history. */
|
|
14
|
+
export async function normalizeRefundCommandBindings(
|
|
15
|
+
component: Component,
|
|
16
|
+
ctx: RunCtx,
|
|
17
|
+
opts: RefundCommandNormalizationOptions,
|
|
18
|
+
): Promise<RefundCommandNormalizationResult> {
|
|
19
|
+
const args = optionsSchema.parse(opts);
|
|
20
|
+
return runMutationOrThrow(
|
|
21
|
+
ctx,
|
|
22
|
+
componentRef(
|
|
23
|
+
component,
|
|
24
|
+
"refundHistory/mutations/normalizeRefundCommandBindings",
|
|
25
|
+
),
|
|
26
|
+
args,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import type Stripe from "stripe";
|
|
4
|
+
import type { Component, RunCtx } from "../helpers.js";
|
|
5
|
+
import { closeAccount, restartAccountOnboarding } from "./accounts.js";
|
|
6
|
+
|
|
7
|
+
function makeStripe() {
|
|
8
|
+
return { v2: { core: { accounts: { close: vi.fn(), retrieve: vi.fn() } } } };
|
|
9
|
+
}
|
|
10
|
+
function asStripe(stripe: ReturnType<typeof makeStripe>) {
|
|
11
|
+
return stripe as unknown as Stripe;
|
|
12
|
+
}
|
|
13
|
+
function makeComponent() {
|
|
14
|
+
return {
|
|
15
|
+
accountClosure: {
|
|
16
|
+
mutations: {
|
|
17
|
+
prepare: refFor("accountClosure/mutations/prepare"),
|
|
18
|
+
complete: refFor("accountClosure/mutations/complete"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
} as unknown as Component;
|
|
22
|
+
}
|
|
23
|
+
function refFor(path: string) {
|
|
24
|
+
return { [Symbol.for("toReferencePath")]: `betterStripe/${path}` };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe("closeAccount / restartAccountOnboarding", () => {
|
|
28
|
+
function context(appliedConfigurations?: string[], state = "pending") {
|
|
29
|
+
const runMutation = vi
|
|
30
|
+
.fn()
|
|
31
|
+
.mockResolvedValueOnce({
|
|
32
|
+
closure: { appliedConfigurations, state },
|
|
33
|
+
isRetry: false,
|
|
34
|
+
})
|
|
35
|
+
.mockResolvedValue(null);
|
|
36
|
+
return { ctx: { runMutation } as unknown as RunCtx, runMutation };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
it("pins stored configurations before close and completes without deleting provenance", async () => {
|
|
40
|
+
const stripe = makeStripe();
|
|
41
|
+
const { ctx, runMutation } = context(["merchant", "recipient"]);
|
|
42
|
+
expect(
|
|
43
|
+
await closeAccount(asStripe(stripe), makeComponent(), ctx, {
|
|
44
|
+
stripeAccountId: "acct_close",
|
|
45
|
+
}),
|
|
46
|
+
).toEqual({ closed: true });
|
|
47
|
+
expect(stripe.v2.core.accounts.retrieve).not.toHaveBeenCalled();
|
|
48
|
+
expect(stripe.v2.core.accounts.close).toHaveBeenCalledWith(
|
|
49
|
+
"acct_close",
|
|
50
|
+
{ applied_configurations: ["merchant", "recipient"] },
|
|
51
|
+
{ idempotencyKey: "betterstripe-close:acct_close" },
|
|
52
|
+
);
|
|
53
|
+
expect(runMutation.mock.calls.map((call) => call[0])).toEqual([
|
|
54
|
+
refFor("accountClosure/mutations/prepare"),
|
|
55
|
+
refFor("accountClosure/mutations/complete"),
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("retrieves configurations when none were stored", async () => {
|
|
60
|
+
const stripe = makeStripe();
|
|
61
|
+
stripe.v2.core.accounts.retrieve.mockResolvedValue({
|
|
62
|
+
applied_configurations: ["merchant"],
|
|
63
|
+
});
|
|
64
|
+
const { ctx } = context();
|
|
65
|
+
await closeAccount(asStripe(stripe), makeComponent(), ctx, {
|
|
66
|
+
stripeAccountId: "acct_fallback",
|
|
67
|
+
});
|
|
68
|
+
expect(stripe.v2.core.accounts.close).toHaveBeenCalledWith(
|
|
69
|
+
"acct_fallback",
|
|
70
|
+
{ applied_configurations: ["merchant"] },
|
|
71
|
+
{ idempotencyKey: "betterstripe-close:acct_fallback" },
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("preserves pending provenance and refuses close when required provider lookup fails", async () => {
|
|
76
|
+
const stripe = makeStripe();
|
|
77
|
+
stripe.v2.core.accounts.retrieve.mockRejectedValue(
|
|
78
|
+
new Error("retrieve unavailable"),
|
|
79
|
+
);
|
|
80
|
+
const { ctx, runMutation } = context();
|
|
81
|
+
await expect(
|
|
82
|
+
closeAccount(asStripe(stripe), makeComponent(), ctx, {
|
|
83
|
+
stripeAccountId: "acct_missing",
|
|
84
|
+
}),
|
|
85
|
+
).rejects.toThrow("retrieve unavailable");
|
|
86
|
+
expect(stripe.v2.core.accounts.close).not.toHaveBeenCalled();
|
|
87
|
+
expect(runMutation).toHaveBeenCalledTimes(1);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("does not complete local closure after provider refusal", async () => {
|
|
91
|
+
const stripe = makeStripe();
|
|
92
|
+
stripe.v2.core.accounts.close.mockRejectedValue(new Error("close boom"));
|
|
93
|
+
const { ctx, runMutation } = context(["merchant"]);
|
|
94
|
+
await expect(
|
|
95
|
+
closeAccount(asStripe(stripe), makeComponent(), ctx, {
|
|
96
|
+
stripeAccountId: "acct_err",
|
|
97
|
+
}),
|
|
98
|
+
).rejects.toThrow("close boom");
|
|
99
|
+
expect(runMutation).toHaveBeenCalledTimes(1);
|
|
100
|
+
expect(runMutation).toHaveBeenCalledWith(
|
|
101
|
+
refFor("accountClosure/mutations/prepare"),
|
|
102
|
+
{ stripeAccountId: "acct_err" },
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("returns an already closed account without another provider operation", async () => {
|
|
107
|
+
const stripe = makeStripe();
|
|
108
|
+
const { ctx } = context([], "closed");
|
|
109
|
+
expect(
|
|
110
|
+
await closeAccount(asStripe(stripe), makeComponent(), ctx, {
|
|
111
|
+
stripeAccountId: "acct_done",
|
|
112
|
+
}),
|
|
113
|
+
).toEqual({ closed: true });
|
|
114
|
+
expect(stripe.v2.core.accounts.close).not.toHaveBeenCalled();
|
|
115
|
+
expect(stripe.v2.core.accounts.retrieve).not.toHaveBeenCalled();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("restartAccountOnboarding retains the same closure provenance contract", async () => {
|
|
119
|
+
const stripe = makeStripe();
|
|
120
|
+
const { ctx, runMutation } = context([]);
|
|
121
|
+
expect(
|
|
122
|
+
await restartAccountOnboarding(asStripe(stripe), makeComponent(), ctx, {
|
|
123
|
+
stripeAccountId: "acct_restart",
|
|
124
|
+
}),
|
|
125
|
+
).toEqual({ closed: true });
|
|
126
|
+
expect(runMutation.mock.calls.map((call) => call[0])).toEqual([
|
|
127
|
+
refFor("accountClosure/mutations/prepare"),
|
|
128
|
+
refFor("accountClosure/mutations/complete"),
|
|
129
|
+
]);
|
|
130
|
+
});
|
|
131
|
+
});
|