@fantastic.dev/better-stripe 0.12.0 → 0.14.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 +24 -0
- package/README.md +93 -8
- package/dist/client/connect/disputes.d.ts +20 -0
- package/dist/client/connect/disputes.d.ts.map +1 -1
- package/dist/client/connect/disputes.js +55 -0
- package/dist/client/connect/disputes.js.map +1 -1
- package/dist/client/costRecovery-invoices.d.ts +44 -0
- package/dist/client/costRecovery-invoices.d.ts.map +1 -0
- package/dist/client/costRecovery-invoices.js +109 -0
- package/dist/client/costRecovery-invoices.js.map +1 -0
- package/dist/client/costRecovery.d.ts +59 -2
- package/dist/client/costRecovery.d.ts.map +1 -1
- package/dist/client/costRecovery.js +73 -2
- package/dist/client/costRecovery.js.map +1 -1
- package/dist/client/errors.d.ts +1 -1
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js.map +1 -1
- package/dist/client/index.d.ts +5 -14
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +4 -8
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +137 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/costRecovery/claims.d.ts +12 -0
- package/dist/component/costRecovery/claims.d.ts.map +1 -1
- package/dist/component/costRecovery/claims.js +15 -8
- package/dist/component/costRecovery/claims.js.map +1 -1
- package/dist/component/costRecovery/completion.d.ts +6 -0
- package/dist/component/costRecovery/completion.d.ts.map +1 -1
- package/dist/component/costRecovery/helpers.d.ts +6 -0
- package/dist/component/costRecovery/helpers.d.ts.map +1 -1
- package/dist/component/costRecovery/imports.d.ts +53 -0
- package/dist/component/costRecovery/imports.d.ts.map +1 -0
- package/dist/component/costRecovery/imports.js +67 -0
- package/dist/component/costRecovery/imports.js.map +1 -0
- package/dist/component/costRecovery/mutations.d.ts +119 -0
- package/dist/component/costRecovery/mutations.d.ts.map +1 -1
- package/dist/component/costRecovery/mutations.js +64 -1
- package/dist/component/costRecovery/mutations.js.map +1 -1
- package/dist/component/costRecovery/queries.d.ts +18 -0
- package/dist/component/costRecovery/queries.d.ts.map +1 -1
- package/dist/component/costRecovery/reservations.d.ts +12 -0
- package/dist/component/costRecovery/reservations.d.ts.map +1 -1
- package/dist/component/costRecovery/schema.d.ts +116 -4
- package/dist/component/costRecovery/schema.d.ts.map +1 -1
- package/dist/component/costRecovery/schema.js +19 -0
- package/dist/component/costRecovery/schema.js.map +1 -1
- package/dist/component/schema.d.ts +36 -2
- package/dist/react/workflows/Collections.d.ts.map +1 -1
- package/dist/react/workflows/Collections.js +2 -1
- package/dist/react/workflows/Collections.js.map +1 -1
- package/dist/react/workflows/EvidenceUpload.d.ts +18 -0
- package/dist/react/workflows/EvidenceUpload.d.ts.map +1 -0
- package/dist/react/workflows/EvidenceUpload.js +35 -0
- package/dist/react/workflows/EvidenceUpload.js.map +1 -0
- package/dist/react/workflows/Onboarding.d.ts +3 -3
- package/dist/react/workflows/Onboarding.d.ts.map +1 -1
- package/dist/react/workflows/Onboarding.js +8 -6
- package/dist/react/workflows/Onboarding.js.map +1 -1
- package/dist/react/workflows/Refunds.d.ts +14 -3
- package/dist/react/workflows/Refunds.d.ts.map +1 -1
- package/dist/react/workflows/Refunds.js +58 -16
- package/dist/react/workflows/Refunds.js.map +1 -1
- package/dist/react/workflows/index.d.ts +5 -1
- package/dist/react/workflows/index.d.ts.map +1 -1
- package/dist/react/workflows/index.js +3 -1
- package/dist/react/workflows/index.js.map +1 -1
- package/dist/react/workflows/refund-preview.d.ts +16 -0
- package/dist/react/workflows/refund-preview.d.ts.map +1 -0
- package/dist/react/workflows/refund-preview.js +38 -0
- package/dist/react/workflows/refund-preview.js.map +1 -0
- package/dist/react/workflows/useWorkflowAction.d.ts +1 -1
- package/dist/react/workflows/useWorkflowAction.d.ts.map +1 -1
- package/dist/react/workflows/useWorkflowAction.js +6 -2
- package/dist/react/workflows/useWorkflowAction.js.map +1 -1
- package/docs/react-workflows.md +121 -4
- package/package.json +1 -1
- package/src/client/connect/dispute-upload.test.ts +208 -0
- package/src/client/connect/disputes.ts +103 -0
- package/src/client/costRecovery-import.test.ts +174 -0
- package/src/client/costRecovery-invoices.test.ts +470 -0
- package/src/client/costRecovery-invoices.transport.test.ts +107 -0
- package/src/client/costRecovery-invoices.ts +176 -0
- package/src/client/costRecovery.ts +123 -2
- package/src/client/errors.ts +1 -0
- package/src/client/index.ts +15 -14
- package/src/component/_generated/api.ts +2 -0
- package/src/component/_generated/component.ts +164 -0
- package/src/component/costRecovery/claims.ts +18 -8
- package/src/component/costRecovery/imports.ts +74 -0
- package/src/component/costRecovery/mutations.ts +80 -0
- package/src/component/costRecovery/schema.ts +21 -0
- package/src/react/workflows/Collections.test.tsx +36 -0
- package/src/react/workflows/Collections.tsx +3 -1
- package/src/react/workflows/EvidenceUpload.test.tsx +56 -0
- package/src/react/workflows/EvidenceUpload.tsx +71 -0
- package/src/react/workflows/Onboarding.test.tsx +73 -0
- package/src/react/workflows/Onboarding.tsx +8 -5
- package/src/react/workflows/Refunds.currency.test.tsx +290 -0
- package/src/react/workflows/Refunds.tsx +115 -25
- package/src/react/workflows/index.ts +11 -1
- package/src/react/workflows/refund-preview.test.ts +65 -0
- package/src/react/workflows/refund-preview.ts +56 -0
- package/src/react/workflows/useWorkflowAction.ts +6 -1
|
@@ -21,6 +21,30 @@ export declare const observationFields: {
|
|
|
21
21
|
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
22
22
|
revision: import("convex/values").VFloat64<number, "required">;
|
|
23
23
|
};
|
|
24
|
+
export declare const openingCollection: import("convex/values").VObject<{
|
|
25
|
+
amountDue: number;
|
|
26
|
+
collectedAmount: number;
|
|
27
|
+
operationKey: string;
|
|
28
|
+
revision: number;
|
|
29
|
+
}, {
|
|
30
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
31
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
32
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
33
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
34
|
+
}, "required", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
|
|
35
|
+
export declare const importArgs: {
|
|
36
|
+
accountId: import("convex/values").VString<string, "required">;
|
|
37
|
+
scopeKey: import("convex/values").VString<string, "required">;
|
|
38
|
+
currency: import("convex/values").VString<string, "required">;
|
|
39
|
+
claimKey: import("convex/values").VString<string, "required">;
|
|
40
|
+
sourceChargeId: import("convex/values").VString<string, "required">;
|
|
41
|
+
sourceGross: import("convex/values").VFloat64<number, "required">;
|
|
42
|
+
sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
|
|
43
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
44
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
45
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
46
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
47
|
+
};
|
|
24
48
|
export declare const claimFields: {
|
|
25
49
|
accountId: import("convex/values").VString<string, "required">;
|
|
26
50
|
scopeKey: import("convex/values").VString<string, "required">;
|
|
@@ -35,6 +59,17 @@ export declare const claimFields: {
|
|
|
35
59
|
reservedAmount: import("convex/values").VFloat64<number, "required">;
|
|
36
60
|
outstanding: import("convex/values").VFloat64<number, "required">;
|
|
37
61
|
sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
|
|
62
|
+
openingCollection: import("convex/values").VObject<{
|
|
63
|
+
amountDue: number;
|
|
64
|
+
collectedAmount: number;
|
|
65
|
+
operationKey: string;
|
|
66
|
+
revision: number;
|
|
67
|
+
} | undefined, {
|
|
68
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
69
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
70
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
71
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
72
|
+
}, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
|
|
38
73
|
};
|
|
39
74
|
export declare const claimDoc: import("convex/values").VObject<{
|
|
40
75
|
_creationTime: number;
|
|
@@ -44,6 +79,12 @@ export declare const claimDoc: import("convex/values").VObject<{
|
|
|
44
79
|
claimKey: string;
|
|
45
80
|
collectedAmount: number;
|
|
46
81
|
currency: string;
|
|
82
|
+
openingCollection?: {
|
|
83
|
+
amountDue: number;
|
|
84
|
+
collectedAmount: number;
|
|
85
|
+
operationKey: string;
|
|
86
|
+
revision: number;
|
|
87
|
+
} | undefined;
|
|
47
88
|
outstanding: number;
|
|
48
89
|
reservedAmount: number;
|
|
49
90
|
revision: number;
|
|
@@ -66,9 +107,20 @@ export declare const claimDoc: import("convex/values").VObject<{
|
|
|
66
107
|
reservedAmount: import("convex/values").VFloat64<number, "required">;
|
|
67
108
|
outstanding: import("convex/values").VFloat64<number, "required">;
|
|
68
109
|
sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
|
|
110
|
+
openingCollection: import("convex/values").VObject<{
|
|
111
|
+
amountDue: number;
|
|
112
|
+
collectedAmount: number;
|
|
113
|
+
operationKey: string;
|
|
114
|
+
revision: number;
|
|
115
|
+
} | undefined, {
|
|
116
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
117
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
118
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
119
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
120
|
+
}, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
|
|
69
121
|
_id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
|
|
70
122
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
71
|
-
}, "required", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
123
|
+
}, "required", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
72
124
|
export declare const balanceFields: {
|
|
73
125
|
accountId: import("convex/values").VString<string, "required">;
|
|
74
126
|
scopeKey: import("convex/values").VString<string, "required">;
|
|
@@ -104,6 +156,16 @@ export declare const groupFields: {
|
|
|
104
156
|
maxCredit: import("convex/values").VFloat64<number, "required">;
|
|
105
157
|
amount: import("convex/values").VFloat64<number, "required">;
|
|
106
158
|
pendingOperations: import("convex/values").VFloat64<number, "required">;
|
|
159
|
+
invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
|
|
160
|
+
invoiceFunding: import("convex/values").VObject<{
|
|
161
|
+
sourceChargeId: string;
|
|
162
|
+
sourceGross: number;
|
|
163
|
+
sourceProcessingFee: number;
|
|
164
|
+
} | undefined, {
|
|
165
|
+
sourceChargeId: import("convex/values").VString<string, "required">;
|
|
166
|
+
sourceGross: import("convex/values").VFloat64<number, "required">;
|
|
167
|
+
sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
|
|
168
|
+
}, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
107
169
|
status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
|
|
108
170
|
};
|
|
109
171
|
export declare const groupDoc: import("convex/values").VObject<{
|
|
@@ -113,6 +175,12 @@ export declare const groupDoc: import("convex/values").VObject<{
|
|
|
113
175
|
amount: number;
|
|
114
176
|
currency: string;
|
|
115
177
|
groupKey: string;
|
|
178
|
+
invoiceFunding?: {
|
|
179
|
+
sourceChargeId: string;
|
|
180
|
+
sourceGross: number;
|
|
181
|
+
sourceProcessingFee: number;
|
|
182
|
+
} | undefined;
|
|
183
|
+
invoiceItemId?: string | undefined;
|
|
116
184
|
maxCredit: number;
|
|
117
185
|
maxDebit: number;
|
|
118
186
|
pendingOperations: number;
|
|
@@ -135,10 +203,20 @@ export declare const groupDoc: import("convex/values").VObject<{
|
|
|
135
203
|
maxCredit: import("convex/values").VFloat64<number, "required">;
|
|
136
204
|
amount: import("convex/values").VFloat64<number, "required">;
|
|
137
205
|
pendingOperations: import("convex/values").VFloat64<number, "required">;
|
|
206
|
+
invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
|
|
207
|
+
invoiceFunding: import("convex/values").VObject<{
|
|
208
|
+
sourceChargeId: string;
|
|
209
|
+
sourceGross: number;
|
|
210
|
+
sourceProcessingFee: number;
|
|
211
|
+
} | undefined, {
|
|
212
|
+
sourceChargeId: import("convex/values").VString<string, "required">;
|
|
213
|
+
sourceGross: import("convex/values").VFloat64<number, "required">;
|
|
214
|
+
sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
|
|
215
|
+
}, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
138
216
|
status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
|
|
139
217
|
_id: import("convex/values").VId<import("convex/values").GenericId<"recoveryGroups">, "required">;
|
|
140
218
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
141
|
-
}, "required", "_creationTime" | "_id" | "accountId" | "amount" | "currency" | "groupKey" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">;
|
|
219
|
+
}, "required", "_creationTime" | "_id" | "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">;
|
|
142
220
|
export declare const reservationFields: {
|
|
143
221
|
operationKey: import("convex/values").VString<string, "required">;
|
|
144
222
|
groupKey: import("convex/values").VString<string, "required">;
|
|
@@ -200,6 +278,12 @@ export declare const claimsTable: import("convex/server").TableDefinition<import
|
|
|
200
278
|
claimKey: string;
|
|
201
279
|
collectedAmount: number;
|
|
202
280
|
currency: string;
|
|
281
|
+
openingCollection?: {
|
|
282
|
+
amountDue: number;
|
|
283
|
+
collectedAmount: number;
|
|
284
|
+
operationKey: string;
|
|
285
|
+
revision: number;
|
|
286
|
+
} | undefined;
|
|
203
287
|
outstanding: number;
|
|
204
288
|
reservedAmount: number;
|
|
205
289
|
revision: number;
|
|
@@ -222,7 +306,19 @@ export declare const claimsTable: import("convex/server").TableDefinition<import
|
|
|
222
306
|
reservedAmount: import("convex/values").VFloat64<number, "required">;
|
|
223
307
|
outstanding: import("convex/values").VFloat64<number, "required">;
|
|
224
308
|
sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
|
|
225
|
-
|
|
309
|
+
openingCollection: import("convex/values").VObject<{
|
|
310
|
+
amountDue: number;
|
|
311
|
+
collectedAmount: number;
|
|
312
|
+
operationKey: string;
|
|
313
|
+
revision: number;
|
|
314
|
+
} | undefined, {
|
|
315
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
316
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
317
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
318
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
319
|
+
}, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
|
|
320
|
+
}, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
|
|
321
|
+
by_import: ["openingCollection.operationKey", "_creationTime"];
|
|
226
322
|
by_key: ["claimKey", "_creationTime"];
|
|
227
323
|
by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
|
|
228
324
|
by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
|
|
@@ -253,6 +349,12 @@ export declare const groupsTable: import("convex/server").TableDefinition<import
|
|
|
253
349
|
amount: number;
|
|
254
350
|
currency: string;
|
|
255
351
|
groupKey: string;
|
|
352
|
+
invoiceFunding?: {
|
|
353
|
+
sourceChargeId: string;
|
|
354
|
+
sourceGross: number;
|
|
355
|
+
sourceProcessingFee: number;
|
|
356
|
+
} | undefined;
|
|
357
|
+
invoiceItemId?: string | undefined;
|
|
256
358
|
maxCredit: number;
|
|
257
359
|
maxDebit: number;
|
|
258
360
|
pendingOperations: number;
|
|
@@ -275,8 +377,18 @@ export declare const groupsTable: import("convex/server").TableDefinition<import
|
|
|
275
377
|
maxCredit: import("convex/values").VFloat64<number, "required">;
|
|
276
378
|
amount: import("convex/values").VFloat64<number, "required">;
|
|
277
379
|
pendingOperations: import("convex/values").VFloat64<number, "required">;
|
|
380
|
+
invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
|
|
381
|
+
invoiceFunding: import("convex/values").VObject<{
|
|
382
|
+
sourceChargeId: string;
|
|
383
|
+
sourceGross: number;
|
|
384
|
+
sourceProcessingFee: number;
|
|
385
|
+
} | undefined, {
|
|
386
|
+
sourceChargeId: import("convex/values").VString<string, "required">;
|
|
387
|
+
sourceGross: import("convex/values").VFloat64<number, "required">;
|
|
388
|
+
sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
|
|
389
|
+
}, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
278
390
|
status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
|
|
279
|
-
}, "required", "accountId" | "amount" | "currency" | "groupKey" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
|
|
391
|
+
}, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
|
|
280
392
|
by_key: ["groupKey", "_creationTime"];
|
|
281
393
|
}, {}, {}>;
|
|
282
394
|
export declare const reservationsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/costRecovery/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;IACtB,SAAS;IACT,QAAQ;IACR,QAAQ;CACT,CAAC;AACF,eAAO,MAAM,YAAY;IAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAI0C,CAAC;AACnE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;UAIxB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAEtB,CAAC;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAEqB,CAAC;AAEpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAIvB,CAAC;AACF,eAAO,MAAM,UAAU;IACrB,QAAQ;IACR,OAAO;IACP,KAAK;CACN,CAAC;AACF,eAAO,MAAM,YAAY;IACvB,QAAQ;IACR,iBAAiB;IACjB,QAAQ;CACT,CAAC"}
|
|
@@ -21,12 +21,24 @@ export const observationFields = {
|
|
|
21
21
|
amountDue: v.number(),
|
|
22
22
|
revision: v.number(),
|
|
23
23
|
};
|
|
24
|
+
export const openingCollection = v.object({
|
|
25
|
+
operationKey: v.string(),
|
|
26
|
+
amountDue: v.number(),
|
|
27
|
+
revision: v.number(),
|
|
28
|
+
collectedAmount: v.number(),
|
|
29
|
+
});
|
|
30
|
+
export const importArgs = {
|
|
31
|
+
...observationFields,
|
|
32
|
+
operationKey: v.string(),
|
|
33
|
+
collectedAmount: v.number(),
|
|
34
|
+
};
|
|
24
35
|
export const claimFields = {
|
|
25
36
|
...observationFields,
|
|
26
37
|
collectedAmount: v.number(),
|
|
27
38
|
reservedAmount: v.number(),
|
|
28
39
|
outstanding: v.number(),
|
|
29
40
|
sign: signValidator,
|
|
41
|
+
openingCollection: v.optional(openingCollection),
|
|
30
42
|
};
|
|
31
43
|
export const claimDoc = v.object({
|
|
32
44
|
...claimFields,
|
|
@@ -52,6 +64,12 @@ export const groupFields = {
|
|
|
52
64
|
...groupInput,
|
|
53
65
|
amount: v.number(),
|
|
54
66
|
pendingOperations: v.number(),
|
|
67
|
+
invoiceItemId: v.optional(v.string()),
|
|
68
|
+
invoiceFunding: v.optional(v.object({
|
|
69
|
+
sourceChargeId: v.string(),
|
|
70
|
+
sourceGross: v.number(),
|
|
71
|
+
sourceProcessingFee: v.number(),
|
|
72
|
+
})),
|
|
55
73
|
status: v.union(v.literal("open"), v.literal("sealed"), v.literal("collecting"), v.literal("releasing"), v.literal("collected"), v.literal("released")),
|
|
56
74
|
};
|
|
57
75
|
export const groupDoc = v.object({
|
|
@@ -78,6 +96,7 @@ export const reservationDoc = v.object({
|
|
|
78
96
|
});
|
|
79
97
|
export const claimsTable = defineTable(claimFields)
|
|
80
98
|
.index("by_key", ["claimKey"])
|
|
99
|
+
.index("by_import", ["openingCollection.operationKey"])
|
|
81
100
|
.index("by_scope", ["accountId", "scopeKey", "currency"])
|
|
82
101
|
.index("by_sign", ["accountId", "scopeKey", "currency", "sign"]);
|
|
83
102
|
export const balancesTable = defineTable(balanceFields).index("by_scope", [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/costRecovery/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAClC,CAAC,CAAC,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AAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5D,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC"}
|
|
@@ -5,6 +5,12 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
5
5
|
claimKey: string;
|
|
6
6
|
collectedAmount: number;
|
|
7
7
|
currency: string;
|
|
8
|
+
openingCollection?: {
|
|
9
|
+
amountDue: number;
|
|
10
|
+
collectedAmount: number;
|
|
11
|
+
operationKey: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
} | undefined;
|
|
8
14
|
outstanding: number;
|
|
9
15
|
reservedAmount: number;
|
|
10
16
|
revision: number;
|
|
@@ -27,7 +33,19 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
27
33
|
reservedAmount: import("convex/values").VFloat64<number, "required">;
|
|
28
34
|
outstanding: import("convex/values").VFloat64<number, "required">;
|
|
29
35
|
sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
|
|
30
|
-
|
|
36
|
+
openingCollection: import("convex/values").VObject<{
|
|
37
|
+
amountDue: number;
|
|
38
|
+
collectedAmount: number;
|
|
39
|
+
operationKey: string;
|
|
40
|
+
revision: number;
|
|
41
|
+
} | undefined, {
|
|
42
|
+
operationKey: import("convex/values").VString<string, "required">;
|
|
43
|
+
amountDue: import("convex/values").VFloat64<number, "required">;
|
|
44
|
+
revision: import("convex/values").VFloat64<number, "required">;
|
|
45
|
+
collectedAmount: import("convex/values").VFloat64<number, "required">;
|
|
46
|
+
}, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
|
|
47
|
+
}, "required", "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">, {
|
|
48
|
+
by_import: ["openingCollection.operationKey", "_creationTime"];
|
|
31
49
|
by_key: ["claimKey", "_creationTime"];
|
|
32
50
|
by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
|
|
33
51
|
by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
|
|
@@ -58,6 +76,12 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
58
76
|
amount: number;
|
|
59
77
|
currency: string;
|
|
60
78
|
groupKey: string;
|
|
79
|
+
invoiceFunding?: {
|
|
80
|
+
sourceChargeId: string;
|
|
81
|
+
sourceGross: number;
|
|
82
|
+
sourceProcessingFee: number;
|
|
83
|
+
} | undefined;
|
|
84
|
+
invoiceItemId?: string | undefined;
|
|
61
85
|
maxCredit: number;
|
|
62
86
|
maxDebit: number;
|
|
63
87
|
pendingOperations: number;
|
|
@@ -80,8 +104,18 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
80
104
|
maxCredit: import("convex/values").VFloat64<number, "required">;
|
|
81
105
|
amount: import("convex/values").VFloat64<number, "required">;
|
|
82
106
|
pendingOperations: import("convex/values").VFloat64<number, "required">;
|
|
107
|
+
invoiceItemId: import("convex/values").VString<string | undefined, "optional">;
|
|
108
|
+
invoiceFunding: import("convex/values").VObject<{
|
|
109
|
+
sourceChargeId: string;
|
|
110
|
+
sourceGross: number;
|
|
111
|
+
sourceProcessingFee: number;
|
|
112
|
+
} | undefined, {
|
|
113
|
+
sourceChargeId: import("convex/values").VString<string, "required">;
|
|
114
|
+
sourceGross: import("convex/values").VFloat64<number, "required">;
|
|
115
|
+
sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
|
|
116
|
+
}, "optional", "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
|
|
83
117
|
status: import("convex/values").VUnion<"collected" | "collecting" | "open" | "released" | "releasing" | "sealed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"sealed", "required">, import("convex/values").VLiteral<"collecting", "required">, import("convex/values").VLiteral<"releasing", "required">, import("convex/values").VLiteral<"collected", "required">, import("convex/values").VLiteral<"released", "required">], "required", never>;
|
|
84
|
-
}, "required", "accountId" | "amount" | "currency" | "groupKey" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
|
|
118
|
+
}, "required", "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status">, {
|
|
85
119
|
by_key: ["groupKey", "_creationTime"];
|
|
86
120
|
}, {}, {}>;
|
|
87
121
|
recoveryReservations: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIvE,MAAM,MAAM,uBAAuB,CAAC,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,aAAa,CAAC,KAAK,EAAE,uBAAuB,CAAC,SAAS,CAAC,+BAiCtE;AACD,MAAM,MAAM,eAAe,GAAG;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,wBAAgB,aAAa,CAAC,KAAK,EAAE,uBAAuB,CAAC,eAAe,CAAC,+BA2B5E;AACD,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,wBAAgB,aAAa,CAAC,GAAG,SAAS,eAAe,EACvD,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC,+BA6BpC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Collection } from "./Collection.js";
|
|
4
4
|
import { formatPrice } from "../lib/price-helpers.js";
|
|
5
|
+
import { formatRefundAmount } from "./refund-preview.js";
|
|
5
6
|
export function Sales(props) {
|
|
6
7
|
const columns = [
|
|
7
8
|
{ id: "planId", label: "Plan", cell: (row) => row.planId },
|
|
@@ -48,7 +49,7 @@ export function RefundHistory(props) {
|
|
|
48
49
|
id: "amount",
|
|
49
50
|
label: "Amount",
|
|
50
51
|
align: "end",
|
|
51
|
-
cell: (row) =>
|
|
52
|
+
cell: (row) => formatRefundAmount(row.amount, row.currency) ?? "Amount unavailable",
|
|
52
53
|
},
|
|
53
54
|
{ id: "status", label: "Status", cell: (row) => row.status },
|
|
54
55
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["../../../src/react/workflows/Collections.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAmBzD,MAAM,UAAU,KAAK,CAAC,KAAuC;IAC3D,MAAM,OAAO,GAA8B;QACzC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC1D,GACE;YACE,CAAC,OAAO,EAAE,MAAM,CAAC;YACjB,CAAC,eAAe,EAAE,mBAAmB,CAAC;YACtC,CAAC,aAAa,EAAE,UAAU,CAAC;YAC3B,CAAC,cAAc,EAAE,WAAW,CAAC;YAC7B,CAAC,oBAAoB,EAAE,eAAe,CAAC;YACvC,CAAC,WAAW,EAAE,eAAe,CAAC;SAEjC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACzB,EAAE,EAAE,KAAK;YACT,KAAK;YACL,KAAK,EAAE,KAAc;YACrB,IAAI,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC;SACnE,CAAC,CAAC;QACH,EAAE,EAAE,EAAE,QAAQ,EAAE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,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE;QAC5D,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,EAAE;QACjE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,MAAM,EAAE;QACvE;YACE,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CACZ,GAAG,CAAC,WAAW,KAAK,SAAS;gBAC3B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,cAAc,EAAE;SACjD;QACD;YACE,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;SAChD;KACF,CAAC;IACF,OAAO,CACL,KAAC,UAAU,IACT,UAAU,EAAC,wBAAwB,KAC/B,KAAK,EACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,EAClC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO,GACjC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type EvidenceUploadProps = {
|
|
3
|
+
/** Include the authenticated scope and selected dispute. */
|
|
4
|
+
scopeKey: string;
|
|
5
|
+
/** Host authorizes the dispute and uploads bytes through BetterStripe server-side. */
|
|
6
|
+
onUpload: (file: File) => Promise<unknown>;
|
|
7
|
+
children?: (state: {
|
|
8
|
+
file: File | undefined;
|
|
9
|
+
setFile: (file: File | undefined) => void;
|
|
10
|
+
upload: () => Promise<unknown>;
|
|
11
|
+
isPending: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
isAttached: boolean;
|
|
14
|
+
}) => ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/** Uploading only attaches to the draft. EvidenceForm owns explicit submission. */
|
|
17
|
+
export declare function EvidenceUpload(props: EvidenceUploadProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=EvidenceUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvidenceUpload.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/EvidenceUpload.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,MAAM,MAAM,mBAAmB,GAAG;IAChC,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QACjB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;QACvB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;QAC1C,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAC/B,SAAS,EAAE,OAAO,CAAC;QACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;KACrB,KAAK,SAAS,CAAC;CACjB,CAAC;AAEF,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BAExD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { useWorkflowAction } from "./useWorkflowAction.js";
|
|
5
|
+
/** Uploading only attaches to the draft. EvidenceForm owns explicit submission. */
|
|
6
|
+
export function EvidenceUpload(props) {
|
|
7
|
+
return _jsx(EvidenceUploadBody, { ...props }, props.scopeKey);
|
|
8
|
+
}
|
|
9
|
+
function EvidenceUploadBody(props) {
|
|
10
|
+
const id = useId();
|
|
11
|
+
const [file, setFile] = useState();
|
|
12
|
+
const action = useWorkflowAction(async () => {
|
|
13
|
+
if (!file)
|
|
14
|
+
throw new Error("Choose an evidence file first.");
|
|
15
|
+
await props.onUpload(file);
|
|
16
|
+
return true;
|
|
17
|
+
}, props.scopeKey);
|
|
18
|
+
const state = {
|
|
19
|
+
file,
|
|
20
|
+
setFile: (file) => {
|
|
21
|
+
setFile(file);
|
|
22
|
+
action.reset();
|
|
23
|
+
},
|
|
24
|
+
upload: action.run,
|
|
25
|
+
isPending: action.isPending,
|
|
26
|
+
error: action.error,
|
|
27
|
+
isAttached: action.result === true,
|
|
28
|
+
};
|
|
29
|
+
if (props.children)
|
|
30
|
+
return _jsx(_Fragment, { children: props.children(state) });
|
|
31
|
+
return (_jsxs("section", { "data-better-stripe": "evidence-upload", "aria-busy": state.isPending, children: [_jsx("label", { htmlFor: id, children: "Evidence file" }), _jsx("input", { id: id, type: "file", accept: "application/pdf,image/jpeg,image/png", disabled: state.isPending, onChange: (event) => state.setFile(event.target.files?.[0]) }), _jsx("button", { type: "button", disabled: !file || state.isPending, onClick: () => {
|
|
32
|
+
void state.upload();
|
|
33
|
+
}, children: state.isPending ? "Uploading…" : "Attach to draft" }), state.error && _jsx("p", { role: "alert", children: state.error }), state.isAttached && (_jsx("p", { role: "status", children: "File attached to draft. Submit evidence separately when ready." }))] }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=EvidenceUpload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvidenceUpload.js","sourceRoot":"","sources":["../../../src/react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EAAE,8BAAuB,EACzC,gBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,sCAAsC,EAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAC3D,EACF,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,EAClC,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;gBACtB,CAAC,YAEA,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,GAC5C,EACR,KAAK,CAAC,KAAK,IAAI,YAAG,IAAI,EAAC,OAAO,YAAE,KAAK,CAAC,KAAK,GAAK,EAChD,KAAK,CAAC,UAAU,IAAI,CACnB,YAAG,IAAI,EAAC,QAAQ,+EAEZ,CACL,IACO,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -27,9 +27,9 @@ export declare function useOnboarding(props: OnboardingActions): {
|
|
|
27
27
|
createError: string | null;
|
|
28
28
|
linkError: string | null;
|
|
29
29
|
restartError: string | null;
|
|
30
|
-
create: () => Promise<
|
|
31
|
-
continue: () => Promise<
|
|
32
|
-
close: () => Promise<
|
|
30
|
+
create: () => Promise<true | undefined>;
|
|
31
|
+
continue: () => Promise<true | undefined>;
|
|
32
|
+
close: () => Promise<true | undefined>;
|
|
33
33
|
};
|
|
34
34
|
export type OnboardingAccount = {
|
|
35
35
|
stripeAccountId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Onboarding.d.ts","sourceRoot":"","sources":["../../../src/react/workflows/Onboarding.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAA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AAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AACF,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB;IAwClD,eAAe;IACf,kBAAkB,YAAY,MAAM;IAEpC,SAAS;IACT,UAAU;IACV,SAAS;IACT,YAAY;IACZ,KAAK;IACL,WAAW;IACX,SAAS;IACT,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,KAAK;EAER;AACD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG;IACrE,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/C,CAAC;AACF,MAAM,MAAM,eAAe,GACvB,CAAC,iBAAiB,GAAG;IACnB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,SAAS,CAAC;CACxD,CAAC,GACF,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG;IAAE,YAAY,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AACrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAMhD"}
|
|
@@ -40,9 +40,11 @@ export function useOnboarding(props) {
|
|
|
40
40
|
: undefined;
|
|
41
41
|
if (!url)
|
|
42
42
|
throw new Error("Stripe did not return an onboarding URL.");
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return url;
|
|
44
|
+
}, props.scopeKey, (url) => {
|
|
45
|
+
if (typeof url === "string")
|
|
46
|
+
(props.onNavigate ?? ((url) => window.location.assign(url)))(url);
|
|
47
|
+
});
|
|
46
48
|
const run = action.run;
|
|
47
49
|
return {
|
|
48
50
|
selectedCountry: fields.country,
|
|
@@ -55,9 +57,9 @@ export function useOnboarding(props) {
|
|
|
55
57
|
createError: operation === "create" ? action.error : null,
|
|
56
58
|
linkError: operation === "link" ? action.error : null,
|
|
57
59
|
restartError: operation === "close" ? action.error : null,
|
|
58
|
-
create: () => run("create"),
|
|
59
|
-
continue: () => run("link"),
|
|
60
|
-
close: () => run("close"),
|
|
60
|
+
create: async () => ((await run("create")) ? true : undefined),
|
|
61
|
+
continue: async () => ((await run("link")) ? true : undefined),
|
|
62
|
+
close: async () => ((await run("close")) ? true : undefined),
|
|
61
63
|
};
|
|
62
64
|
}
|
|
63
65
|
export function Onboarding(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Onboarding.js","sourceRoot":"","sources":["../../../src/react/workflows/Onboarding.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE;IACrC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACtC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE;IACjC,EAAE,IAAI,EAAE,IAAI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AAC,YAAY,IAAI,CACrB,8BACE,8CAAgC,EAChC,oEAAgD,EAChD,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,OAAO,EAAE,GAAG,EAAE;oCACZ,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;gCACrB,CAAC,YAEA,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,GAC3C,IACD,CACX,IACA,CACJ,IACO,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -2,12 +2,13 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type ConnectProps } from "./Connect.js";
|
|
3
3
|
export type RefundRequest = {
|
|
4
4
|
stripePaymentIntentId: string;
|
|
5
|
+
/** Original payment currency's provider units. Legacy name, not universal cents. */
|
|
5
6
|
amountCents?: number;
|
|
6
7
|
reason: "requested_by_customer";
|
|
7
8
|
};
|
|
8
9
|
export type ReversalRequest = {
|
|
9
10
|
sourceChargeId: string;
|
|
10
|
-
amountCents?: number;
|
|
11
|
+
/** Original charge provider units. */ amountCents?: number;
|
|
11
12
|
};
|
|
12
13
|
export type RefundResult = {
|
|
13
14
|
stripeRefundId: string;
|
|
@@ -26,17 +27,27 @@ export type RefundActionsProps = {
|
|
|
26
27
|
scopeKey: string;
|
|
27
28
|
paymentIntentId?: string;
|
|
28
29
|
sourceChargeId?: string;
|
|
30
|
+
/** Verified currency for paymentIntentId. Omitted = legacy USD; null = unknown. */
|
|
31
|
+
paymentCurrency?: string | null;
|
|
32
|
+
/** Verified currency for sourceChargeId, independently of the refund payment. */
|
|
33
|
+
sourceChargeCurrency?: string | null;
|
|
29
34
|
issueRefund: (args: RefundRequest) => Promise<RefundResult>;
|
|
30
35
|
reverseTransfers?: (args: ReversalRequest) => Promise<ReversalResult>;
|
|
31
36
|
};
|
|
32
|
-
/**
|
|
37
|
+
/** Exact positive refund amount in the original charge currency's provider units. */
|
|
38
|
+
export declare function parseRefundAmount(value: string, currency: string): number | null;
|
|
39
|
+
/** Legacy USD-only parser. Use parseRefundAmount for original-currency inputs. */
|
|
33
40
|
export declare function parseAmountCents(value: string): number | null;
|
|
34
41
|
export declare function useRefunds(props: RefundActionsProps): {
|
|
35
|
-
scope: string;
|
|
36
42
|
paymentIntentId: string;
|
|
37
43
|
sourceChargeId: string;
|
|
38
44
|
refundAmount: string;
|
|
39
45
|
reversalAmount: string;
|
|
46
|
+
scope: string;
|
|
47
|
+
paymentCurrency: string | null;
|
|
48
|
+
sourceChargeCurrency: string | null;
|
|
49
|
+
refundInputDecimalPlaces: 0 | 2 | null;
|
|
50
|
+
reversalInputDecimalPlaces: 0 | 2 | null;
|
|
40
51
|
setPaymentIntentId: (value: string) => void;
|
|
41
52
|
setSourceChargeId: (value: string) => void;
|
|
42
53
|
setRefundAmount: (value: string) => void;
|