@contractspec/example.integration-stripe 3.7.6 → 3.7.7
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/.turbo/turbo-build.log +3 -3
- package/AGENTS.md +44 -21
- package/README.md +63 -19
- package/dist/browser/index.js +68 -68
- package/dist/index.d.ts +3 -3
- package/dist/index.js +68 -68
- package/dist/node/index.js +68 -68
- package/package.json +5 -5
- package/src/blueprint.ts +56 -56
- package/src/connection.sample.ts +17 -17
- package/src/docs/integration-stripe.docblock.ts +21 -21
- package/src/example.ts +26 -26
- package/src/index.ts +3 -3
- package/src/integration-stripe.feature.ts +20 -20
- package/src/tenant.ts +49 -49
- package/src/workflow.ts +48 -48
- package/translation.catalog.json +18 -19
- package/tsconfig.json +7 -9
- package/tsdown.config.js +1 -1
package/src/workflow.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
OwnersEnum,
|
|
3
|
+
StabilityEnum,
|
|
4
|
+
TagsEnum,
|
|
6
5
|
} from '@contractspec/lib.contracts-spec/ownership';
|
|
6
|
+
import type { WorkflowSpec } from '@contractspec/lib.contracts-spec/workflow/spec';
|
|
7
7
|
|
|
8
8
|
export const collectPaymentWorkflow: WorkflowSpec = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
9
|
+
meta: {
|
|
10
|
+
key: 'artisan.payments.collectPayment',
|
|
11
|
+
version: '1.0.0',
|
|
12
|
+
title: 'Collect Card Payment',
|
|
13
|
+
description:
|
|
14
|
+
'Charge a customer using the tenant Stripe connection and record settlement details.',
|
|
15
|
+
domain: 'payments',
|
|
16
|
+
owners: [OwnersEnum.PlatformCore],
|
|
17
|
+
tags: [TagsEnum.Marketplace, 'stripe'],
|
|
18
|
+
stability: StabilityEnum.Experimental,
|
|
19
|
+
},
|
|
20
|
+
definition: {
|
|
21
|
+
entryStepId: 'prepare',
|
|
22
|
+
steps: [
|
|
23
|
+
{
|
|
24
|
+
id: 'prepare',
|
|
25
|
+
type: 'automation',
|
|
26
|
+
label: 'Prepare charge parameters',
|
|
27
|
+
action: {
|
|
28
|
+
operation: { key: 'payments.prepareCharge', version: '1.0.0' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'charge',
|
|
33
|
+
type: 'automation',
|
|
34
|
+
label: 'Charge card via Stripe',
|
|
35
|
+
action: {
|
|
36
|
+
operation: { key: 'payments.stripe.chargeCard', version: '1.0.0' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'confirm',
|
|
41
|
+
type: 'automation',
|
|
42
|
+
label: 'Confirm settlement',
|
|
43
|
+
action: {
|
|
44
|
+
operation: { key: 'payments.recordSettlement', version: '1.0.0' },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
transitions: [
|
|
49
|
+
{ from: 'prepare', to: 'charge' },
|
|
50
|
+
{ from: 'charge', to: 'confirm', condition: 'output.success === true' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
53
|
};
|
package/translation.catalog.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"meta": {
|
|
3
|
+
"name": "artisan.payments.catalog",
|
|
4
|
+
"version": 1
|
|
5
|
+
},
|
|
6
|
+
"defaultLocale": "en",
|
|
7
|
+
"supportedLocales": ["en", "fr"],
|
|
8
|
+
"entries": [
|
|
9
|
+
{
|
|
10
|
+
"key": "artisan.payments.appName",
|
|
11
|
+
"locale": "en",
|
|
12
|
+
"value": "Artisan Payments Portal"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "artisan.payments.appName",
|
|
16
|
+
"locale": "fr",
|
|
17
|
+
"value": "Portail de paiement Artisan"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
20
|
}
|
|
21
|
-
|
package/tsconfig.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"extends": "@contractspec/tool.typescript/react-library.json",
|
|
3
|
+
"include": ["src"],
|
|
4
|
+
"exclude": ["node_modules", "dist"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "dist"
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
package/tsdown.config.js
CHANGED