feat: add tests for Apple Pay Certificate API#19
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
4998463 to
93b4c94
Compare
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
WalkthroughAdds a generated Apple Pay Certificate API and related models, integrates it as Changes
Sequence Diagram(s)mermaid Dev->>SDK: monei.applePayCertificate.create(csr) Dev->>SDK: monei.applePayCertificate.activate(id, cert) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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-errorshould 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 guidelinesThe tests currently import
describe/itfrom Vitest and useitinstead oftest, while globals are configured and guidelines call fordescribe+testwith globals.To align with the documented conventions:
- Rely on global
describe/testinstead of importing them.- Prefer
testoveritin this suite.- (Optional but consistent) Name the root
describeafter 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
⛔ Files ignored due to path filters (1)
yarn.lockis 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 typeto avoid importing implementations.- Use
@ts-expect-errorinstead of@ts-ignoreand 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.tssrc/model/payment-payment-method-trustly.tssrc/model/update-subscription-request.tssrc/api/payments-api.tssrc/model/payment-methods-metadata-sofort.tssrc/model/payment-methods-metadata-trustly.tssrc/model/send-payment-receipt-request.tssrc/common.tssrc/model/payment-transaction-type.tssrc/model/payment-methods-metadata-click-to-pay.tssrc/api/bizum-api.tssrc/model/payment-methods-metadata-eps.tssrc/model/payment-shop.tssrc/model/service-unavailable-error.tssrc/model/payment-methods-metadata-alipay.tssrc/model/activate-subscription-request.tssrc/model/payment-methods-metadata-sepa.tssrc/model/payment-last-refund-reason.tssrc/model/pause-subscription-request.tssrc/model/payment-methods-metadata-giropay.tssrc/model/payment-payment-method-sepa.tssrc/model/subscription-retry-schedule-inner.tssrc/model/payment-trace-details.tssrc/model/unprocessable-entity-error.tssrc/model/update-apple-pay-certificate-request.tssrc/model/send-payment-link-request.tssrc/model/payment-session-details.tssrc/model/payment-payment-method-card.tssrc/model/send-subscription-status-request.tssrc/model/payment-methods-metadata-bancontact.tssrc/model/payment-next-action.tssrc/model/payment-message-language.tsindex.tssrc/api/payment-methods-api.tssrc/model/recurring-payment-request.tssrc/configuration.tssrc/model/payment-methods-metadata-click-to-pay-discover.tssrc/model/payment-message-channel.tssrc/model/payment-methods.tssrc/model/payment-methods-metadata-card.tssrc/model/confirm-payment-request-payment-method.tssrc/model/payment-methods-metadata-click-to-pay-visa.tssrc/model/subscription-retry-schedule.tssrc/model/payment-payment-method-mbway.tssrc/api/subscriptions-api.tssrc/model/cancel-subscription-request.tssrc/model/payment-methods-metadata-ideal.tssrc/model/payment-methods-metadata-bizum.tssrc/model/apple-pay-certificate-delete200-response.tssrc/model/subscription-status.tstests/apple-pay-certificate-api.test.tssrc/model/payment-payment-method-bizum-input.tssrc/model/payment-payment-method-card-input.tssrc/model/api-exception.tssrc/model/apple-pay-certificate.tssrc/model/confirm-payment-request-payment-method-card.tssrc/model/bad-request-error.tssrc/model/subscription-last-payment.tssrc/model/payment-methods-methods.tssrc/model/payment-methods-metadata-klarna.tssrc/model/payment-customer.tssrc/model/send-payment-request-request.tssrc/model/index.tssrc/model/activate-apple-pay-certificate-request.tssrc/model/payment-refund-reason.tssrc/model/payment-payment-method-paypal.tssrc/model/payment-methods-metadata-click-to-pay-mastercard.tssrc/model/validate-bizum-phone-request.tssrc/model/internal-server-error.tssrc/model/subscription-interval.tssrc/model/payment-billing-details.tssrc/model/unauthorized-error.tssrc/model/cancel-payment-request.tssrc/model/payment-payment-method.tssrc/model/send-subscription-link-request.tssrc/model/subscription-payment-methods.tssrc/model/payment-sequence.tssrc/model/payment-cancellation-reason.tssrc/base.tssrc/model/payment-methods-metadata.tssrc/model/payment-payment-method-input.tssrc/model/bizum-validate-phone200-response.tssrc/model/create-payment-request.tssrc/model/subscription-payment-method.tssrc/model/payment-sequence-recurring.tssrc/model/subscription-payment-method-card.tssrc/model/payment-status.tssrc/model/payment-methods-metadata-mbway.tssrc/api/apple-pay-certificate-api.tssrc/model/subscription.tssrc/model/not-found-error.tssrc/model/address.tssrc/model/payment-methods-metadata-blik.tssrc/model/register-apple-pay-domain-request.tssrc/model/capture-payment-request.tssrc/api/apple-pay-domain-api.tssrc/model/payment.tssrc/model/payment-shipping-details.tssrc/model/payment-payment-method-klarna.tssrc/model/payment-methods-metadata-apple-pay.tssrc/api.tssrc/model/create-subscription-request.tssrc/model/confirm-payment-request.tssrc/model/payment-payment-method-bizum.tssrc/index.tssrc/model/payment-methods-metadata-google-pay.tssrc/model/payment-payment-methods.ts
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
src/model/refund-payment-request.tssrc/model/payment-payment-method-trustly.tssrc/model/update-subscription-request.tssrc/api/payments-api.tssrc/model/payment-methods-metadata-sofort.tssrc/model/payment-methods-metadata-trustly.tssrc/model/send-payment-receipt-request.tssrc/common.tssrc/model/payment-transaction-type.tssrc/model/payment-methods-metadata-click-to-pay.tssrc/api/bizum-api.tssrc/model/payment-methods-metadata-eps.tssrc/model/payment-shop.tssrc/model/service-unavailable-error.tssrc/model/payment-methods-metadata-alipay.tssrc/model/activate-subscription-request.tssrc/model/payment-methods-metadata-sepa.tssrc/model/payment-last-refund-reason.tssrc/model/pause-subscription-request.tssrc/model/payment-methods-metadata-giropay.tssrc/model/payment-payment-method-sepa.tssrc/model/subscription-retry-schedule-inner.tssrc/model/payment-trace-details.tssrc/model/unprocessable-entity-error.tssrc/model/update-apple-pay-certificate-request.tssrc/model/send-payment-link-request.tssrc/model/payment-session-details.tssrc/model/payment-payment-method-card.tssrc/model/send-subscription-status-request.tssrc/model/payment-methods-metadata-bancontact.tssrc/model/payment-next-action.tssrc/model/payment-message-language.tsindex.tssrc/api/payment-methods-api.tssrc/model/recurring-payment-request.tssrc/configuration.tssrc/model/payment-methods-metadata-click-to-pay-discover.tssrc/model/payment-message-channel.tssrc/model/payment-methods.tssrc/model/payment-methods-metadata-card.tssrc/model/confirm-payment-request-payment-method.tssrc/model/payment-methods-metadata-click-to-pay-visa.tssrc/model/subscription-retry-schedule.tssrc/model/payment-payment-method-mbway.tssrc/api/subscriptions-api.tssrc/model/cancel-subscription-request.tssrc/model/payment-methods-metadata-ideal.tssrc/model/payment-methods-metadata-bizum.tssrc/model/apple-pay-certificate-delete200-response.tssrc/model/subscription-status.tstests/apple-pay-certificate-api.test.tssrc/model/payment-payment-method-bizum-input.tssrc/model/payment-payment-method-card-input.tssrc/model/api-exception.tssrc/model/apple-pay-certificate.tssrc/model/confirm-payment-request-payment-method-card.tssrc/model/bad-request-error.tssrc/model/subscription-last-payment.tssrc/model/payment-methods-methods.tssrc/model/payment-methods-metadata-klarna.tssrc/model/payment-customer.tssrc/model/send-payment-request-request.tssrc/model/index.tssrc/model/activate-apple-pay-certificate-request.tssrc/model/payment-refund-reason.tssrc/model/payment-payment-method-paypal.tssrc/model/payment-methods-metadata-click-to-pay-mastercard.tssrc/model/validate-bizum-phone-request.tssrc/model/internal-server-error.tssrc/model/subscription-interval.tssrc/model/payment-billing-details.tssrc/model/unauthorized-error.tspackage.jsonsrc/model/cancel-payment-request.tssrc/model/payment-payment-method.tssrc/model/send-subscription-link-request.tssrc/model/subscription-payment-methods.tssrc/model/payment-sequence.tssrc/model/payment-cancellation-reason.tssrc/base.tssrc/model/payment-methods-metadata.tssrc/model/payment-payment-method-input.tssrc/model/bizum-validate-phone200-response.tssrc/model/create-payment-request.tssrc/model/subscription-payment-method.tssrc/model/payment-sequence-recurring.tssrc/model/subscription-payment-method-card.tssrc/model/payment-status.tssrc/model/payment-methods-metadata-mbway.tssrc/api/apple-pay-certificate-api.tssrc/model/subscription.tssrc/model/not-found-error.tssrc/model/address.tssrc/model/payment-methods-metadata-blik.tssrc/model/register-apple-pay-domain-request.tssrc/model/capture-payment-request.tssrc/api/apple-pay-domain-api.tssrc/model/payment.tssrc/model/payment-shipping-details.tssrc/model/payment-payment-method-klarna.tssrc/model/payment-methods-metadata-apple-pay.tssrc/api.tssrc/model/create-subscription-request.tssrc/model/confirm-payment-request.tssrc/model/payment-payment-method-bizum.tssrc/index.tssrc/model/payment-methods-metadata-google-pay.tssrc/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.tsextension.- Vitest is configured with globals; do not import
describeandtestfromvitest.- Use
describeandtestblocks to organize test cases.- Name root-level
describeblocks after the file name, without the extension.- Prefer
toMatchInlineSnapshotovertoMatchSnapshotfor snapshot testing.- Use
test.eachto 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
getEnvfunction; instead, define all environment variables invitest.config.ts.- Never mock
withErrorfunction; its a pure function and should not be mocked. Mock the function inside thewithErrorfunction.- Prefer using
vi.spyOnovervi.mockto mock modules.- When mocking a named export, first import the module with
import * as module from 'module';and then usevi.spyOn(module, 'method').mockImplementation(() => { ... });.- Use
structuredCloneto clone mock data.- Do not mock
getEnvfunction, instead define all environment variables invitest.config.tsor usevi.stubEnvto stub environment variables.- Do not mock
dayjsfunction, instead usevi.useFakeTimers()to mock the current time.- Always clear all mocks in
afterEachhook, not inbeforeEach.- Never mock entire Dynamoose model classes. Instead, use
vi.spyOnto 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
QueryResponseshould 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 correctHeader version updated to
1.8.0with 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 onlyOpenAPI document version set to
1.8.0; theSubscriptionPaymentMethodCardinterface and enums remain unchanged and type-safe.src/model/subscription-last-payment.ts (1)
7-7: Version header aligned with 1.8.0 specOnly the OpenAPI document version in the header changed to
1.8.0;SubscriptionLastPaymentand its imports are untouched.src/model/payment-methods-metadata-google-pay.ts (1)
7-7: Google Pay metadata model: metadata-only updateThe header now references OpenAPI
1.8.0; no changes toPaymentMethodsMetadataGooglePayitself.src/model/bad-request-error.ts (1)
7-7: BadRequestError model header updated onlyOpenAPI document version updated to
1.8.0; theBadRequestErroralias remains the same.src/model/subscription-payment-method.ts (1)
7-7: Subscription payment method model: header version bumpOnly 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 onlyHeader 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.0The only change is the OpenAPI document version in the header;
PaymentMethodsMetadataApplePayremains 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
PaymentPaymentMethodTrustlyinterface remains unchanged.src/model/payment-payment-method-card-input.ts (1)
7-7: LGTM!Version metadata update only. The
PaymentPaymentMethodCardInputinterface remains unchanged.src/model/payment-methods-metadata-bizum.ts (1)
7-7: LGTM!Version metadata update only. The
PaymentMethodsMetadataBizuminterface 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 goodOpenAPI 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 onlyOpenAPI version header moved to 1.8.0;
PaymentBillingDetailsinterface is unchanged. No action needed.src/model/register-apple-pay-domain-request.ts (1)
7-7: RegisterApplePayDomainRequest remains stableJust the generated header version updated to 1.8.0; the
RegisterApplePayDomainRequestcontract stays the same.src/model/payment-methods-metadata-ideal.ts (1)
7-7: Consistent spec version bump for iDEAL metadataHeader now references OpenAPI 1.8.0;
PaymentMethodsMetadataIDealinterface is untouched. All good.src/common.ts (1)
7-7: Common utilities unaffected by version header changeOnly 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 unchangedOpenAPI header moved to 1.8.0;
PaymentPaymentMethodBizuminterface is preserved as-is.src/api/subscriptions-api.ts (1)
7-7: Subscriptions API remains functionally identicalThis 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 bumpThe OpenAPI header now references 1.8.0;
PaymentTraceDetailsfields 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
SubscriptionStatusenum 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
RefundPaymentRequestinterface remains unchanged.src/configuration.ts (1)
7-7: LGTM!Auto-generated version bump. The
Configurationclass andConfigurationParametersinterface 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
ConfirmPaymentRequestinterface and all its fields remain unchanged.src/model/subscription.ts (1)
7-7: OpenAPI header version bump looks consistentHeader 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 specOpenAPI 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 correctlyHeader now references OpenAPI document version 1.8.0 and marks the file as generator-owned; the
NotFoundErroralias is unchanged. All good.src/model/payment-methods-metadata-giropay.ts (1)
7-7: Giropay metadata version bump is OKOpenAPI 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.0The 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 correctlyOpenAPI 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 fineThe file now references OpenAPI 1.8.0 with no changes to
SendPaymentLinkRequestitself. Looks good.src/model/capture-payment-request.ts (1)
7-7: CapturePaymentRequest OpenAPI version alignedDocument 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 goodThis 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 changesThe 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 safeOnly the documented OpenAPI version is updated to 1.8.0; the
BizumValidatePhone200Responseshape is unchanged.src/model/cancel-subscription-request.ts (1)
7-7: CancelSubscriptionRequest header metadata aligned with 1.8.0The OpenAPI version annotation is updated, with the request interface unchanged.
src/model/confirm-payment-request-payment-method.ts (1)
7-7: ConfirmPaymentRequestPaymentMethod version bump onlyUpdating 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-functionalThe 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 onlyThe 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.0Only 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 consistentUpdating the generated header to
1.8.0aligns this base client with the new spec version; no runtime impact here.src/model/unauthorized-error.ts (1)
7-7: UnauthorizedError model header updated correctlyThe 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.0The header version update to
1.8.0is 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 updatedSetting the OpenAPI document version to
1.8.0here 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.0The 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.0The 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 safeThe 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.0The 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 correctOpenAPI document version updated to
1.8.0with no changes to thePaymentPaymentMethodSepainterface. Safe, consistent metadata change only.src/model/payment-sequence-recurring.ts (1)
4-13: OpenAPI header version aligned to 1.8.0Only the documented OpenAPI version was updated; the
PaymentSequenceRecurringstructure is untouched. No further action needed.src/model/payment-payment-method-klarna.ts (1)
4-13: Auto-generated header updated; Klarna model unchangedThe OpenAPI version and generator notice are updated while
PaymentPaymentMethodKlarnaand its enums remain identical. This is consistent with regenerated models.src/model/payment-cancellation-reason.ts (1)
4-13: Cancellation reason model unchanged; header updatedOnly the OpenAPI document version in the header changed to
1.8.0; thePaymentCancellationReasonenum is intact.src/model/payment-methods-metadata-sepa.ts (1)
4-13: SEPA metadata model header synced to 1.8.0The header now reflects OpenAPI
1.8.0;PaymentMethodsMetadataSepais otherwise unchanged. Looks good.src/model/send-subscription-link-request.ts (1)
4-13: SendSubscriptionLinkRequest model unaffected by header bumpOnly 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.0The header correctly references OpenAPI
1.8.0; thePaymentMessageLanguageenum is unchanged. No issues.src/model/payment.ts (1)
4-13: Payment model unchanged; header reflects OpenAPI 1.8.0This is a straightforward regeneration of the header metadata; the
Paymentinterface and its imports are unchanged and remain type-safe.src/model/payment-payment-method-mbway.ts (1)
7-7: OpenAPI version bump is consistentHeader 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 minimalRequired
cert: stringfield 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
ApplePayCertificateDelete200Responsewith optionalsuccess?: booleanis sufficient for a simple confirmation payload.index.ts (1)
4-11: ApplePayCertificateApi correctly integrated into Monei clientThe new
applePayCertificateAPI 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 semanticsThe 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 appropriateSingle
active: booleanflag cleanly models enable/disable behavior for the update endpoint; no adjustments needed.src/api.ts (1)
7-7: Barrel exports now include ApplePayCertificateApiThe 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 typesThe 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 registeredThe 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 returnsApplePayCertificateDelete200Response– verify shared schema intentThe
registeroperation forApplePayDomainApiis now wired to theApplePayCertificateDelete200Responsetype (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 consistentThe 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
Authorizationheader on every call.- Correctly sets JSON
Content-Typeand serializes bodies foractivateandupdate.- Returns appropriately typed promises (
ApplePayCertificate,ApplePayCertificateDelete200Response, arrays ofApplePayCertificate) through the FP, factory, and OO interfaces.This aligns with the helper utilities in
common.ts/base.tsand should integrate cleanly with the existingMoneiclient.Also applies to: 344-500, 507-590, 598-690
- 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.
93b4c94 to
e899311
Compare
There was a problem hiding this comment.
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_DIRECTORIES→VITEST_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 guidelinesPer the testing guidelines, Vitest is configured with globals and tests should use
describe/testblocks:
- You can drop the explicit
import {afterEach, describe, expect, it} from 'vitest';and rely on the globaldescribe,test/it,expect, andafterEach.- Consider using
testinstead ofitfor consistency with “Usedescribeandtestblocks”.- Optionally rename the top-level
describeto 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
⛔ Files ignored due to path filters (1)
yarn.lockis 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 typeto avoid importing implementations.- Use
@ts-expect-errorinstead of@ts-ignoreand 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.tssrc/model/confirm-payment-request-payment-method-card.tssrc/model/index.tssrc/model/service-unavailable-error.tssrc/api/apple-pay-domain-api.tssrc/model/activate-apple-pay-certificate-request.tssrc/model/payment-status.tssrc/model/subscription-last-payment.tstests/apple-pay-certificate-api.test.tssrc/model/update-apple-pay-certificate-request.tssrc/api/bizum-api.tssrc/model/payment-methods-metadata.tssrc/model/update-subscription-request.tssrc/model/cancel-subscription-request.tssrc/model/payment-message-language.ts
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
src/model/payment-payment-method-trustly.tssrc/model/confirm-payment-request-payment-method-card.tssrc/model/index.tssrc/model/service-unavailable-error.tspackage.jsonsrc/api/apple-pay-domain-api.tssrc/model/activate-apple-pay-certificate-request.tssrc/model/payment-status.tssrc/model/subscription-last-payment.tstests/apple-pay-certificate-api.test.tssrc/model/update-apple-pay-certificate-request.tssrc/api/bizum-api.tssrc/model/payment-methods-metadata.tssrc/model/update-subscription-request.tssrc/model/cancel-subscription-request.tssrc/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.tsextension.- Vitest is configured with globals; do not import
describeandtestfromvitest.- Use
describeandtestblocks to organize test cases.- Name root-level
describeblocks after the file name, without the extension.- Prefer
toMatchInlineSnapshotovertoMatchSnapshotfor snapshot testing.- Use
test.eachto 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
getEnvfunction; instead, define all environment variables invitest.config.ts.- Never mock
withErrorfunction; its a pure function and should not be mocked. Mock the function inside thewithErrorfunction.- Prefer using
vi.spyOnovervi.mockto mock modules.- When mocking a named export, first import the module with
import * as module from 'module';and then usevi.spyOn(module, 'method').mockImplementation(() => { ... });.- Use
structuredCloneto clone mock data.- Do not mock
getEnvfunction, instead define all environment variables invitest.config.tsor usevi.stubEnvto stub environment variables.- Do not mock
dayjsfunction, instead usevi.useFakeTimers()to mock the current time.- Always clear all mocks in
afterEachhook, not inbeforeEach.- Never mock entire Dynamoose model classes. Instead, use
vi.spyOnto 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
QueryResponseshould 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 onlyHeader 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 updatedDoc header now points to OpenAPI 1.8.0; the
ServiceUnavailableError = ApiExceptionalias remains intact.src/api/bizum-api.ts (1)
7-7: BizumApi OpenAPI header syncVersion 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: stringas 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 typeThe added exports for
activate-apple-pay-certificate-request,apple-pay-certificate,apple-pay-certificate-delete200-response, andupdate-apple-pay-certificate-requestkeep the model index in sync with the new Apple Pay certificate API and look good.Note that
apple-pay-domain-register200-responseis no longer exported from this index, andApplePayDomainApi.registernow returnsApplePayCertificateDelete200Response. 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 contractsThe 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
expireAtand other fields consistent with the generatedApplePayCertificatemodel.- The delete test expects
{success: true}, matchingApplePayCertificateDelete200Response.- Axios mocks are reset in
afterEachvia sharedresetTestEnv, 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: booleanas 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 expectationsThe domain registration endpoint now:
- Uses
ApplePayCertificateDelete200Responseas its 200‑response type.- Returns
AxiosPromise<ApplePayCertificateDelete200Response>from both FP and factory interfaces.Given
ApplePayCertificateDelete200Responseis just a{success?: boolean}wrapper, behavior is effectively unchanged, but this renames the public TS type associated withApplePayDomainApi.register. Please confirm this rename is acceptable for your consumers (or documented as a breaking change) and that no callers depend on the oldApplePayDomainRegister200Responsesymbol.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.
There was a problem hiding this comment.
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 changesUse 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
📒 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 typeto avoid importing implementations.- Use
@ts-expect-errorinstead of@ts-ignoreand 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.tssrc/model/apple-pay-certificates-remove200-response.tssrc/model/bizum-validate-phone200-response.tssrc/model/subscription-interval.tssrc/api/apple-pay-domain-api.tssrc/model/payment-shipping-details.tssrc/model/subscription-retry-schedule.tssrc/base.tssrc/model/index.tssrc/model/payment-methods-metadata-bizum.tssrc/model/payment-methods-metadata-sofort.tssrc/model/unprocessable-entity-error.tssrc/model/payment-methods-metadata-mbway.tssrc/model/unauthorized-error.tssrc/model/service-unavailable-error.tssrc/model/bad-request-error.tssrc/model/subscription-status.tssrc/api.tssrc/api/apple-pay-certificate-api.tssrc/model/create-subscription-request.ts
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
src/model/activate-subscription-request.tstsconfig.build.jsonsrc/model/apple-pay-certificates-remove200-response.tssrc/model/bizum-validate-phone200-response.tssrc/model/subscription-interval.tssrc/api/apple-pay-domain-api.tssrc/model/payment-shipping-details.tssrc/model/subscription-retry-schedule.tssrc/base.tssrc/model/index.tssrc/model/payment-methods-metadata-bizum.tssrc/model/payment-methods-metadata-sofort.tssrc/model/unprocessable-entity-error.tssrc/model/payment-methods-metadata-mbway.tssrc/model/unauthorized-error.tssrc/model/service-unavailable-error.tssrc/model/bad-request-error.tssrc/model/subscription-status.tssrc/api.tssrc/api/apple-pay-certificate-api.tssrc/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 safeThe version string update to
1.8.1in 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 onlyOpenAPI 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 updateThe 1.8.1 OpenAPI version bump is limited to documentation comments; the
PaymentMethodsMetadataSofortinterface remains unchanged. All good.src/model/payment-methods-metadata-bizum.ts (1)
4-12: Doc-only change for Bizum metadataUpdated OpenAPI document version to 1.8.1 in comments;
PaymentMethodsMetadataBizumis unaffected. Looks fine.src/model/subscription-retry-schedule.ts (1)
4-12: Subscription retry schedule: header metadata updateOnly the documented OpenAPI version was bumped to 1.8.1; the
SubscriptionRetryScheduletype remains identical. No issues.src/base.ts (1)
4-12: Base API file: comment-only OpenAPI version bumpThe change here is just the OpenAPI document version in the header comment (to 1.8.1); the
BaseAPIimplementation and related types are unchanged. Safe update.src/model/unprocessable-entity-error.ts (1)
4-12: Unprocessable entity error: version in headerOnly the header’s OpenAPI version string changed to 1.8.1; the
UnprocessableEntityErrortype alias is untouched. No concerns.tsconfig.build.json (1)
5-10: Build config: enabling Node types for the buildAdding
"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 bumpThe update to OpenAPI version 1.8.1 is confined to the auto-generated header; the
PaymentMethodsMetadataMbwayinterface is unchanged. Looks good.src/model/payment-shipping-details.ts (1)
7-7: OpenAPI version header updated onlyThis 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.1Only the OpenAPI document version annotation changed; enum values and typing remain identical.
src/model/activate-subscription-request.ts (1)
7-7: ActivateSubscriptionRequest header bump onlyOpenAPI 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.1The change is limited to the generated header version; the UnauthorizedError alias remains intact.
src/model/subscription-interval.ts (1)
7-7: SubscriptionInterval header version bumpOnly 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 tagThe 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.1Non-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 minimalThe interface with an optional
success?: booleancleanly 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-requestapple-pay-certificateapple-pay-certificates-remove200-responseupdate-apple-pay-certificate-requestThese 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
ApplePayDomainRegister200ResponsetoApplePayCertificatesRemove200Response. 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:
- The OpenAPI specification intentionally consolidated these response types
- Existing consumers are aware of this breaking change
- 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.
Summary
Add missing test coverage for the new Apple Pay Certificate API endpoints.
Implementation
createendpoint (CSR generation)getendpoint (fetch certificate by id)listendpoint (fetch all certificates)activateendpoint (upload signed cert from Apple)updateendpoint (toggle active status)_deleteendpoint (remove certificate)Test plan
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.