Skip to content

feat: add tests for Apple Pay Certificate API#19

Merged
jimmyn merged 2 commits intomasterfrom
feat/apple-pay-certificate-tests
Dec 2, 2025
Merged

feat: add tests for Apple Pay Certificate API#19
jimmyn merged 2 commits intomasterfrom
feat/apple-pay-certificate-tests

Conversation

@jimmyn
Copy link
Copy Markdown
Collaborator

@jimmyn jimmyn commented Dec 1, 2025

Summary

Add missing test coverage for the new Apple Pay Certificate API endpoints.

Implementation

  • Test create endpoint (CSR generation)
  • Test get endpoint (fetch certificate by id)
  • Test list endpoint (fetch all certificates)
  • Test activate endpoint (upload signed cert from Apple)
  • Test update endpoint (toggle active status)
  • Test _delete endpoint (remove certificate)

Test plan

  • All 6 new tests pass
  • Full test suite passes (53 tests)
  • Pre-commit hooks pass (prettier, eslint)

Summary by CodeRabbit

  • New Features

    • Apple Pay Certificate management: create, retrieve, list, activate, update and delete certificates via the public API surface; SDK now exposes an applePayCertificate entry on the main client.
  • Tests

    • Added test coverage for Apple Pay Certificate flows (create/get/list/activate/update/delete).
  • Chores

    • Bumped OpenAPI spec to 1.8.1 and updated development tooling/dev-dependencies; updated project build config.

✏️ Tip: You can customize this high-level summary in your review settings.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@jimmyn jimmyn force-pushed the feat/apple-pay-certificate-tests branch from 4998463 to 93b4c94 Compare December 1, 2025 20:28
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 1, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.71% 96 / 112
🔵 Statements 85.21% 98 / 115
🔵 Functions 84.61% 22 / 26
🔵 Branches 62.92% 56 / 89
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
index.ts 94% 87.5% 100% 93.87% 125, 154, 203
src/api.ts 100% 100% 100% 100%
src/base.ts 72.72% 83.33% 50% 72.72% 75-76
src/common.ts 75% 49.09% 76.92% 76.19% 37-40, 67-68, 77-82, 96-101, 110, 125
src/configuration.ts 100% 75% 100% 100%
src/index.ts 100% 100% 100% 100%
src/model/index.ts 100% 100% 100% 100%
Unchanged Files
src/axios.ts 100% 100% 100% 100%
Generated in workflow #81 for commit f05495e by the Vitest Coverage Report Action

@socket-security
Copy link
Copy Markdown

socket-security bot commented Dec 1, 2025

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 1, 2025

Walkthrough

Adds a generated Apple Pay Certificate API and related models, integrates it as applePayCertificate on the Monei client, adds tests for the new endpoints, updates OpenAPI-generated headers to 1.8.1 across many files, and bumps several devDependencies and build types.

Changes

Cohort / File(s) Change Summary
Apple Pay Certificate API
src/api/apple-pay-certificate-api.ts
New generated API client implementing create, get, getAll, activate, update, and remove endpoints (Axios param creator, FP interface, factory, and class).
SDK integration
index.ts
Added public applePayCertificate: ApplePayCertificateApi property on Monei and initialized it in the constructor using shared config, BASE_PATH, and HTTP client.
Models: Apple Pay Certificate
src/model/activate-apple-pay-certificate-request.ts, src/model/apple-pay-certificate.ts, src/model/apple-pay-certificate-delete200-response.ts, src/model/apple-pay-certificates-remove200-response.ts, src/model/update-apple-pay-certificate-request.ts
New model interfaces for certificate payloads, certificate representation, delete response, and update request.
Model index updates
src/model/index.ts
Added exports for new Apple Pay certificate models and removed the apple-pay-domain-register200-response export.
Apple Pay domain API adjustment
src/api/apple-pay-domain-api.ts
Adjusted return types to reference the new certificate-delete response type where applicable.
Tests
tests/apple-pay-certificate-api.test.ts
New Vitest suite covering create, get, getAll, activate, update, and delete with mocked Axios responses.
Public API exports
src/api.ts
Exported ./api/apple-pay-certificate-api (and added/updated other api exports).
Generated files manifest
src/.openapi-generator/FILES
Manifest updated to include new API and model files for Apple Pay certificate surface; removed domain-register model file.
OpenAPI header bumps (many generated files)
src/*.ts, src/api/*.ts, src/model/*.ts (many files)
Updated OpenAPI document/version header comments to 1.8.1 in numerous generated files; no functional changes.
Dev tooling & build
package.json, tsconfig.build.json
Bumped several devDependencies (openapi-generator-cli, vitest, prettier, eslint/types, etc.), updated packageManager yarn version, and added "types":["node"] to tsconfig.build.json.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Dev as Developer
participant SDK as Monei SDK (Monei)
participant API as ApplePayCertificateApi
participant Server as Monei Backend

Dev->>SDK: monei.applePayCertificate.create(csr)
SDK->>API: create(csr)
API->>Server: POST /apple-pay/certificates (CSR)
Server-->>API: 201 ApplePayCertificate
API-->>SDK: AxiosResponse(ApplePayCertificate)
SDK-->>Dev: resolved promise

Dev->>SDK: monei.applePayCertificate.activate(id, cert)
SDK->>API: activate(id, { cert })
API->>Server: POST /apple-pay/certificates/{id}/activate
Server-->>API: 200 ApplePayCertificate (activated)
API-->>SDK: AxiosResponse(ApplePayCertificate)
SDK-->>Dev: resolved promise

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus review on:
    • src/api/apple-pay-certificate-api.ts — verify endpoint paths, parameter validation, auth header usage, and request/response typings.
    • index.ts — ensure applePayCertificate is initialized correctly with the shared client/config and does not alter init order.
    • src/api/apple-pay-domain-api.ts — confirm type changes (delete response) do not break callers.
    • tests/apple-pay-certificate-api.test.ts — validate mocks and coverage of edge/error cases.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the primary change: adding tests for the Apple Pay Certificate API. However, the changeset is substantially broader, including API implementation updates, model additions, dependency updates, and configuration changes beyond just tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/apple-pay-certificate-tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/model/subscription-retry-schedule.ts (1)

16-17: Consider updating OpenAPI Generator templates to use @ts-expect-error.

Per coding guidelines, @ts-expect-error should be preferred over @ts-ignore. Since this is an auto-generated file, the fix should be applied to the OpenAPI Generator templates/configuration rather than editing this file directly.

tests/apple-pay-certificate-api.test.ts (1)

1-13: Align Vitest usage with project testing guidelines

The tests currently import describe/it from Vitest and use it instead of test, while globals are configured and guidelines call for describe + test with globals.

To align with the documented conventions:

  • Rely on global describe/test instead of importing them.
  • Prefer test over it in this suite.
  • (Optional but consistent) Name the root describe after the file ('apple-pay-certificate-api').

Example patch:

-import {afterEach, describe, expect, it} from 'vitest';
+import {afterEach, expect} from 'vitest';
@@
-afterEach(() => {
-  resetTestEnv();
-});
-
-describe('Apple Pay Certificate API', () => {
+afterEach(() => {
+  resetTestEnv();
+});
+
+describe('apple-pay-certificate-api', () => {
@@
-  describe('create', () => {
-    it('should create a new certificate with CSR', async () => {
+  describe('create', () => {
+    test('should create a new certificate with CSR', async () => {
@@
-  describe('get', () => {
-    it('should get a certificate by id', async () => {
+  describe('get', () => {
+    test('should get a certificate by id', async () => {
@@
-  describe('list', () => {
-    it('should list all certificates', async () => {
+  describe('list', () => {
+    test('should list all certificates', async () => {
@@
-  describe('activate', () => {
-    it('should activate a certificate with signed cert', async () => {
+  describe('activate', () => {
+    test('should activate a certificate with signed cert', async () => {
@@
-  describe('update', () => {
-    it('should update certificate active status', async () => {
+  describe('update', () => {
+    test('should update certificate active status', async () => {
@@
-  describe('_delete', () => {
-    it('should delete a certificate', async () => {
+  describe('_delete', () => {
+    test('should delete a certificate', async () => {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 241598e and 93b4c94.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (109)
  • index.ts (3 hunks)
  • package.json (1 hunks)
  • src/.openapi-generator/FILES (3 hunks)
  • src/api.ts (1 hunks)
  • src/api/apple-pay-certificate-api.ts (1 hunks)
  • src/api/apple-pay-domain-api.ts (4 hunks)
  • src/api/bizum-api.ts (1 hunks)
  • src/api/payment-methods-api.ts (1 hunks)
  • src/api/payments-api.ts (1 hunks)
  • src/api/subscriptions-api.ts (1 hunks)
  • src/base.ts (1 hunks)
  • src/common.ts (1 hunks)
  • src/configuration.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/model/activate-apple-pay-certificate-request.ts (1 hunks)
  • src/model/activate-subscription-request.ts (1 hunks)
  • src/model/address.ts (1 hunks)
  • src/model/api-exception.ts (1 hunks)
  • src/model/apple-pay-certificate-delete200-response.ts (1 hunks)
  • src/model/apple-pay-certificate.ts (1 hunks)
  • src/model/bad-request-error.ts (1 hunks)
  • src/model/bizum-validate-phone200-response.ts (1 hunks)
  • src/model/cancel-payment-request.ts (1 hunks)
  • src/model/cancel-subscription-request.ts (1 hunks)
  • src/model/capture-payment-request.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method-card.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method.ts (1 hunks)
  • src/model/confirm-payment-request.ts (1 hunks)
  • src/model/create-payment-request.ts (1 hunks)
  • src/model/create-subscription-request.ts (1 hunks)
  • src/model/index.ts (2 hunks)
  • src/model/internal-server-error.ts (1 hunks)
  • src/model/not-found-error.ts (1 hunks)
  • src/model/pause-subscription-request.ts (1 hunks)
  • src/model/payment-billing-details.ts (1 hunks)
  • src/model/payment-cancellation-reason.ts (1 hunks)
  • src/model/payment-customer.ts (1 hunks)
  • src/model/payment-last-refund-reason.ts (1 hunks)
  • src/model/payment-message-channel.ts (1 hunks)
  • src/model/payment-message-language.ts (1 hunks)
  • src/model/payment-methods-metadata-alipay.ts (1 hunks)
  • src/model/payment-methods-metadata-apple-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-bancontact.ts (1 hunks)
  • src/model/payment-methods-metadata-bizum.ts (1 hunks)
  • src/model/payment-methods-metadata-blik.ts (1 hunks)
  • src/model/payment-methods-metadata-card.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-discover.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-visa.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-eps.ts (1 hunks)
  • src/model/payment-methods-metadata-giropay.ts (1 hunks)
  • src/model/payment-methods-metadata-google-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-ideal.ts (1 hunks)
  • src/model/payment-methods-metadata-klarna.ts (1 hunks)
  • src/model/payment-methods-metadata-mbway.ts (1 hunks)
  • src/model/payment-methods-metadata-sepa.ts (1 hunks)
  • src/model/payment-methods-metadata-sofort.ts (1 hunks)
  • src/model/payment-methods-metadata-trustly.ts (1 hunks)
  • src/model/payment-methods-metadata.ts (1 hunks)
  • src/model/payment-methods-methods.ts (1 hunks)
  • src/model/payment-methods.ts (1 hunks)
  • src/model/payment-next-action.ts (1 hunks)
  • src/model/payment-payment-method-bizum-input.ts (1 hunks)
  • src/model/payment-payment-method-bizum.ts (1 hunks)
  • src/model/payment-payment-method-card-input.ts (1 hunks)
  • src/model/payment-payment-method-card.ts (1 hunks)
  • src/model/payment-payment-method-input.ts (1 hunks)
  • src/model/payment-payment-method-klarna.ts (1 hunks)
  • src/model/payment-payment-method-mbway.ts (1 hunks)
  • src/model/payment-payment-method-paypal.ts (1 hunks)
  • src/model/payment-payment-method-sepa.ts (1 hunks)
  • src/model/payment-payment-method-trustly.ts (1 hunks)
  • src/model/payment-payment-method.ts (1 hunks)
  • src/model/payment-payment-methods.ts (1 hunks)
  • src/model/payment-refund-reason.ts (1 hunks)
  • src/model/payment-sequence-recurring.ts (1 hunks)
  • src/model/payment-sequence.ts (1 hunks)
  • src/model/payment-session-details.ts (1 hunks)
  • src/model/payment-shipping-details.ts (1 hunks)
  • src/model/payment-shop.ts (1 hunks)
  • src/model/payment-status.ts (1 hunks)
  • src/model/payment-trace-details.ts (1 hunks)
  • src/model/payment-transaction-type.ts (1 hunks)
  • src/model/payment.ts (1 hunks)
  • src/model/recurring-payment-request.ts (1 hunks)
  • src/model/refund-payment-request.ts (1 hunks)
  • src/model/register-apple-pay-domain-request.ts (1 hunks)
  • src/model/send-payment-link-request.ts (1 hunks)
  • src/model/send-payment-receipt-request.ts (1 hunks)
  • src/model/send-payment-request-request.ts (1 hunks)
  • src/model/send-subscription-link-request.ts (1 hunks)
  • src/model/send-subscription-status-request.ts (1 hunks)
  • src/model/service-unavailable-error.ts (1 hunks)
  • src/model/subscription-interval.ts (1 hunks)
  • src/model/subscription-last-payment.ts (1 hunks)
  • src/model/subscription-payment-method-card.ts (1 hunks)
  • src/model/subscription-payment-method.ts (1 hunks)
  • src/model/subscription-payment-methods.ts (1 hunks)
  • src/model/subscription-retry-schedule-inner.ts (1 hunks)
  • src/model/subscription-retry-schedule.ts (1 hunks)
  • src/model/subscription-status.ts (1 hunks)
  • src/model/subscription.ts (1 hunks)
  • src/model/unauthorized-error.ts (1 hunks)
  • src/model/unprocessable-entity-error.ts (1 hunks)
  • src/model/update-apple-pay-certificate-request.ts (1 hunks)
  • src/model/update-subscription-request.ts (1 hunks)
  • src/model/validate-bizum-phone-request.ts (1 hunks)
  • tests/apple-pay-certificate-api.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

⚙️ CodeRabbit configuration file

**/*.ts: - Ensure code is clean, readable, and maintainable.

  • Adhere to proper naming conventions and consistent formatting.
  • Split functionality into smaller, reusable modules.
  • Keep files small by extracting related functionalities into separate modules.
  • Use imports to connect modules effectively.
  • Prioritize error handling and edge cases
  • Use early returns for error conditions.
  • Implement guard clauses for preconditions and invalid states.
  • Use custom error types for consistent error handling.
  • Write concise, technical, and type-safe TypeScript code.
  • Import types with import type to avoid importing implementations.
  • Use @ts-expect-error instead of @ts-ignore and add a comment explaining why the error is expected.
  • Use early return patterns to avoid deep nesting.
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  • Use AWS SDK V3 instead of V2.
  • Use Zod for data validation.
  • Use the full import path for packages when possible to enable tree shaking and reduce bundle size.

Files:

  • src/model/refund-payment-request.ts
  • src/model/payment-payment-method-trustly.ts
  • src/model/update-subscription-request.ts
  • src/api/payments-api.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/payment-methods-metadata-trustly.ts
  • src/model/send-payment-receipt-request.ts
  • src/common.ts
  • src/model/payment-transaction-type.ts
  • src/model/payment-methods-metadata-click-to-pay.ts
  • src/api/bizum-api.ts
  • src/model/payment-methods-metadata-eps.ts
  • src/model/payment-shop.ts
  • src/model/service-unavailable-error.ts
  • src/model/payment-methods-metadata-alipay.ts
  • src/model/activate-subscription-request.ts
  • src/model/payment-methods-metadata-sepa.ts
  • src/model/payment-last-refund-reason.ts
  • src/model/pause-subscription-request.ts
  • src/model/payment-methods-metadata-giropay.ts
  • src/model/payment-payment-method-sepa.ts
  • src/model/subscription-retry-schedule-inner.ts
  • src/model/payment-trace-details.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/model/send-payment-link-request.ts
  • src/model/payment-session-details.ts
  • src/model/payment-payment-method-card.ts
  • src/model/send-subscription-status-request.ts
  • src/model/payment-methods-metadata-bancontact.ts
  • src/model/payment-next-action.ts
  • src/model/payment-message-language.ts
  • index.ts
  • src/api/payment-methods-api.ts
  • src/model/recurring-payment-request.ts
  • src/configuration.ts
  • src/model/payment-methods-metadata-click-to-pay-discover.ts
  • src/model/payment-message-channel.ts
  • src/model/payment-methods.ts
  • src/model/payment-methods-metadata-card.ts
  • src/model/confirm-payment-request-payment-method.ts
  • src/model/payment-methods-metadata-click-to-pay-visa.ts
  • src/model/subscription-retry-schedule.ts
  • src/model/payment-payment-method-mbway.ts
  • src/api/subscriptions-api.ts
  • src/model/cancel-subscription-request.ts
  • src/model/payment-methods-metadata-ideal.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/apple-pay-certificate-delete200-response.ts
  • src/model/subscription-status.ts
  • tests/apple-pay-certificate-api.test.ts
  • src/model/payment-payment-method-bizum-input.ts
  • src/model/payment-payment-method-card-input.ts
  • src/model/api-exception.ts
  • src/model/apple-pay-certificate.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/bad-request-error.ts
  • src/model/subscription-last-payment.ts
  • src/model/payment-methods-methods.ts
  • src/model/payment-methods-metadata-klarna.ts
  • src/model/payment-customer.ts
  • src/model/send-payment-request-request.ts
  • src/model/index.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/payment-refund-reason.ts
  • src/model/payment-payment-method-paypal.ts
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts
  • src/model/validate-bizum-phone-request.ts
  • src/model/internal-server-error.ts
  • src/model/subscription-interval.ts
  • src/model/payment-billing-details.ts
  • src/model/unauthorized-error.ts
  • src/model/cancel-payment-request.ts
  • src/model/payment-payment-method.ts
  • src/model/send-subscription-link-request.ts
  • src/model/subscription-payment-methods.ts
  • src/model/payment-sequence.ts
  • src/model/payment-cancellation-reason.ts
  • src/base.ts
  • src/model/payment-methods-metadata.ts
  • src/model/payment-payment-method-input.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/create-payment-request.ts
  • src/model/subscription-payment-method.ts
  • src/model/payment-sequence-recurring.ts
  • src/model/subscription-payment-method-card.ts
  • src/model/payment-status.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/api/apple-pay-certificate-api.ts
  • src/model/subscription.ts
  • src/model/not-found-error.ts
  • src/model/address.ts
  • src/model/payment-methods-metadata-blik.ts
  • src/model/register-apple-pay-domain-request.ts
  • src/model/capture-payment-request.ts
  • src/api/apple-pay-domain-api.ts
  • src/model/payment.ts
  • src/model/payment-shipping-details.ts
  • src/model/payment-payment-method-klarna.ts
  • src/model/payment-methods-metadata-apple-pay.ts
  • src/api.ts
  • src/model/create-subscription-request.ts
  • src/model/confirm-payment-request.ts
  • src/model/payment-payment-method-bizum.ts
  • src/index.ts
  • src/model/payment-methods-metadata-google-pay.ts
  • src/model/payment-payment-methods.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:

  1. Visual verification that the UI renders correctly
  2. Functional testing of user interactions
  3. Edge cases and error states
  4. Cross-browser/device testing if applicable
  5. Integration with related features

Files:

  • src/model/refund-payment-request.ts
  • src/model/payment-payment-method-trustly.ts
  • src/model/update-subscription-request.ts
  • src/api/payments-api.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/payment-methods-metadata-trustly.ts
  • src/model/send-payment-receipt-request.ts
  • src/common.ts
  • src/model/payment-transaction-type.ts
  • src/model/payment-methods-metadata-click-to-pay.ts
  • src/api/bizum-api.ts
  • src/model/payment-methods-metadata-eps.ts
  • src/model/payment-shop.ts
  • src/model/service-unavailable-error.ts
  • src/model/payment-methods-metadata-alipay.ts
  • src/model/activate-subscription-request.ts
  • src/model/payment-methods-metadata-sepa.ts
  • src/model/payment-last-refund-reason.ts
  • src/model/pause-subscription-request.ts
  • src/model/payment-methods-metadata-giropay.ts
  • src/model/payment-payment-method-sepa.ts
  • src/model/subscription-retry-schedule-inner.ts
  • src/model/payment-trace-details.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/model/send-payment-link-request.ts
  • src/model/payment-session-details.ts
  • src/model/payment-payment-method-card.ts
  • src/model/send-subscription-status-request.ts
  • src/model/payment-methods-metadata-bancontact.ts
  • src/model/payment-next-action.ts
  • src/model/payment-message-language.ts
  • index.ts
  • src/api/payment-methods-api.ts
  • src/model/recurring-payment-request.ts
  • src/configuration.ts
  • src/model/payment-methods-metadata-click-to-pay-discover.ts
  • src/model/payment-message-channel.ts
  • src/model/payment-methods.ts
  • src/model/payment-methods-metadata-card.ts
  • src/model/confirm-payment-request-payment-method.ts
  • src/model/payment-methods-metadata-click-to-pay-visa.ts
  • src/model/subscription-retry-schedule.ts
  • src/model/payment-payment-method-mbway.ts
  • src/api/subscriptions-api.ts
  • src/model/cancel-subscription-request.ts
  • src/model/payment-methods-metadata-ideal.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/apple-pay-certificate-delete200-response.ts
  • src/model/subscription-status.ts
  • tests/apple-pay-certificate-api.test.ts
  • src/model/payment-payment-method-bizum-input.ts
  • src/model/payment-payment-method-card-input.ts
  • src/model/api-exception.ts
  • src/model/apple-pay-certificate.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/bad-request-error.ts
  • src/model/subscription-last-payment.ts
  • src/model/payment-methods-methods.ts
  • src/model/payment-methods-metadata-klarna.ts
  • src/model/payment-customer.ts
  • src/model/send-payment-request-request.ts
  • src/model/index.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/payment-refund-reason.ts
  • src/model/payment-payment-method-paypal.ts
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts
  • src/model/validate-bizum-phone-request.ts
  • src/model/internal-server-error.ts
  • src/model/subscription-interval.ts
  • src/model/payment-billing-details.ts
  • src/model/unauthorized-error.ts
  • package.json
  • src/model/cancel-payment-request.ts
  • src/model/payment-payment-method.ts
  • src/model/send-subscription-link-request.ts
  • src/model/subscription-payment-methods.ts
  • src/model/payment-sequence.ts
  • src/model/payment-cancellation-reason.ts
  • src/base.ts
  • src/model/payment-methods-metadata.ts
  • src/model/payment-payment-method-input.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/create-payment-request.ts
  • src/model/subscription-payment-method.ts
  • src/model/payment-sequence-recurring.ts
  • src/model/subscription-payment-method-card.ts
  • src/model/payment-status.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/api/apple-pay-certificate-api.ts
  • src/model/subscription.ts
  • src/model/not-found-error.ts
  • src/model/address.ts
  • src/model/payment-methods-metadata-blik.ts
  • src/model/register-apple-pay-domain-request.ts
  • src/model/capture-payment-request.ts
  • src/api/apple-pay-domain-api.ts
  • src/model/payment.ts
  • src/model/payment-shipping-details.ts
  • src/model/payment-payment-method-klarna.ts
  • src/model/payment-methods-metadata-apple-pay.ts
  • src/api.ts
  • src/model/create-subscription-request.ts
  • src/model/confirm-payment-request.ts
  • src/model/payment-payment-method-bizum.ts
  • src/index.ts
  • src/model/payment-methods-metadata-google-pay.ts
  • src/model/payment-payment-methods.ts
**/*.test.ts

⚙️ CodeRabbit configuration file

**/*.test.ts: - Always write unit tests using Vitest.

  • Always use Wallaby MCP to check tests results and get additional information when debugging tests.
  • Always use file path relatieve to the project root when calling Wallaby MCP tools, do not include project folder in the path
  • Place all unit test files in the same folder as the tested file, with the same name and a .test.ts extension.
  • Vitest is configured with globals; do not import describe and test from vitest.
  • Use describe and test blocks to organize test cases.
  • Name root-level describe blocks after the file name, without the extension.
  • Prefer toMatchInlineSnapshot over toMatchSnapshot for snapshot testing.
  • Use test.each to test multiple cases with the same test.
  • To mock AWS SDK V3, use aws-sdk-client-mock.
  • To mock Axios, use axios-mock-adapter.
  • To mock imports, use vi.mocked.
  • Never mock the getEnv function; instead, define all environment variables in vitest.config.ts.
  • Never mock withError function; its a pure function and should not be mocked. Mock the function inside the withError function.
  • Prefer using vi.spyOn over vi.mock to mock modules.
  • When mocking a named export, first import the module with import * as module from 'module'; and then use vi.spyOn(module, 'method').mockImplementation(() => { ... });.
  • Use structuredClone to clone mock data.
  • Do not mock getEnv function, instead define all environment variables in vitest.config.ts or use vi.stubEnv to stub environment variables.
  • Do not mock dayjs function, instead use vi.useFakeTimers() to mock the current time.
  • Always clear all mocks in afterEach hook, not in beforeEach.
  • Never mock entire Dynamoose model classes. Instead, use vi.spyOn to mock specific methods. If a class is mocked, the instance will be shared between tests.
  • When mocking Dynamoose models, all methods expect ones that return QueryResponse should return model instances. For example `vi.sp...

Files:

  • tests/apple-pay-certificate-api.test.ts
🧬 Code graph analysis (4)
index.ts (2)
src/api/apple-pay-certificate-api.ts (1)
  • ApplePayCertificateApi (598-690)
src/base.ts (1)
  • BASE_PATH (21-21)
tests/apple-pay-certificate-api.test.ts (1)
tests/test-utils.ts (3)
  • resetTestEnv (36-38)
  • createTestClient (15-21)
  • mockAxios (12-12)
src/api/apple-pay-certificate-api.ts (8)
src/configuration.ts (1)
  • Configuration (34-135)
src/base.ts (3)
  • RequestArgs (39-42)
  • operationServerMap (91-91)
  • BaseAPI (49-62)
src/common.ts (7)
  • assertParamExists (31-42)
  • DUMMY_BASE_URL (24-24)
  • setApiKeyToObject (48-60)
  • setSearchParams (136-140)
  • toPathString (163-165)
  • serializeDataIfNeeded (146-157)
  • createRequestFunction (171-187)
src/model/activate-apple-pay-certificate-request.ts (1)
  • ActivateApplePayCertificateRequest (20-27)
src/model/update-apple-pay-certificate-request.ts (1)
  • UpdateApplePayCertificateRequest (20-27)
src/axios.ts (1)
  • AxiosPromise (18-18)
src/model/apple-pay-certificate-delete200-response.ts (1)
  • ApplePayCertificateDelete200Response (20-27)
src/model/apple-pay-certificate.ts (1)
  • ApplePayCertificate (20-63)
src/api/apple-pay-domain-api.ts (2)
src/axios.ts (1)
  • AxiosPromise (18-18)
src/model/apple-pay-certificate-delete200-response.ts (1)
  • ApplePayCertificateDelete200Response (20-27)
🔇 Additional comments (96)
src/model/payment-session-details.ts (1)

7-7: OpenAPI header version bump looks correct

Header version updated to 1.8.0 with no structural/type changes; consistent with the broader spec bump in this PR.

src/model/subscription-payment-method-card.ts (1)

7-7: Header version metadata updated only

OpenAPI document version set to 1.8.0; the SubscriptionPaymentMethodCard interface and enums remain unchanged and type-safe.

src/model/subscription-last-payment.ts (1)

7-7: Version header aligned with 1.8.0 spec

Only the OpenAPI document version in the header changed to 1.8.0; SubscriptionLastPayment and its imports are untouched.

src/model/payment-methods-metadata-google-pay.ts (1)

7-7: Google Pay metadata model: metadata-only update

The header now references OpenAPI 1.8.0; no changes to PaymentMethodsMetadataGooglePay itself.

src/model/bad-request-error.ts (1)

7-7: BadRequestError model header updated only

OpenAPI document version updated to 1.8.0; the BadRequestError alias remains the same.

src/model/subscription-payment-method.ts (1)

7-7: Subscription payment method model: header version bump

Only the OpenAPI document version comment moved to 1.8.0; interface and enums are intact.

src/model/payment-methods-metadata-klarna.ts (1)

7-7: Klarna metadata model: version metadata only

Header now targets OpenAPI 1.8.0; the Klarna metadata interface is unchanged.

src/model/payment-methods-metadata-apple-pay.ts (1)

7-7: Apple Pay metadata model header synced to 1.8.0

The only change is the OpenAPI document version in the header; PaymentMethodsMetadataApplePay remains the same.

src/model/payment-payment-method-card.ts (1)

7-7: LGTM!

The OpenAPI version bump to 1.8.0 is consistent with the broader API update in this PR. No functional changes to the interface or enums.

src/model/payment-payment-method-trustly.ts (1)

7-7: LGTM!

Version metadata update only. The PaymentPaymentMethodTrustly interface remains unchanged.

src/model/payment-payment-method-card-input.ts (1)

7-7: LGTM!

Version metadata update only. The PaymentPaymentMethodCardInput interface remains unchanged.

src/model/payment-methods-metadata-bizum.ts (1)

7-7: LGTM!

Version metadata update only. The PaymentMethodsMetadataBizum interface remains unchanged.

src/model/subscription-retry-schedule.ts (1)

7-7: LGTM!

Version metadata update is consistent with the OpenAPI 1.8.0 bump across the codebase.

src/model/create-subscription-request.ts (1)

7-7: Header version bump looks good

OpenAPI doc version updated to 1.8.0 with no changes to CreateSubscriptionRequest; safe, consistent with the rest of the PR.

src/model/payment-billing-details.ts (1)

7-7: Non-functional header update only

OpenAPI version header moved to 1.8.0; PaymentBillingDetails interface is unchanged. No action needed.

src/model/register-apple-pay-domain-request.ts (1)

7-7: RegisterApplePayDomainRequest remains stable

Just the generated header version updated to 1.8.0; the RegisterApplePayDomainRequest contract stays the same.

src/model/payment-methods-metadata-ideal.ts (1)

7-7: Consistent spec version bump for iDEAL metadata

Header now references OpenAPI 1.8.0; PaymentMethodsMetadataIDeal interface is untouched. All good.

src/common.ts (1)

7-7: Common utilities unaffected by version header change

Only the generated OpenAPI version comment is updated to 1.8.0; shared helper implementations remain identical.

src/model/payment-payment-method-bizum.ts (1)

7-7: Bizum payment method model unchanged

OpenAPI header moved to 1.8.0; PaymentPaymentMethodBizum interface is preserved as-is.

src/api/subscriptions-api.ts (1)

7-7: Subscriptions API remains functionally identical

This file just updates the generated OpenAPI version header to 1.8.0; all subscription endpoints and typings stay the same.

src/model/payment-trace-details.ts (1)

7-7: Trace details type unaffected by spec bump

The OpenAPI header now references 1.8.0; PaymentTraceDetails fields are unchanged.

src/model/payment-refund-reason.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/payment-sequence.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/payment-status.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/validate-bizum-phone-request.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/confirm-payment-request-payment-method-card.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/activate-subscription-request.ts (1)

7-7: LGTM!

Auto-generated version bump to OpenAPI 1.8.0 — no functional changes.

src/model/create-payment-request.ts (1)

7-7: LGTM: OpenAPI version bump.

The version update from 1.7.3 to 1.8.0 aligns with the Apple Pay Certificate API additions in this PR. No functional changes in this auto-generated file.

src/model/payment-payment-method-bizum-input.ts (1)

7-7: LGTM - Auto-generated version bump.

The OpenAPI document version update to 1.8.0 is consistent with the new Apple Pay Certificate API additions in this PR.

src/model/payment-methods-metadata-blik.ts (1)

7-7: LGTM - Auto-generated version bump.

Expected update from regenerating the SDK with the updated OpenAPI 1.8.0 specification.

src/model/address.ts (1)

7-7: LGTM - Auto-generated version bump.

No functional changes to the Address interface. Version metadata update is consistent with the OpenAPI 1.8.0 specification.

src/model/payment-next-action.ts (1)

7-7: LGTM - Auto-generated version bump.

The PaymentNextAction interface and enum remain unchanged. Version metadata is consistent with the OpenAPI 1.8.0 specification update.

src/model/payment-payment-method-paypal.ts (1)

7-7: LGTM - Auto-generated version bump.

No functional changes to the PaymentPaymentMethodPaypal interface. Version metadata update aligns with the OpenAPI 1.8.0 specification.

src/model/payment-methods-metadata-click-to-pay-mastercard.ts (1)

7-7: Auto-generated version bump looks correct.

The OpenAPI document version header update to 1.8.0 is consistent with the PR's API specification upgrade. No functional changes to the interface.

src/model/cancel-payment-request.ts (1)

7-7: Auto-generated version bump looks correct.

The OpenAPI document version header update to 1.8.0 is consistent with the PR's API specification upgrade. No functional changes to the interface.

src/model/subscription-payment-methods.ts (1)

7-7: Auto-generated version bump looks correct.

The OpenAPI document version header update to 1.8.0 is consistent with the PR's API specification upgrade. No functional changes to the interface.

src/model/payment-methods-metadata-trustly.ts (1)

7-7: Auto-generated version bump looks correct.

The OpenAPI document version header update to 1.8.0 is consistent with the PR's API specification upgrade. No functional changes to the interface.

src/model/payment-shop.ts (1)

7-7: Auto-generated version bump looks correct.

The OpenAPI document version header update to 1.8.0 is consistent with the PR's API specification upgrade. No functional changes to the interface.

src/model/payment-methods-metadata-bancontact.ts (1)

7-7: LGTM!

Auto-generated version bump from OpenAPI spec 1.7.3 to 1.8.0. No functional changes to the interface.

src/model/subscription-status.ts (1)

7-7: LGTM!

Auto-generated version bump. The SubscriptionStatus enum remains unchanged.

src/model/payment-methods-metadata-click-to-pay-discover.ts (1)

7-7: LGTM!

Auto-generated version bump. No functional changes to the interface.

src/model/refund-payment-request.ts (1)

7-7: LGTM!

Auto-generated version bump. The RefundPaymentRequest interface remains unchanged.

src/configuration.ts (1)

7-7: LGTM!

Auto-generated version bump. The Configuration class and ConfigurationParameters interface remain unchanged, preserving API client configuration behavior.

src/model/payment-methods-metadata-sofort.ts (1)

7-7: LGTM!

Auto-generated version bump. No functional changes to the interface.

src/model/confirm-payment-request.ts (1)

7-7: LGTM!

Auto-generated version bump. The ConfirmPaymentRequest interface and all its fields remain unchanged.

src/model/subscription.ts (1)

7-7: OpenAPI header version bump looks consistent

Header now advertises OpenAPI document version 1.8.0; no structural or behavioral changes in Subscription. Safe to keep as-is in line with the global spec update.

src/model/payment-methods-metadata.ts (1)

7-7: Version header updated in sync with spec

OpenAPI document version updated to 1.8.0 with no interface changes to PaymentMethodsMetadata. This stays aligned with the rest of the SDK.

src/model/not-found-error.ts (1)

7-7: NotFoundError metadata regenerated correctly

Header now references OpenAPI document version 1.8.0 and marks the file as generator-owned; the NotFoundError alias is unchanged. All good.

src/model/payment-methods-metadata-giropay.ts (1)

7-7: Giropay metadata version bump is OK

OpenAPI header set to 1.8.0; the Giropay metadata interface is untouched, so there’s no functional impact.

src/api/bizum-api.ts (1)

7-7: Bizum API header aligned with OpenAPI 1.8.0

The change is limited to the OpenAPI document version in the header; the Bizum API request/response flow is unchanged. Safe to merge.

src/model/payment-methods-metadata-alipay.ts (1)

7-7: Alipay metadata header updated correctly

OpenAPI document version is now 1.8.0; the Alipay metadata interface remains the same. No issues.

src/model/send-payment-link-request.ts (1)

7-7: SendPaymentLinkRequest header version bump is fine

The file now references OpenAPI 1.8.0 with no changes to SendPaymentLinkRequest itself. Looks good.

src/model/capture-payment-request.ts (1)

7-7: CapturePaymentRequest OpenAPI version aligned

Document version header updated to 1.8.0 with no changes to the capture request shape. Change is safe.

src/model/internal-server-error.ts (1)

7-7: OpenAPI version header bump looks good

This is a metadata-only update to 1.8.0 in an auto-generated model; no runtime or typing impact.

src/model/payment-methods-metadata-eps.ts (1)

7-7: Header version updated without functional changes

The OpenAPI document version is correctly bumped to 1.8.0; the EPS metadata interface is untouched.

src/model/bizum-validate-phone200-response.ts (1)

7-7: Bizum validate-phone model version bump is safe

Only the documented OpenAPI version is updated to 1.8.0; the BizumValidatePhone200Response shape is unchanged.

src/model/cancel-subscription-request.ts (1)

7-7: CancelSubscriptionRequest header metadata aligned with 1.8.0

The OpenAPI version annotation is updated, with the request interface unchanged.

src/model/confirm-payment-request-payment-method.ts (1)

7-7: ConfirmPaymentRequestPaymentMethod version bump only

Updating the OpenAPI document version to 1.8.0 here is consistent; no interface or import changes.

src/model/payment-transaction-type.ts (1)

7-7: PaymentTransactionType header version update is non-functional

The OpenAPI header now references 1.8.0, with the transaction type constants and type alias unchanged.

src/model/payment-methods-metadata-mbway.ts (1)

7-7: MB WAY metadata model: version header bump only

The header now correctly references OpenAPI 1.8.0; no structural changes to the interface.

src/model/payment-methods-methods.ts (1)

7-7: PaymentMethodsMethods OpenAPI header aligned with 1.8.0

Only the generated header’s version string changes; the exported type stays the same.

src/model/payment-methods-metadata-click-to-pay.ts (1)

7-7: OpenAPI version bump looks good.

Auto-generated header update aligns with the 1.8.0 release adding the Apple Pay Certificate API surface.

src/model/unprocessable-entity-error.ts (1)

7-7: LGTM!

Version header update consistent with the 1.8.0 release.

src/model/payment-payment-methods.ts (1)

7-7: LGTM!

Version header update consistent with the 1.8.0 release.

package.json (1)

74-94: Dependency updates look reasonable.

All version bumps are appropriate:

  • Patch/minor updates for tooling (prettier, typescript-eslint, lint-staged)
  • vitest and @vitest/coverage-v8 are correctly aligned at 4.x
  • Yarn packageManager minor bump
src/model/payment-payment-method-input.ts (1)

7-7: LGTM!

Version header update consistent with the 1.8.0 release.

src/base.ts (1)

7-7: Header OpenAPI version bump looks consistent

Updating the generated header to 1.8.0 aligns this base client with the new spec version; no runtime impact here.

src/model/unauthorized-error.ts (1)

7-7: UnauthorizedError model header updated correctly

The OpenAPI document version in the generated header is now 1.8.0; the exported type remains unchanged.

src/model/payment-methods.ts (1)

7-7: PaymentMethods model header matches spec 1.8.0

The header version update to 1.8.0 is in line with the rest of the PR; no type or behavior changes.

src/model/payment-shipping-details.ts (1)

7-7: Shipping details model header version updated

Setting the OpenAPI document version to 1.8.0 here is consistent with the overall spec bump and keeps the generated header accurate.

src/model/payment-message-channel.ts (1)

7-7: PaymentMessageChannel header now targets 1.8.0

The enum remains identical; only the generated header version is updated to 1.8.0, which is appropriate.

src/model/pause-subscription-request.ts (1)

7-7: PauseSubscriptionRequest header aligned with 1.8.0

The header now references OpenAPI document version 1.8.0; no runtime or typing changes introduced.

src/api/payments-api.ts (1)

7-7: PaymentsApi header version bump is safe

The generated Payments API now advertises OpenAPI document version 1.8.0; implementation and signatures are preserved.

src/model/recurring-payment-request.ts (1)

7-7: RecurringPaymentRequest header updated to 1.8.0

The version string in the generated header is now 1.8.0; no changes to the request shape.

src/model/subscription-retry-schedule-inner.ts (1)

7-7: Version update correctly applied.

The OpenAPI document version has been updated to 1.8.0 consistently with the rest of the codebase. Since this is an auto-generated file, no manual edits are needed.

src/index.ts (2)

2-2: Removal of eslint-disable directive is an improvement.

The /* eslint-disable */ directive has been removed, indicating that the generated code now complies with the project's ESLint rules. The PR objectives confirm that ESLint pre-commit hooks pass.


7-7: Version update correctly applied.

OpenAPI document version bumped to 1.8.0, consistent with the broader API surface expansion for Apple Pay Certificate support.

src/model/payment-payment-method-sepa.ts (1)

4-13: Header version bump looks correct

OpenAPI document version updated to 1.8.0 with no changes to the PaymentPaymentMethodSepa interface. Safe, consistent metadata change only.

src/model/payment-sequence-recurring.ts (1)

4-13: OpenAPI header version aligned to 1.8.0

Only the documented OpenAPI version was updated; the PaymentSequenceRecurring structure is untouched. No further action needed.

src/model/payment-payment-method-klarna.ts (1)

4-13: Auto-generated header updated; Klarna model unchanged

The OpenAPI version and generator notice are updated while PaymentPaymentMethodKlarna and its enums remain identical. This is consistent with regenerated models.

src/model/payment-cancellation-reason.ts (1)

4-13: Cancellation reason model unchanged; header updated

Only the OpenAPI document version in the header changed to 1.8.0; the PaymentCancellationReason enum is intact.

src/model/payment-methods-metadata-sepa.ts (1)

4-13: SEPA metadata model header synced to 1.8.0

The header now reflects OpenAPI 1.8.0; PaymentMethodsMetadataSepa is otherwise unchanged. Looks good.

src/model/send-subscription-link-request.ts (1)

4-13: SendSubscriptionLinkRequest model unaffected by header bump

Only the OpenAPI version in the comment header changed; the request interface and channel enum stay the same.

src/model/payment-message-language.ts (1)

4-13: Message language enum stable; header now 1.8.0

The header correctly references OpenAPI 1.8.0; the PaymentMessageLanguage enum is unchanged. No issues.

src/model/payment.ts (1)

4-13: Payment model unchanged; header reflects OpenAPI 1.8.0

This is a straightforward regeneration of the header metadata; the Payment interface and its imports are unchanged and remain type-safe.

src/model/payment-payment-method-mbway.ts (1)

7-7: OpenAPI version bump is consistent

Header version updated to 1.8.0, matching other updated models; no further changes needed.

src/model/activate-apple-pay-certificate-request.ts (1)

1-27: ActivateApplePayCertificateRequest model is clear and minimal

Required cert: string field and documentation align with the activate endpoint requirements; no issues.

src/model/apple-pay-certificate-delete200-response.ts (1)

1-27: Delete response model is appropriately minimal

ApplePayCertificateDelete200Response with optional success?: boolean is sufficient for a simple confirmation payload.

index.ts (1)

4-11: ApplePayCertificateApi correctly integrated into Monei client

The new applePayCertificate API is imported, exposed as a public property, and instantiated with the same configuration and shared Axios client as the other APIs, so consumers get consistent behavior and middleware.

Also applies to: 94-96, 142-142

src/model/apple-pay-certificate.ts (1)

1-63: ApplePayCertificate model fields match lifecycle semantics

The required vs optional fields and documentation (CSR before activation, cert/expireAt after activation, ISO 8601 dates) look consistent with the Apple Pay certificate workflow.

src/model/update-apple-pay-certificate-request.ts (1)

1-27: UpdateApplePayCertificateRequest model is appropriate

Single active: boolean flag cleanly models enable/disable behavior for the update endpoint; no adjustments needed.

src/api.ts (1)

7-7: Barrel exports now include ApplePayCertificateApi

The OpenAPI version bump and added export * from './api/apple-pay-certificate-api'; (along with payments/subscriptions exports) correctly expose the new API client.

Also applies to: 15-20

src/model/index.ts (1)

1-1: Model barrel exports correctly surface new Apple Pay certificate types

The added exports for activate/update requests and certificate models align with the new API surface and keep the model index consistent and discoverable.

Also applies to: 5-6, 91-91

src/.openapi-generator/FILES (1)

2-7: New Apple Pay certificate API and model artifacts correctly registered

The added entries for the Apple Pay certificate API and related models are present and keep the file list ordered, which should keep OpenAPI generator tooling happy.

No changes needed here.

Also applies to: 12-17, 103-103

src/api/apple-pay-domain-api.ts (1)

7-7: Domain register now returns ApplePayCertificateDelete200Response – verify shared schema intent

The register operation for ApplePayDomainApi is now wired to the ApplePayCertificateDelete200Response type (a {success?: boolean}-style payload), and the FP/factory signatures are consistent with that.

This is type-safe as long as the OpenAPI spec really uses the same schema for both domain registration and certificate deletion. If domain registration is meant to expose domain-specific fields (e.g., domain name, status), that shared schema would be too narrow and a dedicated response model would be preferable.

Given this is generated code, any adjustment should be done in the OpenAPI spec rather than here.

Also applies to: 42-42, 128-136, 173-177

src/api/apple-pay-certificate-api.ts (1)

65-337: Apple Pay Certificate API client wiring looks correct and consistent

The generated Apple Pay Certificate API client:

  • Uses the expected HTTP methods and paths for all operations (/apple-pay/certificates, {id}, {id}/activate).
  • Applies API key auth via the Authorization header on every call.
  • Correctly sets JSON Content-Type and serializes bodies for activate and update.
  • Returns appropriately typed promises (ApplePayCertificate, ApplePayCertificateDelete200Response, arrays of ApplePayCertificate) through the FP, factory, and OO interfaces.

This aligns with the helper utilities in common.ts/base.ts and should integrate cleanly with the existing Monei client.

Also applies to: 344-500, 507-590, 598-690

Comment thread package.json
Comment thread tests/apple-pay-certificate-api.test.ts
- Add ApplePayCertificateApi with CRUD operations
- Add tests for all certificate endpoints
- Update generated models and API files
- Expose applePayCertificate in Monei SDK class

New API for managing Apple Pay payment processing certificates.
@jimmyn jimmyn force-pushed the feat/apple-pay-certificate-tests branch from 93b4c94 to e899311 Compare December 1, 2025 21:02
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
package.json (1)

77-77: Verify vitest 4.x migration is complete.

The major version upgrade from vitest 3.x to 4.x introduces breaking changes. While tests are passing, confirm that the following have been addressed per the Vitest 4.0 migration guide:

  • Configuration updates (deprecated options removed/migrated)
  • Coverage threshold adjustments (V8 AST-based remapping changes)
  • Mocking API behavioral changes (vi.fn().getMockName(), vi.restoreAllMocks(), vi.spyOn())
  • Test API argument order (options as second arg)
  • Environment variable rename (VITE_NODE_DEPS_MODULE_DIRECTORIESVITEST_MODULE_DIRECTORIES)

Run the following to check for deprecated config patterns and mocking API usage:

#!/bin/bash
# Check for deprecated vitest config patterns
rg -n "poolMatchGlobs|environmentMatchGlobs|deps\.(external|inline)|browser\.testerScripts|minWorkers" --type ts --type js

# Check for potential mocking API usage that may need review
rg -n "vi\.(fn|restoreAllMocks|spyOn)" --type ts -C 2

# Check for old environment variable usage
rg -n "VITE_NODE_DEPS_MODULE_DIRECTORIES" --type ts --type js

# Check vitest config file
fd -e ts -e js "vitest.config|vite.config" --exec cat {}

Also applies to: 89-89

🧹 Nitpick comments (1)
tests/apple-pay-certificate-api.test.ts (1)

1-6: Align Vitest usage with project testing guidelines

Per the testing guidelines, Vitest is configured with globals and tests should use describe/test blocks:

  • You can drop the explicit import {afterEach, describe, expect, it} from 'vitest'; and rely on the global describe, test/it, expect, and afterEach.
  • Consider using test instead of it for consistency with “Use describe and test blocks”.
  • Optionally rename the top-level describe to match the file name without extension (e.g. 'apple-pay-certificate-api.test' or 'apple-pay-certificate-api') to follow the stated convention.

This is purely stylistic and doesn’t affect correctness but will keep this file consistent with the rest of the suite.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93b4c94 and e899311.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (109)
  • index.ts (3 hunks)
  • package.json (1 hunks)
  • src/.openapi-generator/FILES (3 hunks)
  • src/api.ts (1 hunks)
  • src/api/apple-pay-certificate-api.ts (1 hunks)
  • src/api/apple-pay-domain-api.ts (4 hunks)
  • src/api/bizum-api.ts (1 hunks)
  • src/api/payment-methods-api.ts (1 hunks)
  • src/api/payments-api.ts (1 hunks)
  • src/api/subscriptions-api.ts (1 hunks)
  • src/base.ts (1 hunks)
  • src/common.ts (1 hunks)
  • src/configuration.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/model/activate-apple-pay-certificate-request.ts (1 hunks)
  • src/model/activate-subscription-request.ts (1 hunks)
  • src/model/address.ts (1 hunks)
  • src/model/api-exception.ts (1 hunks)
  • src/model/apple-pay-certificate-delete200-response.ts (1 hunks)
  • src/model/apple-pay-certificate.ts (1 hunks)
  • src/model/bad-request-error.ts (1 hunks)
  • src/model/bizum-validate-phone200-response.ts (1 hunks)
  • src/model/cancel-payment-request.ts (1 hunks)
  • src/model/cancel-subscription-request.ts (1 hunks)
  • src/model/capture-payment-request.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method-card.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method.ts (1 hunks)
  • src/model/confirm-payment-request.ts (1 hunks)
  • src/model/create-payment-request.ts (1 hunks)
  • src/model/create-subscription-request.ts (1 hunks)
  • src/model/index.ts (2 hunks)
  • src/model/internal-server-error.ts (1 hunks)
  • src/model/not-found-error.ts (1 hunks)
  • src/model/pause-subscription-request.ts (1 hunks)
  • src/model/payment-billing-details.ts (1 hunks)
  • src/model/payment-cancellation-reason.ts (1 hunks)
  • src/model/payment-customer.ts (1 hunks)
  • src/model/payment-last-refund-reason.ts (1 hunks)
  • src/model/payment-message-channel.ts (1 hunks)
  • src/model/payment-message-language.ts (1 hunks)
  • src/model/payment-methods-metadata-alipay.ts (1 hunks)
  • src/model/payment-methods-metadata-apple-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-bancontact.ts (1 hunks)
  • src/model/payment-methods-metadata-bizum.ts (1 hunks)
  • src/model/payment-methods-metadata-blik.ts (1 hunks)
  • src/model/payment-methods-metadata-card.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-discover.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-visa.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-eps.ts (1 hunks)
  • src/model/payment-methods-metadata-giropay.ts (1 hunks)
  • src/model/payment-methods-metadata-google-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-ideal.ts (1 hunks)
  • src/model/payment-methods-metadata-klarna.ts (1 hunks)
  • src/model/payment-methods-metadata-mbway.ts (1 hunks)
  • src/model/payment-methods-metadata-sepa.ts (1 hunks)
  • src/model/payment-methods-metadata-sofort.ts (1 hunks)
  • src/model/payment-methods-metadata-trustly.ts (1 hunks)
  • src/model/payment-methods-metadata.ts (1 hunks)
  • src/model/payment-methods-methods.ts (1 hunks)
  • src/model/payment-methods.ts (1 hunks)
  • src/model/payment-next-action.ts (1 hunks)
  • src/model/payment-payment-method-bizum-input.ts (1 hunks)
  • src/model/payment-payment-method-bizum.ts (1 hunks)
  • src/model/payment-payment-method-card-input.ts (1 hunks)
  • src/model/payment-payment-method-card.ts (1 hunks)
  • src/model/payment-payment-method-input.ts (1 hunks)
  • src/model/payment-payment-method-klarna.ts (1 hunks)
  • src/model/payment-payment-method-mbway.ts (1 hunks)
  • src/model/payment-payment-method-paypal.ts (1 hunks)
  • src/model/payment-payment-method-sepa.ts (1 hunks)
  • src/model/payment-payment-method-trustly.ts (1 hunks)
  • src/model/payment-payment-method.ts (1 hunks)
  • src/model/payment-payment-methods.ts (1 hunks)
  • src/model/payment-refund-reason.ts (1 hunks)
  • src/model/payment-sequence-recurring.ts (1 hunks)
  • src/model/payment-sequence.ts (1 hunks)
  • src/model/payment-session-details.ts (1 hunks)
  • src/model/payment-shipping-details.ts (1 hunks)
  • src/model/payment-shop.ts (1 hunks)
  • src/model/payment-status.ts (1 hunks)
  • src/model/payment-trace-details.ts (1 hunks)
  • src/model/payment-transaction-type.ts (1 hunks)
  • src/model/payment.ts (1 hunks)
  • src/model/recurring-payment-request.ts (1 hunks)
  • src/model/refund-payment-request.ts (1 hunks)
  • src/model/register-apple-pay-domain-request.ts (1 hunks)
  • src/model/send-payment-link-request.ts (1 hunks)
  • src/model/send-payment-receipt-request.ts (1 hunks)
  • src/model/send-payment-request-request.ts (1 hunks)
  • src/model/send-subscription-link-request.ts (1 hunks)
  • src/model/send-subscription-status-request.ts (1 hunks)
  • src/model/service-unavailable-error.ts (1 hunks)
  • src/model/subscription-interval.ts (1 hunks)
  • src/model/subscription-last-payment.ts (1 hunks)
  • src/model/subscription-payment-method-card.ts (1 hunks)
  • src/model/subscription-payment-method.ts (1 hunks)
  • src/model/subscription-payment-methods.ts (1 hunks)
  • src/model/subscription-retry-schedule-inner.ts (1 hunks)
  • src/model/subscription-retry-schedule.ts (1 hunks)
  • src/model/subscription-status.ts (1 hunks)
  • src/model/subscription.ts (1 hunks)
  • src/model/unauthorized-error.ts (1 hunks)
  • src/model/unprocessable-entity-error.ts (1 hunks)
  • src/model/update-apple-pay-certificate-request.ts (1 hunks)
  • src/model/update-subscription-request.ts (1 hunks)
  • src/model/validate-bizum-phone-request.ts (1 hunks)
  • tests/apple-pay-certificate-api.test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • src/model/payment-methods.ts
  • src/model/payment-payment-method-bizum-input.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/model/payment-methods-metadata-card.ts
  • src/model/payment-shipping-details.ts
  • src/model/payment-payment-method-paypal.ts
  • src/common.ts
  • src/model/subscription-payment-methods.ts
  • src/model/subscription-payment-method.ts
  • src/model/validate-bizum-phone-request.ts
🚧 Files skipped from review as they are similar to previous changes (83)
  • src/model/payment-next-action.ts
  • src/configuration.ts
  • src/model/api-exception.ts
  • src/model/confirm-payment-request.ts
  • src/model/payment-methods-metadata-sepa.ts
  • src/model/payment-methods-metadata-ideal.ts
  • src/model/payment-methods-metadata-click-to-pay.ts
  • src/model/payment-payment-method-sepa.ts
  • src/model/recurring-payment-request.ts
  • src/model/payment-methods-metadata-alipay.ts
  • src/model/bad-request-error.ts
  • src/model/apple-pay-certificate.ts
  • src/model/unauthorized-error.ts
  • src/model/payment-payment-method-mbway.ts
  • src/model/confirm-payment-request-payment-method.ts
  • src/model/payment-transaction-type.ts
  • src/model/send-payment-request-request.ts
  • src/model/payment-billing-details.ts
  • src/model/payment-shop.ts
  • src/model/payment-methods-metadata-trustly.ts
  • src/model/payment-payment-method-card-input.ts
  • src/model/payment-sequence.ts
  • src/model/send-subscription-status-request.ts
  • src/model/payment-payment-method.ts
  • src/model/payment-cancellation-reason.ts
  • src/model/payment-methods-methods.ts
  • src/model/create-payment-request.ts
  • src/model/payment-sequence-recurring.ts
  • src/model/payment-message-channel.ts
  • src/model/capture-payment-request.ts
  • src/model/send-subscription-link-request.ts
  • src/api/subscriptions-api.ts
  • src/model/payment-methods-metadata-click-to-pay-discover.ts
  • src/model/payment-payment-method-klarna.ts
  • src/model/payment-methods-metadata-apple-pay.ts
  • src/index.ts
  • src/model/payment.ts
  • index.ts
  • src/model/subscription-interval.ts
  • src/model/apple-pay-certificate-delete200-response.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/payment-methods-metadata-bancontact.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/refund-payment-request.ts
  • src/api/payment-methods-api.ts
  • src/model/payment-methods-metadata-click-to-pay-visa.ts
  • src/model/payment-last-refund-reason.ts
  • src/base.ts
  • src/api/payments-api.ts
  • src/model/activate-subscription-request.ts
  • src/model/payment-session-details.ts
  • src/model/payment-methods-metadata-google-pay.ts
  • src/model/payment-methods-metadata-klarna.ts
  • src/model/subscription-retry-schedule.ts
  • src/model/payment-payment-methods.ts
  • src/model/payment-methods-metadata-blik.ts
  • src/model/payment-payment-method-input.ts
  • src/model/payment-customer.ts
  • src/model/subscription-retry-schedule-inner.ts
  • src/.openapi-generator/FILES
  • src/model/internal-server-error.ts
  • src/api/apple-pay-certificate-api.ts
  • src/model/payment-trace-details.ts
  • src/model/subscription.ts
  • src/model/payment-refund-reason.ts
  • src/model/payment-payment-method-bizum.ts
  • src/model/register-apple-pay-domain-request.ts
  • src/model/payment-methods-metadata-giropay.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/payment-methods-metadata-eps.ts
  • src/api.ts
  • src/model/subscription-payment-method-card.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts
  • src/model/address.ts
  • src/model/cancel-payment-request.ts
  • src/model/payment-payment-method-card.ts
  • src/model/send-payment-link-request.ts
  • src/model/pause-subscription-request.ts
  • src/model/subscription-status.ts
  • src/model/not-found-error.ts
  • src/model/create-subscription-request.ts
  • src/model/send-payment-receipt-request.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

⚙️ CodeRabbit configuration file

**/*.ts: - Ensure code is clean, readable, and maintainable.

  • Adhere to proper naming conventions and consistent formatting.
  • Split functionality into smaller, reusable modules.
  • Keep files small by extracting related functionalities into separate modules.
  • Use imports to connect modules effectively.
  • Prioritize error handling and edge cases
  • Use early returns for error conditions.
  • Implement guard clauses for preconditions and invalid states.
  • Use custom error types for consistent error handling.
  • Write concise, technical, and type-safe TypeScript code.
  • Import types with import type to avoid importing implementations.
  • Use @ts-expect-error instead of @ts-ignore and add a comment explaining why the error is expected.
  • Use early return patterns to avoid deep nesting.
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  • Use AWS SDK V3 instead of V2.
  • Use Zod for data validation.
  • Use the full import path for packages when possible to enable tree shaking and reduce bundle size.

Files:

  • src/model/payment-payment-method-trustly.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/index.ts
  • src/model/service-unavailable-error.ts
  • src/api/apple-pay-domain-api.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/payment-status.ts
  • src/model/subscription-last-payment.ts
  • tests/apple-pay-certificate-api.test.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/api/bizum-api.ts
  • src/model/payment-methods-metadata.ts
  • src/model/update-subscription-request.ts
  • src/model/cancel-subscription-request.ts
  • src/model/payment-message-language.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:

  1. Visual verification that the UI renders correctly
  2. Functional testing of user interactions
  3. Edge cases and error states
  4. Cross-browser/device testing if applicable
  5. Integration with related features

Files:

  • src/model/payment-payment-method-trustly.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/index.ts
  • src/model/service-unavailable-error.ts
  • package.json
  • src/api/apple-pay-domain-api.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/payment-status.ts
  • src/model/subscription-last-payment.ts
  • tests/apple-pay-certificate-api.test.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/api/bizum-api.ts
  • src/model/payment-methods-metadata.ts
  • src/model/update-subscription-request.ts
  • src/model/cancel-subscription-request.ts
  • src/model/payment-message-language.ts
**/*.test.ts

⚙️ CodeRabbit configuration file

**/*.test.ts: - Always write unit tests using Vitest.

  • Always use Wallaby MCP to check tests results and get additional information when debugging tests.
  • Always use file path relatieve to the project root when calling Wallaby MCP tools, do not include project folder in the path
  • Place all unit test files in the same folder as the tested file, with the same name and a .test.ts extension.
  • Vitest is configured with globals; do not import describe and test from vitest.
  • Use describe and test blocks to organize test cases.
  • Name root-level describe blocks after the file name, without the extension.
  • Prefer toMatchInlineSnapshot over toMatchSnapshot for snapshot testing.
  • Use test.each to test multiple cases with the same test.
  • To mock AWS SDK V3, use aws-sdk-client-mock.
  • To mock Axios, use axios-mock-adapter.
  • To mock imports, use vi.mocked.
  • Never mock the getEnv function; instead, define all environment variables in vitest.config.ts.
  • Never mock withError function; its a pure function and should not be mocked. Mock the function inside the withError function.
  • Prefer using vi.spyOn over vi.mock to mock modules.
  • When mocking a named export, first import the module with import * as module from 'module'; and then use vi.spyOn(module, 'method').mockImplementation(() => { ... });.
  • Use structuredClone to clone mock data.
  • Do not mock getEnv function, instead define all environment variables in vitest.config.ts or use vi.stubEnv to stub environment variables.
  • Do not mock dayjs function, instead use vi.useFakeTimers() to mock the current time.
  • Always clear all mocks in afterEach hook, not in beforeEach.
  • Never mock entire Dynamoose model classes. Instead, use vi.spyOn to mock specific methods. If a class is mocked, the instance will be shared between tests.
  • When mocking Dynamoose models, all methods expect ones that return QueryResponse should return model instances. For example `vi.sp...

Files:

  • tests/apple-pay-certificate-api.test.ts
🧬 Code graph analysis (2)
src/api/apple-pay-domain-api.ts (2)
src/axios.ts (1)
  • AxiosPromise (18-18)
src/model/apple-pay-certificate-delete200-response.ts (1)
  • ApplePayCertificateDelete200Response (20-27)
tests/apple-pay-certificate-api.test.ts (1)
tests/test-utils.ts (3)
  • resetTestEnv (36-38)
  • createTestClient (15-21)
  • mockAxios (12-12)
🔇 Additional comments (16)
src/model/subscription-last-payment.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/update-subscription-request.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/payment-status.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/confirm-payment-request-payment-method-card.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/payment-payment-method-trustly.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/payment-message-language.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

src/model/payment-methods-metadata.ts (1)

7-7: LGTM! Auto-generated OpenAPI version bump.

This is an auto-generated file with only the OpenAPI document version updated from 1.7.3 to 1.8.0. No functional changes.

package.json (1)

74-76: LGTM! Minor dependency and package manager updates.

The following updates are minor/patch version bumps with low risk:

  • @openapitools/openapi-generator-cli: ^2.25.0 → ^2.25.2
  • @release-it/conventional-changelog: ^10.0.1 → ^10.0.2
  • @types/node: ^22.19.0 → ^22.19.1
  • lint-staged: ^16.2.6 → ^16.2.7
  • prettier: ^3.6.2 → ^3.7.3
  • typescript-eslint: ^8.46.4 → ^8.48.0
  • packageManager: yarn@4.11.0 → yarn@4.12.0

Also applies to: 78-78, 81-81, 84-84, 88-88, 94-94

src/model/cancel-subscription-request.ts (1)

7-7: OpenAPI version header bump only

Header now reflects OpenAPI document version 1.8.0; no functional impact on CancelSubscriptionRequest.

src/model/service-unavailable-error.ts (1)

7-7: ServiceUnavailableError version header updated

Doc header now points to OpenAPI 1.8.0; the ServiceUnavailableError = ApiException alias remains intact.

src/api/bizum-api.ts (1)

7-7: BizumApi OpenAPI header sync

Version header now set to 1.8.0; Bizum API request/response logic is unchanged.

src/model/activate-apple-pay-certificate-request.ts (1)

1-27: ActivateApplePayCertificateRequest shape looks correct

cert: string as a required base64-encoded signed certificate matches the activate flow and is clearly documented.

src/model/index.ts (1)

1-6: Apple Pay certificate models correctly exported; verify impact of removed domain response type

The added exports for activate-apple-pay-certificate-request, apple-pay-certificate, apple-pay-certificate-delete200-response, and update-apple-pay-certificate-request keep the model index in sync with the new Apple Pay certificate API and look good.

Note that apple-pay-domain-register200-response is no longer exported from this index, and ApplePayDomainApi.register now returns ApplePayCertificateDelete200Response. That’s a breaking change for SDK consumers that referenced the old response type directly, so please confirm this is intentional and aligned with your versioning/release plan (or consider a compatibility alias in a non-generated module if needed).

Also applies to: 91-91

tests/apple-pay-certificate-api.test.ts (1)

8-114: Apple Pay Certificate API tests cover all endpoints and match model contracts

The suite exercises all six Apple Pay Certificate endpoints (create, get, list, activate, update, _delete) against the SDK client:

  • URLs and HTTP methods for each operation match the expected REST paths.
  • Response mocks for certificate details use expireAt and other fields consistent with the generated ApplePayCertificate model.
  • The delete test expects {success: true}, matching ApplePayCertificateDelete200Response.
  • Axios mocks are reset in afterEach via shared resetTestEnv, so tests are isolated.

This provides solid coverage of the client wiring for the new API surface.

src/model/update-apple-pay-certificate-request.ts (1)

1-27: UpdateApplePayCertificateRequest model is appropriate

active: boolean as the sole field cleanly represents toggling certificate status and aligns with the update test payloads.

src/api/apple-pay-domain-api.ts (1)

7-7: ApplePayDomainApi now reuses ApplePayCertificateDelete200Response; confirm compatibility expectations

The domain registration endpoint now:

  • Uses ApplePayCertificateDelete200Response as its 200‑response type.
  • Returns AxiosPromise<ApplePayCertificateDelete200Response> from both FP and factory interfaces.

Given ApplePayCertificateDelete200Response is just a {success?: boolean} wrapper, behavior is effectively unchanged, but this renames the public TS type associated with ApplePayDomainApi.register. Please confirm this rename is acceptable for your consumers (or documented as a breaking change) and that no callers depend on the old ApplePayDomainRegister200Response symbol.

Also applies to: 42-42, 132-136, 176-176

… TypeScript configuration

- Update OpenAPI document version from 1.8.0 to 1.8.1 across multiple model and API files.
- Add Node types to TypeScript configuration for improved type support.
@jimmyn jimmyn merged commit 525bfab into master Dec 2, 2025
4 of 5 checks passed
@jimmyn jimmyn deleted the feat/apple-pay-certificate-tests branch December 2, 2025 16:15
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/model/bizum-validate-phone200-response.ts (1)

1-27: Manual testing checklist for Apple Pay Certificate API changes

Use this checklist to validate the broader PR behavior around the new Apple Pay Certificate API surface:

  • Visual: If any UI or API docs/console are affected, open them and verify Apple Pay certificate operations are visible, correctly labeled, and without layout issues.
  • Functional – core flows
    • Create Apple Pay certificate: verify CSR generation works and returns expected fields.
    • Get Apple Pay certificate by ID: verify correct object is returned and 404 behavior for unknown IDs.
    • List Apple Pay certificates: verify pagination / filtering (if applicable) and stable ordering.
    • Activate Apple Pay certificate: upload a signed certificate from Apple and verify it transitions to active state.
    • Update Apple Pay certificate: toggle active status and confirm state persists.
    • Delete Apple Pay certificate: ensure subsequent get/list behave as expected (not found or no longer listed).
  • Edge cases & error states
    • Invalid or expired Apple-signed certificate on activate.
    • Attempts to activate/delete non-existent or already-deleted certificates.
    • Toggling active flag for already-active/inactive certificates.
    • Permission/auth failures (invalid API key, insufficient scopes).
  • Cross-environment / device / browser (if UI involved)
    • Test in both Test and Live environments (or sandbox vs production-like) to confirm consistent behavior.
    • If there is a dashboard UI, verify in at least two browsers (e.g., Chrome, Firefox/Safari) and on desktop + mobile layout.
  • Integration with related features
    • Use the activated Apple Pay certificate in a full payment flow and confirm Apple Pay transactions succeed.
    • Verify logging/monitoring/alerts capture failures in certificate lifecycle operations.
    • Confirm SDK changes (including this Bizum model file and other generated models) don’t break existing Bizum or payment flows.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e899311 and f05495e.

📒 Files selected for processing (108)
  • src/.openapi-generator/FILES (3 hunks)
  • src/api.ts (1 hunks)
  • src/api/apple-pay-certificate-api.ts (1 hunks)
  • src/api/apple-pay-domain-api.ts (4 hunks)
  • src/api/bizum-api.ts (1 hunks)
  • src/api/payment-methods-api.ts (1 hunks)
  • src/api/payments-api.ts (1 hunks)
  • src/api/subscriptions-api.ts (1 hunks)
  • src/base.ts (1 hunks)
  • src/common.ts (1 hunks)
  • src/configuration.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/model/activate-apple-pay-certificate-request.ts (1 hunks)
  • src/model/activate-subscription-request.ts (1 hunks)
  • src/model/address.ts (1 hunks)
  • src/model/api-exception.ts (1 hunks)
  • src/model/apple-pay-certificate.ts (1 hunks)
  • src/model/apple-pay-certificates-remove200-response.ts (1 hunks)
  • src/model/bad-request-error.ts (1 hunks)
  • src/model/bizum-validate-phone200-response.ts (1 hunks)
  • src/model/cancel-payment-request.ts (1 hunks)
  • src/model/cancel-subscription-request.ts (1 hunks)
  • src/model/capture-payment-request.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method-card.ts (1 hunks)
  • src/model/confirm-payment-request-payment-method.ts (1 hunks)
  • src/model/confirm-payment-request.ts (1 hunks)
  • src/model/create-payment-request.ts (1 hunks)
  • src/model/create-subscription-request.ts (1 hunks)
  • src/model/index.ts (2 hunks)
  • src/model/internal-server-error.ts (1 hunks)
  • src/model/not-found-error.ts (1 hunks)
  • src/model/pause-subscription-request.ts (1 hunks)
  • src/model/payment-billing-details.ts (1 hunks)
  • src/model/payment-cancellation-reason.ts (1 hunks)
  • src/model/payment-customer.ts (1 hunks)
  • src/model/payment-last-refund-reason.ts (1 hunks)
  • src/model/payment-message-channel.ts (1 hunks)
  • src/model/payment-message-language.ts (1 hunks)
  • src/model/payment-methods-metadata-alipay.ts (1 hunks)
  • src/model/payment-methods-metadata-apple-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-bancontact.ts (1 hunks)
  • src/model/payment-methods-metadata-bizum.ts (1 hunks)
  • src/model/payment-methods-metadata-blik.ts (1 hunks)
  • src/model/payment-methods-metadata-card.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-discover.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay-visa.ts (1 hunks)
  • src/model/payment-methods-metadata-click-to-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-eps.ts (1 hunks)
  • src/model/payment-methods-metadata-giropay.ts (1 hunks)
  • src/model/payment-methods-metadata-google-pay.ts (1 hunks)
  • src/model/payment-methods-metadata-ideal.ts (1 hunks)
  • src/model/payment-methods-metadata-klarna.ts (1 hunks)
  • src/model/payment-methods-metadata-mbway.ts (1 hunks)
  • src/model/payment-methods-metadata-sepa.ts (1 hunks)
  • src/model/payment-methods-metadata-sofort.ts (1 hunks)
  • src/model/payment-methods-metadata-trustly.ts (1 hunks)
  • src/model/payment-methods-metadata.ts (1 hunks)
  • src/model/payment-methods-methods.ts (1 hunks)
  • src/model/payment-methods.ts (1 hunks)
  • src/model/payment-next-action.ts (1 hunks)
  • src/model/payment-payment-method-bizum-input.ts (1 hunks)
  • src/model/payment-payment-method-bizum.ts (1 hunks)
  • src/model/payment-payment-method-card-input.ts (1 hunks)
  • src/model/payment-payment-method-card.ts (1 hunks)
  • src/model/payment-payment-method-input.ts (1 hunks)
  • src/model/payment-payment-method-klarna.ts (1 hunks)
  • src/model/payment-payment-method-mbway.ts (1 hunks)
  • src/model/payment-payment-method-paypal.ts (1 hunks)
  • src/model/payment-payment-method-sepa.ts (1 hunks)
  • src/model/payment-payment-method-trustly.ts (1 hunks)
  • src/model/payment-payment-method.ts (1 hunks)
  • src/model/payment-payment-methods.ts (1 hunks)
  • src/model/payment-refund-reason.ts (1 hunks)
  • src/model/payment-sequence-recurring.ts (1 hunks)
  • src/model/payment-sequence.ts (1 hunks)
  • src/model/payment-session-details.ts (1 hunks)
  • src/model/payment-shipping-details.ts (1 hunks)
  • src/model/payment-shop.ts (1 hunks)
  • src/model/payment-status.ts (1 hunks)
  • src/model/payment-trace-details.ts (1 hunks)
  • src/model/payment-transaction-type.ts (1 hunks)
  • src/model/payment.ts (1 hunks)
  • src/model/recurring-payment-request.ts (1 hunks)
  • src/model/refund-payment-request.ts (1 hunks)
  • src/model/register-apple-pay-domain-request.ts (1 hunks)
  • src/model/send-payment-link-request.ts (1 hunks)
  • src/model/send-payment-receipt-request.ts (1 hunks)
  • src/model/send-payment-request-request.ts (1 hunks)
  • src/model/send-subscription-link-request.ts (1 hunks)
  • src/model/send-subscription-status-request.ts (1 hunks)
  • src/model/service-unavailable-error.ts (1 hunks)
  • src/model/subscription-interval.ts (1 hunks)
  • src/model/subscription-last-payment.ts (1 hunks)
  • src/model/subscription-payment-method-card.ts (1 hunks)
  • src/model/subscription-payment-method.ts (1 hunks)
  • src/model/subscription-payment-methods.ts (1 hunks)
  • src/model/subscription-retry-schedule-inner.ts (1 hunks)
  • src/model/subscription-retry-schedule.ts (1 hunks)
  • src/model/subscription-status.ts (1 hunks)
  • src/model/subscription.ts (1 hunks)
  • src/model/unauthorized-error.ts (1 hunks)
  • src/model/unprocessable-entity-error.ts (1 hunks)
  • src/model/update-apple-pay-certificate-request.ts (1 hunks)
  • src/model/update-subscription-request.ts (1 hunks)
  • src/model/validate-bizum-phone-request.ts (1 hunks)
  • tests/apple-pay-certificate-api.test.ts (1 hunks)
  • tsconfig.build.json (1 hunks)
✅ Files skipped from review due to trivial changes (7)
  • src/api/bizum-api.ts
  • src/model/payment-methods-metadata-ideal.ts
  • src/model/create-payment-request.ts
  • src/model/update-subscription-request.ts
  • src/model/payment-payment-method-paypal.ts
  • src/model/pause-subscription-request.ts
  • src/model/subscription.ts
🚧 Files skipped from review as they are similar to previous changes (79)
  • src/model/payment-payment-method.ts
  • src/model/payment-methods-metadata-blik.ts
  • src/model/address.ts
  • src/model/payment-trace-details.ts
  • src/common.ts
  • src/model/payment-methods.ts
  • src/model/payment-methods-metadata-sepa.ts
  • src/model/api-exception.ts
  • src/model/send-subscription-link-request.ts
  • src/model/subscription-payment-methods.ts
  • src/model/subscription-payment-method.ts
  • src/model/payment-session-details.ts
  • src/model/payment-methods-metadata-click-to-pay-discover.ts
  • src/model/payment-methods-metadata-trustly.ts
  • src/model/payment-next-action.ts
  • src/model/cancel-payment-request.ts
  • src/model/payment-payment-method-card-input.ts
  • src/model/recurring-payment-request.ts
  • src/model/payment-billing-details.ts
  • src/api/payment-methods-api.ts
  • src/model/payment-payment-method-input.ts
  • src/model/payment-methods-metadata-card.ts
  • src/model/refund-payment-request.ts
  • src/model/payment-last-refund-reason.ts
  • src/model/payment-methods-metadata.ts
  • src/model/payment-transaction-type.ts
  • src/model/payment-methods-metadata-google-pay.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/payment-shop.ts
  • src/model/payment-methods-metadata-alipay.ts
  • src/model/payment-customer.ts
  • src/model/payment-payment-methods.ts
  • src/model/payment-methods-metadata-click-to-pay-visa.ts
  • src/model/payment-methods-metadata-apple-pay.ts
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts
  • src/model/confirm-payment-request.ts
  • src/model/register-apple-pay-domain-request.ts
  • src/model/subscription-retry-schedule-inner.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/payment-message-language.ts
  • src/model/payment.ts
  • src/model/confirm-payment-request-payment-method.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/model/cancel-subscription-request.ts
  • src/model/apple-pay-certificate.ts
  • src/api/subscriptions-api.ts
  • src/model/send-payment-receipt-request.ts
  • src/configuration.ts
  • src/model/validate-bizum-phone-request.ts
  • src/model/payment-methods-metadata-klarna.ts
  • src/model/send-payment-request-request.ts
  • src/model/send-subscription-status-request.ts
  • src/model/payment-methods-metadata-giropay.ts
  • src/model/payment-sequence-recurring.ts
  • src/api/payments-api.ts
  • src/index.ts
  • src/model/payment-payment-method-trustly.ts
  • src/model/payment-methods-metadata-eps.ts
  • src/model/payment-methods-metadata-bancontact.ts
  • src/model/payment-methods-metadata-click-to-pay.ts
  • src/model/payment-sequence.ts
  • tests/apple-pay-certificate-api.test.ts
  • src/model/payment-payment-method-bizum-input.ts
  • src/model/payment-refund-reason.ts
  • src/model/payment-payment-method-klarna.ts
  • src/model/payment-payment-method-bizum.ts
  • src/model/payment-cancellation-reason.ts
  • src/model/payment-payment-method-sepa.ts
  • src/model/payment-message-channel.ts
  • src/model/not-found-error.ts
  • src/model/capture-payment-request.ts
  • src/model/internal-server-error.ts
  • src/model/send-payment-link-request.ts
  • src/model/payment-payment-method-card.ts
  • src/model/subscription-last-payment.ts
  • src/model/subscription-payment-method-card.ts
  • src/model/payment-payment-method-mbway.ts
  • src/model/payment-methods-methods.ts
  • src/model/payment-status.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts

⚙️ CodeRabbit configuration file

**/*.ts: - Ensure code is clean, readable, and maintainable.

  • Adhere to proper naming conventions and consistent formatting.
  • Split functionality into smaller, reusable modules.
  • Keep files small by extracting related functionalities into separate modules.
  • Use imports to connect modules effectively.
  • Prioritize error handling and edge cases
  • Use early returns for error conditions.
  • Implement guard clauses for preconditions and invalid states.
  • Use custom error types for consistent error handling.
  • Write concise, technical, and type-safe TypeScript code.
  • Import types with import type to avoid importing implementations.
  • Use @ts-expect-error instead of @ts-ignore and add a comment explaining why the error is expected.
  • Use early return patterns to avoid deep nesting.
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  • Use AWS SDK V3 instead of V2.
  • Use Zod for data validation.
  • Use the full import path for packages when possible to enable tree shaking and reduce bundle size.

Files:

  • src/model/activate-subscription-request.ts
  • src/model/apple-pay-certificates-remove200-response.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/subscription-interval.ts
  • src/api/apple-pay-domain-api.ts
  • src/model/payment-shipping-details.ts
  • src/model/subscription-retry-schedule.ts
  • src/base.ts
  • src/model/index.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/model/unauthorized-error.ts
  • src/model/service-unavailable-error.ts
  • src/model/bad-request-error.ts
  • src/model/subscription-status.ts
  • src/api.ts
  • src/api/apple-pay-certificate-api.ts
  • src/model/create-subscription-request.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:

  1. Visual verification that the UI renders correctly
  2. Functional testing of user interactions
  3. Edge cases and error states
  4. Cross-browser/device testing if applicable
  5. Integration with related features

Files:

  • src/model/activate-subscription-request.ts
  • tsconfig.build.json
  • src/model/apple-pay-certificates-remove200-response.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/subscription-interval.ts
  • src/api/apple-pay-domain-api.ts
  • src/model/payment-shipping-details.ts
  • src/model/subscription-retry-schedule.ts
  • src/base.ts
  • src/model/index.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/model/unauthorized-error.ts
  • src/model/service-unavailable-error.ts
  • src/model/bad-request-error.ts
  • src/model/subscription-status.ts
  • src/api.ts
  • src/api/apple-pay-certificate-api.ts
  • src/model/create-subscription-request.ts
🧬 Code graph analysis (2)
src/api/apple-pay-domain-api.ts (2)
src/axios.ts (1)
  • AxiosPromise (18-18)
src/model/apple-pay-certificates-remove200-response.ts (1)
  • ApplePayCertificatesRemove200Response (20-27)
src/api/apple-pay-certificate-api.ts (8)
src/configuration.ts (1)
  • Configuration (34-135)
src/model/activate-apple-pay-certificate-request.ts (1)
  • ActivateApplePayCertificateRequest (20-27)
src/base.ts (4)
  • RequestArgs (39-42)
  • operationServerMap (91-91)
  • BASE_PATH (21-21)
  • BaseAPI (49-62)
src/common.ts (6)
  • assertParamExists (31-42)
  • DUMMY_BASE_URL (24-24)
  • setApiKeyToObject (48-60)
  • setSearchParams (136-140)
  • serializeDataIfNeeded (146-157)
  • toPathString (163-165)
src/model/update-apple-pay-certificate-request.ts (1)
  • UpdateApplePayCertificateRequest (20-27)
src/axios.ts (1)
  • AxiosPromise (18-18)
src/model/apple-pay-certificate.ts (1)
  • ApplePayCertificate (20-63)
src/model/apple-pay-certificates-remove200-response.ts (1)
  • ApplePayCertificatesRemove200Response (20-27)
🔇 Additional comments (22)
src/model/bizum-validate-phone200-response.ts (1)

7-7: OpenAPI version header bump is consistent and safe

The version string update to 1.8.1 in the generated header is consistent with the rest of the comment block and has no runtime impact. No further changes needed here.

src/model/service-unavailable-error.ts (1)

4-12: Header version bump only

OpenAPI document version updated in the comment to 1.8.1; no runtime or type-level impact here. Change looks good.

src/model/payment-methods-metadata-sofort.ts (1)

4-12: Non-functional OpenAPI version update

The 1.8.1 OpenAPI version bump is limited to documentation comments; the PaymentMethodsMetadataSofort interface remains unchanged. All good.

src/model/payment-methods-metadata-bizum.ts (1)

4-12: Doc-only change for Bizum metadata

Updated OpenAPI document version to 1.8.1 in comments; PaymentMethodsMetadataBizum is unaffected. Looks fine.

src/model/subscription-retry-schedule.ts (1)

4-12: Subscription retry schedule: header metadata update

Only the documented OpenAPI version was bumped to 1.8.1; the SubscriptionRetrySchedule type remains identical. No issues.

src/base.ts (1)

4-12: Base API file: comment-only OpenAPI version bump

The change here is just the OpenAPI document version in the header comment (to 1.8.1); the BaseAPI implementation and related types are unchanged. Safe update.

src/model/unprocessable-entity-error.ts (1)

4-12: Unprocessable entity error: version in header

Only the header’s OpenAPI version string changed to 1.8.1; the UnprocessableEntityError type alias is untouched. No concerns.

tsconfig.build.json (1)

5-10: Build config: enabling Node types for the build

Adding "types": ["node"] and explicitly allowing unused parameters ("noUnusedParameters": false) aligns with a Node-focused SDK and generated API surface; this should help with typings where Node globals are referenced without over-constraining generated signatures. Just confirm there’s no browser-only consumer build relying on this tsconfig.

src/model/payment-methods-metadata-mbway.ts (1)

4-12: MB Way metadata: OpenAPI header version bump

The update to OpenAPI version 1.8.1 is confined to the auto-generated header; the PaymentMethodsMetadataMbway interface is unchanged. Looks good.

src/model/payment-shipping-details.ts (1)

7-7: OpenAPI version header updated only

This is a non-functional doc header bump to 1.8.1; safe and consistent with the broader PR.

src/model/subscription-status.ts (1)

7-7: SubscriptionStatus model regenerated against spec 1.8.1

Only the OpenAPI document version annotation changed; enum values and typing remain identical.

src/model/activate-subscription-request.ts (1)

7-7: ActivateSubscriptionRequest header bump only

OpenAPI version comment updated to 1.8.1 with no changes to the request shape; looks good.

src/model/unauthorized-error.ts (1)

7-7: UnauthorizedError model aligned with spec 1.8.1

The change is limited to the generated header version; the UnauthorizedError alias remains intact.

src/model/subscription-interval.ts (1)

7-7: SubscriptionInterval header version bump

Only the OpenAPI document version comment changed; no impact on the enum or type usage.

src/model/create-subscription-request.ts (1)

7-7: CreateSubscriptionRequest regenerated tag

The header now references OpenAPI 1.8.1; the request contract is unchanged, so this is safe.

src/model/bad-request-error.ts (1)

7-7: BadRequestError header aligned to 1.8.1

Non-functional change to the generated header only; the alias to ApiException remains as before.

src/model/apple-pay-certificates-remove200-response.ts (1)

1-27: New ApplePayCertificatesRemove200Response model is appropriately minimal

The interface with an optional success?: boolean cleanly represents the DELETE/remove response and fits the generated model conventions used elsewhere in the SDK.

src/api.ts (1)

7-7: LGTM! OpenAPI version and exports updated correctly.

The OpenAPI document version has been updated to 1.8.1, and the new Apple Pay Certificate API has been properly exported alongside existing APIs. These auto-generated changes correctly expand the public API surface.

Also applies to: 15-20

src/model/index.ts (1)

1-1: LGTM! Model exports properly updated for Apple Pay Certificate API.

The new certificate-related models have been correctly added to the public surface:

  • activate-apple-pay-certificate-request
  • apple-pay-certificate
  • apple-pay-certificates-remove200-response
  • update-apple-pay-certificate-request

These exports align with the new Apple Pay Certificate API endpoints and replace the previous domain-register response model.

Also applies to: 5-6, 91-91

src/.openapi-generator/FILES (1)

2-2: LGTM! Generator manifest updated correctly.

The OpenAPI generator manifest properly reflects the new Apple Pay Certificate API and related model files. The additions are consistent with the expanded public API surface.

Also applies to: 12-12, 16-17, 103-103

src/api/apple-pay-certificate-api.ts (1)

1-690: LGTM! Apple Pay Certificate API properly generated and structured.

The new Apple Pay Certificate API has been correctly generated with comprehensive endpoint coverage:

  • activate: Uploads signed certificate from Apple
  • create: Generates CSR for certificate creation
  • get: Retrieves certificate by ID
  • getAll: Lists all certificates
  • remove: Deletes certificate
  • update: Toggles active status

The implementation follows established patterns:

  • Proper parameter validation via assertParamExists
  • API key authentication on all endpoints
  • Consistent error handling with imported error types
  • Complete JSDoc documentation with detailed workflow instructions
  • Three interface styles (FP, Factory, OOP) for flexibility
src/api/apple-pay-domain-api.ts (1)

42-42: Verify the breaking change in domain registration return type.

The domain registration endpoint's return type has changed from ApplePayDomainRegister200Response to ApplePayCertificatesRemove200Response. This is a breaking change that could affect existing integrations.

While both types appear to have the same structure ({ success?: boolean }), this type consolidation should be intentional and documented. Ensure that:

  1. The OpenAPI specification intentionally consolidated these response types
  2. Existing consumers are aware of this breaking change
  3. The semantic meaning of "certificate remove" response aligns with "domain register" response

Affects lines 42, 132-136, and 176-176 in src/api/apple-pay-domain-api.ts.

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