Skip to content

WIP: mock Checkout, the Integration Layer and the resources the Terraform provider tests - #451

Draft
pimvernooij wants to merge 3 commits into
mainfrom
feat/terraform-provider-resources
Draft

pimvernooij wants to merge 3 commits into
mainfrom
feat/terraform-provider-resources

Conversation

@pimvernooij

Copy link
Copy Markdown
Member

Work in progress, opened to share where this stands. Part of a proof of concept for running Evolve on the commercetools Commerce Integration Layer (CIL). With it, the terraform-provider-commercetools acceptance tests for these resources run against the mock instead of against fakes in the provider.

What changes

  • Checkout API: applications and payment integrations under /{projectKey}/applications and /{projectKey}/payment-integrations, with every update action in the spec.

    • The types come from @commercetools/checkout-sdk (dev dependency and optional peer dependency).
    • Its Application.description is typed string, as in the spec, but the API uses a LocalizedString; src/checkout-types.ts corrects that one field.
  • Commerce Integration Layer management API under /{projectKey}/main:

    • session defaults and checkout rules;
    • hidden fields: the fields that can be hidden are listed from the Project's Types and Product Types;
    • IdP login, extension config and allowlist.

    commercetools publishes no spec for this API yet, so it follows the one the Go SDK's integrationlayer package is generated from. Every Project is taken as enrolled, and the state is held in memory whatever the storage.

  • MSW:

    • new checkoutHost and integrationLayerHost options (https://checkout.*.commercetools.com, https://extensions.integration-layer.*.commercetools.com);
    • PUT and PATCH are now forwarded too.
  • Platform:

    • MCP Servers;
    • the discountGroup of a Cart Discount, and the Discount Group's setIsActive;
    • the setDiscountsConfiguration, setReservationExpirationInMinutes and setReleaseExpiredReservations Project update actions.

Three changesets, all minor.

Checks

pnpm tsc clean, pnpm test 968 passing, pnpm biome check with the one warning main already has.

Next

The provider's CI runs labdigital/commercetools-mock-server:3.0.0-beta.3. Its acceptance tests for these resources need an image from this branch, so a release of this comes before the provider's.

🤖 Generated with Claude Code

… provider tests

Mock the commercetools Checkout API's applications and payment
integrations, typed with @commercetools/checkout-sdk, and the Commerce
Integration Layer's management API under /{projectKey}/main. With MSW
they are served on the new checkoutHost and integrationLayerHost options,
and MSW now forwards PUT and PATCH as well.

Add MCP Servers, the discount group of a Cart Discount, the Discount
Group's setIsActive, and the discounts and inventory Project update
actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4e961a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@labdigital/commercetools-mock Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

pimvernooij and others added 2 commits October 17, 2026 22:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Inactive

Checkout always answers a payment integration with an automated reversal
configuration, Inactive when the draft gives none. The mock now does too,
so a client that relies on it sees the same answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant