Stripe action - #50
Merged
Merged
Conversation
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
…rences and improve type safety
…d naming consistency
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/2722761599 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/15652955089/artifacts/out/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #35