Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 6, 2025

  • Add version field to the Checkout interface in both core and payment-integration-api packages
  • Add version field to the Cart interface in both core and payment-integration-api packages
  • Update all corresponding mock data to include version: 2 matching the API response format
  • Fix build errors in payment-integrations-test-utils mock data

Changes Made

  • Added version: number field to the Checkout interface in both core and payment-integration-api packages
  • Added version: number field to the Cart interface in both core and payment-integration-api packages
  • Updated all corresponding mock data to include version: 2 matching the API response format
  • Fixed missing version field in payment-integrations-test-utils cart and checkout mock data

API Response Structure

The Checkout API response includes a version field at both the checkout and cart levels:

{
  "id": "640ac03c-e3d1-453c-8884-abad6503d6a3",
  "cart": {
    "id": "640ac03c-e3d1-453c-8884-abad6503d6a3",
    "version": 2
  },
  "version": 2
}

These interface changes ensure the TypeScript definitions accurately reflect the actual API response structure, enabling proper type safety when working with checkout and cart objects that include version information.

Files Modified

  • packages/core/src/checkout/checkout.ts
  • packages/payment-integration-api/src/checkout/checkout.ts
  • packages/core/src/cart/cart.ts
  • packages/payment-integration-api/src/cart/cart.ts
  • packages/core/src/checkout/checkouts.mock.ts
  • packages/core/src/cart/carts.mock.ts
  • packages/payment-integration-api/src/mocks/carts.mock.ts
  • packages/payment-integrations-test-utils/src/test-utils/carts.mock.ts
  • packages/payment-integrations-test-utils/src/test-utils/checkouts.mock.ts

The changes are minimal and maintain backward compatibility while providing complete type coverage for the API response. All tests pass and the build completes successfully.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Extend the Checkout interface to include the version. Here's a complete Checkout API response to ground on: {"id":"640ac03c-e3d1-453c-8884-abad6503d6a3","cart":{"id":"640ac03c-e3d1-453c-8884-abad6503d6a3","customerId":0,"email":"","currency":{"name"... Add version field to Checkout and Cart interfaces Sep 6, 2025
@Copilot Copilot AI requested a review from bookernath September 6, 2025 02:49
Copilot finished work on behalf of bookernath September 6, 2025 02:49
Copy link
Author

Copilot AI commented Sep 6, 2025

@copilot fix this: > @***********/[email protected] build

npm run bundle && npm run bundle-dts

...

Fixed the build errors. The issue was that the version field added to Cart and Checkout interfaces was missing from the mock data in payment-integrations-test-utils. I've updated both mock files to include version: 2. Build now completes successfully with commit abe1cee.

Copilot finished work on behalf of bookernath September 6, 2025 03:21
@bookernath bookernath force-pushed the copilot/fix-47511e18-2aff-4c28-a984-d8ed30a8a7b1 branch from abe1cee to eb5d7db Compare September 6, 2025 03:42
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.

2 participants