3.8 KiB
3.8 KiB
Tasks: add-payment-provider-adyen
1. Scaffold the package
- 1.1 Create
packages/universal/payment-provider-adyen/withpackage.json(name@suaveplan/payment-provider-adyen, version0.1.0,sideEffects: false, runtime deps on@suaveplan/payment,@suaveplan/payment-providers,tslib). - 1.2 Add
vite.config.ts(lib build, preserveModules, externals). - 1.3 Add
vitest.config.ts(forks pool, istanbul 100/100/100/100). - 1.4 Add
tsconfig.json+tsconfig.lib.json. - 1.5 Add
tests/setup/polyfills.tsandtests/dep-graph.test.ts.
2. Implement AdyenConfig
- 2.1 Create
src/types/adyen.tsexportingAdyenConfigas a sibling-local re-export / extension ofMerchantKeyConfig. - 2.2 Create
src/types/adyen.md. - 2.3 Create
src/types/index.ts(named re-export, rule 6a).
3. Implement AdyenProvider
- 3.1 Create
src/adyen/adyen.tsexportingclass AdyenProvider implements PaymentProviderwithname = "adyen". - 3.2 Constructor accepts
AdyenConfig; injectablerandomIdis used to generate the defaultreferencewhenidempotencyKeyis omitted. - 3.3 Six methods (
createIntent,confirmIntent,captureIntent,cancelIntent,refund,getIntent) all dispatch via the slim core'shttpRequest, withX-API-Keyheader andmerchantAccountin the body where Adyen requires it. - 3.4 Status / refund / payment-method mapping ported verbatim from upstream.
- 3.5 Every failure path surfaces a
PaymentProviderError(via the slim core'shttpRequest). - 3.6 Create
src/adyen/adyen.md(Purpose ≥2 sentences, Features, Basic + Advanced usage, API Reference, Implementation Notes — ≥200 words excluding code). - 3.7 Create
src/adyen/index.ts(named re-export). - 3.8 Create
src/adyen/adyen.test.tscovering all 24 verified-by test names verbatim, using a real recordingFetchLikeclosure (no mocks).
4. Wire barrels + subpath exports
- 4.1 Create
src/index.tsre-exportingAdyenProviderandAdyenConfigvia explicit named exports (rule 6a). - 4.2 Add subpath exports for
.,./adyen/adyen,./types/adyen.
5. README + root-doc refresh (§13b)
- 5.1 Author
README.md(description, install, quick start, Modules list). - 5.2 Run
bun scripts/folder-reorg/generate-manifest.tsto refreshMANIFEST.md. - 5.3 Run
bun scripts/generate-missing.tsto refreshMISSING.yml. - 5.4 Hand-edit
STATUS.mdto add the new package row. - 5.5 Hand-edit
SUMMARY.mdto add the new package paragraph. - 5.6
bunx markdownlint-cli2 --fixacross touched docs.
6. Verification gates (§13)
- 6.1 Step 0 — spec reconciliation walk.
- 6.2 Step 1 —
bunx turbo lint typecheck test --filter=@suaveplan/payment-provider-adyen. - 6.3 Step 2 —
bunx turbo test:coverage --filter=@suaveplan/payment-provider-adyenreports 100/100/100/100. - 6.4 Step 3 —
bunx turbo build --filter=@suaveplan/payment-provider-adyen. - 6.5 Step 4 — banned-pattern scan zero.
- 6.6 Step 4a — barrel-shape scan zero.
- 6.7 Step 4b — runner-import scan zero.
- 6.8 Step 5 — every
.tshas a sibling.md. - 6.9 Step 6 — README present.
- 6.10 Step 7 — no bare versions.
- 6.11 Step 8 — subpath-export count matches feature-module count (2 features + root = 3 entries).
- 6.12 Step 9 — security scan zero.
- 6.13 Step 10 — dependent sweep
(
bunx turbo test --filter=...@suaveplan/payment-provider-adyen) green.
7. Fold + archive (§14)
- 7.1 Fold
specs/payment-provider-adyen/spec.mdintoopenspec/specs/payment-provider-adyen/spec.md. - 7.2 Move
openspec/changes/add-payment-provider-adyen/→openspec/archive/2026-05-17-add-payment-provider-adyen/.