Skip to content

Stripe action - #50

Merged
nicosammito merged 14 commits into
mainfrom
claude/stripe-action-tn8aul
Jul 31, 2026
Merged

Stripe action#50
nicosammito merged 14 commits into
mainfrom
claude/stripe-action-tn8aul

Conversation

@nicosammito

Copy link
Copy Markdown
Member

Close #35

claude and others added 12 commits July 23, 2026 12:53
Introduce a new stripe-action to the monorepo following the existing
Hercules action conventions (see gls-action, shopify-action).

v1 scope (payments core):
- Functions: createCustomer, createPaymentIntent, retrievePaymentIntent,
  createRefund
- Events: payment_intent.succeeded, charge.refunded (generic Rest webhook
  receiver, same pattern as shopify/woocommerce)
- Data types: STRIPE_CUSTOMER, STRIPE_PAYMENT_INTENT, STRIPE_REFUND plus the
  two webhook payload types
- Config: secret_key, api_version (optional), webhook_secret (optional)

All Stripe API calls go through the official `stripe` Node.js SDK via a
cached client in helpers.ts. Registers the action in .gitlab-ci.yml's
.node-actions matrix and adds it to the README actions table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QuCVuBVi48HKcY6E8okUD9
`typescript` is not a field on Stripe.StripeConfig; drop it from the
client options in helpers.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QuCVuBVi48HKcY6E8okUD9
The webhook payload files declared both an `export type` and an
`export class` with the same name (StripePaymentIntentSucceededWebhookPayload
and StripeChargeRefundedWebhookPayload), which triggers TS2300
"Duplicate identifier". A class already introduces a type, so the alias
collides. The alias was unused (events reference the name via the
@Signature string and index.ts imports the class), so remove it, matching
the woocommerce/shopify webhook payload convention.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QuCVuBVi48HKcY6E8okUD9
Set up the openapi-zod-client pipeline used by woocommerce-action and
shopware-action so the Stripe data type schemas can be generated from
Stripe's official OpenAPI spec instead of maintained by hand:

- generate:stripe-schemas npm script (download spec3.sdk.json -> filter ->
  openapi-zod-client -> patch)
- scripts/filterStripeSpec.mjs reduces the ~6MB spec to the resources the
  action exposes (customer, payment_intent, refund, charge), stubbing
  foreign $refs to keep the generator tractable
- scripts/patchGeneratedSchemas.mjs applies the zod v4 record + z.lazy
  fix-ups
- openapi-zod-client devDependency
- README documents how to run generation and switch data types over

The hand-written schemas remain the active source until the generator is
run in an environment with network access to registry.npmjs.org and the
spec host, so the build stays green in the meantime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QuCVuBVi48HKcY6E8okUD9
Wire the @Schema data types to the zod schemas generated from Stripe's
official OpenAPI spec (src/generated/stripe-schemas.ts) instead of the
hand-written ones, matching the twilio-action pattern:

- STRIPE_CUSTOMER      -> schemas.customer
- STRIPE_PAYMENT_INTENT-> schemas.payment_intent
- STRIPE_REFUND        -> schemas.refund
- charge.refunded webhook data.object -> schemas.charge

The payment_intent.succeeded webhook wraps StripePaymentIntentSchema, which
now resolves to schemas.payment_intent, so it uses the generated type too.
README updated to describe the schemas as generated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QuCVuBVi48HKcY6E8okUD9
… package-lock.json with new peer dependencies
@nicosammito nicosammito self-assigned this Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/2722761599

Status: Passed
Duration: 6 minutes

Job summaries

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/15652955089/artifacts/out/index.html

@nicosammito
nicosammito merged commit 3fb1480 into main Jul 31, 2026
1 check passed
@nicosammito
nicosammito deleted the claude/stripe-action-tn8aul branch July 31, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stripe action

2 participants